The zaqar.transport.wsgi.v2_0.pools module

pools: a resource to handle storage pool management

A pool is added by an operator by interacting with the pooling-related endpoints. When specifying a pool, the following fields are required:

{
    "name": string,
    "weight": integer,
    "uri": string::uri
}

Furthermore, depending on the underlying storage type of pool being registered, there is an optional field:

{
    "options": {...}
}
class Listing(pools_controller, validate)

Bases: object

A resource to list registered pools

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

Returns a pool listing as objects embedded in an object:

{
    "pools": [
        {"href": "", "weight": 100, "uri": ""},
        ...
    ],
    "links": [
        {"href": "", "rel": "next"}
    ]
}
Returns:HTTP | 200
class Resource(pools_controller)

Bases: object

A handler for individual pool.

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

Deregisters a pool.

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

Returns a JSON object for a single pool entry:

{"weight": 100, "uri": "", options: {...}}
Returns:HTTP | [200, 404]
on_patch(*args, **kwargs)

Allows one to update a pool’s weight, uri, and/or options.

This method expects the user to submit a JSON object containing at least one of: ‘uri’, ‘weight’, ‘group’, ‘options’. 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(*args, **kwargs)

Registers a new pool. Expects the following input:

{"weight": 100, "uri": ""}

An options object may also be provided.

Returns:HTTP | [201, 204]