The zaqar.transport.wsgi.v2_0.flavors module

class Listing(flavors_controller, pools_controller, validate)

Bases: object

A resource to list registered flavors

Parameters:flavors_controller – means to interact with storage
on_get(*args, **kwargs)

Returns a flavor listing as objects embedded in an object:

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

Bases: object

A handler for individual flavor.

Parameters:flavors_controller – means to interact with storage
on_delete(*args, **kwargs)

Deregisters a flavor.

Returns:HTTP | [204]
on_get(*args, **kwargs)

Returns a JSON object for a single flavor entry:

{"pool": "", capabilities: {...}}
Returns:HTTP | [200, 404]
on_patch(*args, **kwargs)

Allows one to update a flavors’s pool_group.

This method expects the user to submit a JSON object containing ‘pool_group’. If none is 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(*args, **kwargs)

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]