The zaqar.transport.wsgi.v1_1.flavors module

class Listing(flavors_controller)

Bases: object

A resource to list registered flavors

Parameters:flavors_controller – means to interact with storage
on_get(request, response, project_id)

Returns a flavor listing as objects embedded in an object:

{
    "flavors": [
        {"href": "", "capabilities": {}, "pool": ""},
        ...
    ],
    "links": [
        {"rel": "next", "href": ""},
        ...
    ]
}
Returns:HTTP | 200
class Resource(flavors_controller)

Bases: object

A handler for individual flavor.

Parameters:flavors_controller – means to interact with storage
on_delete(request, response, project_id, flavor)

Deregisters a flavor.

Returns:HTTP | [204]
on_get(request, response, project_id, flavor)

Returns a JSON object for a single flavor entry:

{"pool_group": "", capabilities: {...}}
Returns:HTTP | [200, 404]
on_patch(request, response, project_id, flavor)

Allows one to update a flavors’s pool and/or capabilities.

This method expects the user to submit a JSON object containing at least one of: ‘pool_group’, ‘capabilities’. If none are found, the request is flagged as bad. There is also strict format checking through the use of jsonschema. Appropriate errors are returned in each case for badly formatted input.

Returns:HTTP | [200, 400]
on_put(request, response, project_id, flavor)

Registers a new flavor. Expects the following input:

{"pool_group": "my-pool-group", "capabilities": {}}

A capabilities object may also be provided.

Returns:HTTP | [201, 400]

Previous topic

The zaqar.transport.wsgi.v1_1.claims module

Next topic

The zaqar.transport.wsgi.v1_1.health module

Project Source

This Page