Features: user, project, quota, resource, commission, endpoint, service
Features server, flavor
Features file, container, sharer, group
Features (image, imagecompute)
Features network, port, subnet, ip
Bases: kamaki.clients.Client
GET endpoint_url[/flavor_id][/command]
Parameters: |
|
---|
— Parameters —
Parameters: |
|
---|---|
Returns: | request response |
DEL ETE endpoint_url/images/<image_id>
Returns: | request response |
---|
GET endpoint_url[/image_id][/command]
Parameters: |
|
---|
— Parameters — :param changes_since: when the image last changed status
Parameters: |
|
---|---|
Returns: | request response |
DEL ETE endpoint_url/images/<image_id>/metadata/key
Returns: | request response |
---|
GET endpoint_url/<image_id>/metadata[/key]
Returns: | request response |
---|
POST endpoint_url/images/<image_id>/metadata
Returns: | request response |
---|
PUT endpoint_url/images/<image_id>/metadata
Returns: | request response |
---|
GET endpoint_url/limits
Parameters: | success – success code or list or tupple of accepted success codes. if server response code is not in this list, a ClientError raises |
---|---|
Returns: | request response |
POST endpoint_url/servers/<server_id>/action
Returns: | request response |
---|
DEL ETE endpoint_url/servers/<server_id>
Parameters: |
|
---|---|
Raises ClientError: | |
if returned code not in success list |
|
Returns: | request response |
GET endpoint_url/servers/[‘detail’ | <server_id>]
Parameters: |
|
---|---|
Returns: | request response |
GET endpoint_url/servers/<server_id>/ips[/network_id]
Parameters: | changes_since – time/date stamp in UNIX/epoch time. Checks for changes since a previous request. |
---|---|
Returns: | request response |
DEL ETE endpoint_url/servers/<server_id>/metadata[/key]
Returns: | request response |
---|
GET endpoint_url/servers/<server_id>/metadata[/key]
Returns: | request response |
---|
POST endpoint_url/servers/<server_id>/metadata
Returns: | request response |
---|
PUT endpoint_url/servers/<server_id>/metadata[/key]
Returns: | request response |
---|
POST endpoint_url/servers
Parameters: |
|
---|---|
Returns: | request response |
PUT endpoint_url/servers/<server_id>
Parameters: |
|
---|---|
Raises ClientError: | |
if returned code not in success list |
|
Returns: | request response |
Bases: kamaki.clients.compute.rest_api.ComputeRestClient
OpenStack Compute API 1.1 client
Parameters: |
|
---|---|
Returns: | (dict) {fixed_ip: . id: . instance_id: . ip: . pool: .} |
Parameters: |
|
---|
Submit request to create a new server
Parameters: |
|
---|---|
Returns: | a dict with the new virtual server details |
Raises ClientError: | |
wraps request errors |
OpenStack method for taking snapshots
Parameters: |
|
---|---|
Returns: | (dict) request headers |
Parameters: |
|
---|---|
Returns: | (dict) response headers |
Submit a deletion request for a server specified by id
Parameters: | server_id – integer (str or int) |
---|---|
Returns: | (dict) response headers |
Parameters: |
|
---|---|
Returns: | (list) [ {fixed_ip: ..., id: ..., instance_id: ..., ip: ..., pool: ...}, ... ] |
Parameters: | tenant_id – (str) |
---|---|
Returns: | (dict) {floating_ip_pools:[{name: ...}, ...]} |
Parameters: | tenant_id – (str) |
---|---|
Returns: | (dict) {floating_ips:[ {fixed_ip: ..., id: ..., instance_id: ..., ip: ..., pool: ...}, ... ]} |
Returns: | dict |
---|---|
Raises ClientError: | |
404 if image not available |
Parameters: |
|
---|
:returns (dict) metadata if key not set, specific metadatum otherwise
Return detailed info for a server
Parameters: | server_id – integer (int or str) |
---|---|
Returns: | dict with server details |
Parameters: |
|
---|---|
Returns: | list of server ids and names |
Parameters: |
|
---|
Parameters: |
|
---|---|
Returns: | (dict) request headers |
Parameters: |
|
---|---|
Returns: | updated metadata |
Bases: kamaki.clients.blockstorage.BlockStorageClient
Synnefo Cyclades Block Storage REST API Client
Bases: kamaki.clients.compute.ComputeClient
Synnefo Cyclades REST API Client
alias of CycladesComputeRestClient
Bases: kamaki.clients.cyclades.rest_api.CycladesBlockStorageRestClient
Cyclades Block Storage REST API Client
Returns: | (dict) new snapshots’ details |
---|
alias of CycladesComputeClient
Bases: kamaki.clients.cyclades.rest_api.CycladesComputeRestClient, kamaki.clients.Waiter
Synnefo Cyclades Compute API client
Attach volume on server :param server_id: (str) :volume_id: (str) :returns: (dict) information on attachment (contains volumeId)
Submit request to create a new server
Parameters: |
|
---|---|
Returns: | a dict with the new virtual server details |
Raises ClientError: | |
wraps request errors |
Delete a volume attachment. The volume will not be deleted. :param server_id: (str) :param attachment_id: (str) :returns: (dict) HTTP response headers
Remove volume attachment(s) for this volume and server This is not an atomic operation. Use “delete_volume_attachment” for an atomic operation with similar semantics. :param server_id: (str) :param volume_id: (str) :returns: (list) the deleted attachments
Parameters: |
|
---|---|
Returns: | (dict) info to set a VNC connection to virtual server |
Parameters: | server_id – integer (str or int) |
---|---|
Returns: | (list) |
Parameters: | server_id – integer (str or int) |
---|---|
Returns: | (dict) auto-generated graphs of statistics (urls) |
Deprecated - will be removed in version 0.15 :returns: (current status, progress percentile if available)
Parameters: |
|
---|---|
Returns: | (dict) details on the volume attachment |
Parameters: | server_id – (str) |
---|---|
Returns: | (list) all volume attachments for this server |
Set the firewall profile for the public interface of a server :param server_id: integer (str or int) :param profile: (str) ENABLED | DISABLED | PROTECTED :param port_id: (str) This port must connect to a public network :returns: (dict) response headers
Submit a shutdown request
Parameters: | server_id – integer (str or int) |
---|---|
Returns: | (dict) response headers |
Submit a startup request
Parameters: | server_id – integer (str or int) |
---|---|
Returns: | (dict) response headers |
Wait for server WHILE its status is current_status :param server_id: integer (str or int) :param current_status: (str) BUILD|ACTIVE|STOPPED|DELETED|REBOOT :param delay: time interval between retries :max_wait: (int) timeout in secconds :param wait_cb: if set a progressbar is used to show progress :returns: (str) the new mode if succesfull, (bool) False if timed out
Wait for server WHILE its status is target_status :param server_id: integer (str or int) :param target_status: (str) BUILD|ACTIVE|STOPPED|DELETED|REBOOT :param delay: time interval between retries :max_wait: (int) timeout in secconds :param wait_cb: if set a progressbar is used to show progress :returns: (str) the new mode if succesfull, (bool) False if timed out
Wait for server WHILE its status is current_status :param server_id: integer (str or int) :param current_status: (str) BUILD|ACTIVE|STOPPED|DELETED|REBOOT :param delay: time interval between retries :max_wait: (int) timeout in secconds :param wait_cb: if set a progressbar is used to show progress :returns: (str) the new mode if succesfull, (bool) False if timed out
Bases: kamaki.clients.network.NetworkClient
Cyclades Network API extentions
Parameters: |
|
---|
Parameters: | fixed_ips – (list of dicts) [{“ip_address”: IPv4}, ...] |
---|
Bases: kamaki.clients.Client
OpenStack Object Storage API 1.0 client
Copy an objects from src_contaier:src_object to dst_container[:dst_object]
Parameters: |
|
---|
Parameters: | container – (str) |
---|---|
Raises ClientError: | |
202 Container already exists |
Parameters: | obj – (str) directory-object name |
---|---|
Returns: | (dict) request headers |
Parameters: |
|
---|---|
Returns: | (dict) object creation headers |
Parameters: | container – (str) |
---|---|
Raises: |
|
Parameters: | container – (str) |
---|---|
Returns: | (dict) |
Raises ClientError: | |
404 Container does not exist |
Parameters: |
|
---|---|
Returns: | (dict) |
Raises ClientError: | |
404 Invalid account |
Parameters: | path_prefix – (str) |
---|---|
Raises ClientError: | |
404 Invalid account | |
Returns: | (dict) |
Bases: kamaki.clients.storage.StorageClient
Full Pithos+ GET at account level
— request parameters —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ HEAD at account level
— request parameters —
Parameters: | until – (string) optional timestamp |
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ POST at account level
— request parameters —
Parameters: | update – (bool) if True, Do not replace metadata/groups |
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ DELETE at container level
— request parameters —
Parameters: | until – (timestamp string) if defined, container is purged up to that time |
---|---|
Returns: | ConnectionResponse |
Full Pithos+ GET at container level
— request parameters —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ HEAD at container level
— request params —
Parameters: | until – (string) optional timestamp |
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ POST at container level
— request params —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ PUT at container level
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ COPY at object level
— request parameters —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ DELETE at object level
— request parameters —
Parameters: | until – (string) Optional timestamp |
---|---|
Returns: | ConnectionResponse |
Full Pithos+ GET at object level
— request parameters —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ HEAD at object level
— request parameters —
Parameters: | version – (string) optional version identified |
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ COPY at object level
— request parameters —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ POST at object level
— request parameters —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Full Pithos+ PUT at object level
— request parameters —
Parameters: |
|
---|
— request headers —
Parameters: |
|
---|---|
Returns: | ConnectionResponse |
Bases: kamaki.clients.pithos.rest_api.PithosRestClient
Synnefo Pithos+ API client
Parameters: |
|
---|
Parameters: |
|
---|---|
Returns: | (dict) response headers |
Parameters: |
|
---|---|
Returns: | (dict) response headers |
Parameters: |
|
---|---|
Returns: | (dict) created object metadata |
Parameters: |
|
---|---|
Raises: |
|
Parameters: | metakey – (str) metadatum key |
---|---|
Returns: | (dict) response headers |
Parameters: |
|
---|
Parameters: |
|
---|
Download an object (multiple connections, random blocks)
Parameters: |
|
---|
Download an object to a string (multiple connections). This method uses threads for http requests, but stores all content in memory.
Parameters: |
|
---|---|
Returns: | (str) the whole object contents |
Parameters: | until – (str) formated date |
---|---|
Returns: | (dict) |
Raises ClientError: | |
404 Container not found |
Parameters: | until – (str) formated date |
---|---|
Returns: | (dict) |
Parameters: |
|
---|---|
Returns: | (list) |
Parameters: |
|
---|---|
Returns: | (dict) |
Parameters: |
|
---|---|
Returns: | (dict) |
Get accounts that share with self.account
Parameters: |
|
---|---|
Returns: | (dict) |
Parameters: |
|
---|---|
Returns: | (dict) response headers |
Overwrite a part of an object from local source file ATTENTION: content_type must always be application/octet-stream
Parameters: |
|
---|
Parameters: |
|
---|
Give read/write permisions to an object.
Parameters: |
|
---|---|
Returns: | (dict) response headers |
Parameters: |
|
---|
Parameters: |
|
---|---|
Returns: | (dict) response headers |
Upload an object using multiple connections (threads)
Parameters: |
|
---|
Upload an object using multiple connections (threads)
Parameters: |
|
---|
Parameters: |
|
---|---|
Returns: | (dict) created object metadata |
Bases: kamaki.clients.Client
Synnefo Plankton API client
Parameters: |
|
---|
Parameters: | image_id – (str) |
---|---|
Returns: | (list) users who can use current user’s images |
Parameters: |
|
---|---|
Returns: | (list) id,name + full image info if detail |
Parameters: | member – (str) sharers account |
---|---|
Returns: | (list) images shared by member |
Register an image that is uploaded at location
Parameters: |
|
---|---|
Returns: | (dict) metadata of the created image |
Parameters: |
|
---|
Parameters: |
|
---|
Warning
For synnefo, the suggested network implementation is in kamaki.clients.cyclades.CycladesNetworkClient extension
Bases: kamaki.clients.network.rest_api.NetworkRestClient, kamaki.clients.Waiter
OpenStack Network API 2.0 client
Atomic operation for batch network creation (all or nothing)
Parameters: | networks – (list) [ {name: ..(str).., admin_state_up: ..(bool).., shared: ..(bool)..}, {name: ..(str).., admin_state_up: ..(bool).., shared: ..(bool)..}] name is mandatory, the rest is optional e.g., create_networks([ {name: ‘net1’, admin_state_up: True}, {name: ‘net2’}]) |
---|---|
Returns: | (list of dicts) created networks details |
Raises: |
|
Parameters: |
|
---|
Atomic operation for batch port creation (all or nothing)
Parameters: | ports – (list of dicts) {key: ...} with all parameters in the method create_port, where method mandatory / optional paramteres respond to mandatory / optional paramters in ports items |
---|---|
Returns: | (list of dicts) created portss details |
Raises: |
|
Parameters: |
|
---|
Atomic operation for batch subnet creation (all or nothing)
Parameters: | subnets – (list of dicts) {key: ...} with all parameters in the method create_subnet, where method mandatory / optional paramteres respond to mandatory / optional paramters in subnets items |
---|---|
Returns: | (list of dicts) created subnetss details |
Raises: |
|
To nullify something optional, use None
Parameters: |
|
---|
Parameters: |
|
---|
Wait for port while in current_status
Bases: astakosclient.AstakosClient
Wrap Original AstakosClient to ensure compatibility in kamaki clients
Accept a commission (see commission_action)
Perform action on a project application
Arguments: project_id – project identifier app_id – application identifier action – action to perform, one of “approve”, “deny”,
“dismiss”, “cancel”
reason – reason of performing the action
In case of success, return nothing.
Authenticate and get services’ endpoints
Keyword arguments: tenant_name – user’s uniq id (optional)
It returns back the token as well as information about the token holder and the services he/she can access (in json format).
The tenant_name is optional and if it is given it must match the user’s uuid.
In case of error raise an AstakosClientException.
Perform a commission action
Keyword arguments: serial – commission’s id (int) action – action to perform, currently accept/reject (string)
In case of success return nothing.
Submit application to create a new project
Arguments: specs – dict describing a project
In case of success, return project and application identifiers.
Enroll a user in a project
Arguments: project_id – project identifier email – user identified by email
In case of success, return membership identifier.
Get Description of a Commission
Keyword arguments: serial – commission’s id (int)
In case of success return a dict of dicts containing informations (details) about the requested commission
Get services’ endpoints
The extra parameter is to be used by _fill_endpoints. In case of error raise an AstakosClientException.
Retrieve membership description, if accessible
Arguments: memb_id – membership identifier
In case of success, return membership description.
Retrieve all accessible memberships
Arguments: project_id – filter by project (optional) project – backwards compatibility
In case of success, return a list of membership descriptions.
Get Pending Commissions
In case of success return a list of pending commissions’ ids (list of integers)
Retrieve project description, if accessible
Arguments: project_id – project identifier
In case of success, return project description.
Retrieve all accessible projects
Arguments: name – filter by name (optional) state – filter by state (optional) owner – filter by owner (optional) mode – if value is ‘member’, return only active projects in which
the request user is an active member
In case of success, return a list of project descriptions.
Get user’s quotas
In case of success return a dict of dicts with user’s current quotas. Otherwise raise an AstakosClientException
Return a dict of dicts with the available resources
Return a list of dicts with the registered services
Return the user name of a uuid (see get_usernames)
Return a uuid_catalog dictionary for the given uuids
Keyword arguments: uuids – list of user ids (list of strings)
The returned uuid_catalog is a dictionary with uuids as keys and the corresponding user names as values
Return the uuid of a name (see getUUIDs)
Return a displayname_catalog for the given names
Keyword arguments: display_names – list of user names (list of strings)
The returned displayname_catalog is a dictionary with the names as keys and the corresponding uuids as values
Issue commission (for multiple holder/source pairs)
keyword arguments: user_provisions – dict mapping user holdings
(user, project, resource) to integer quantities
name – description of the commission (string) force – force this commission (boolean) auto_accept – auto accept this commission (boolean)
In case of success return commission’s id (int). Otherwise raise an AstakosClientException.
Issue one commission (with specific holder and source)
keyword arguments: holder – user’s id (string) provisions – (source, resource) mapping to quantity name – description of the commission (string) force – force this commission (boolean) auto_accept – auto accept this commission (boolean)
In case of success return commission’s id (int). Otherwise raise an AstakosClientException.
Change resource assignment to another project
Join a project
Arguments: project_id – project identifier
In case of success, return membership identifier.
Perform action on a membership
Arguments: memb_id – membership identifier action – action to perform, one of “leave”, “cancel”, “accept”,
“reject”, “remove”
reason – reason of performing the action
In case of success, return nothing.
Submit application to modify an existing project
Arguments: project_id – project identifier specs – dict describing a project
In case of success, return project and application identifiers.
Perform action on a project
Arguments: project_id – project identifier action – action to perform, one of “suspend”, “unsuspend”,
“terminate”, “reinstate”
reason – reason of performing the action
In case of success, return nothing.
Reject a commission (see commission_action)
Resolve multiple commissions at once
Keyword arguments: accept_serials – commissions to accept (list of ints) reject_serials – commissions to reject (list of ints)
In case of success return a dict of dicts describing which commissions accepted, which rejected and which failed to resolved.
Send feedback to astakos service
keyword arguments: message – Feedback message data – Additional information about service client status
In case of success return nothing. Otherwise raise an AstakosClientException
Get all project quotas for resources associated with the service
Keyword arguments: project – optionally, the uuid of a specific project, or a list
thereof
In case of success return a dict of dicts with current quotas for all projects, or of a specified project, if project argument is set. Otherwise raise an AstakosClientException
Get all quotas for resources associated with the service
Keyword arguments: user – optionally, the uuid of a specific user, or a list thereof project_id – optionally, the uuid of a specific project, or a list
thereof
project – backwards compatibility (replaced by “project_id”)
In case of success return a dict of dicts of dicts with current quotas for all users, or of a specified user, if user argument is set. Otherwise raise an AstakosClientException
Return the displayName of a uuid using a service’s token
Return a uuid_catalog dict using a service’s token
Return the uuid of a name using a service’s token
Return a display_name catalog using a service’s token
Validate a temporary access token (oath2)
Keyword arguments: belongsTo – confirm that token belongs to tenant
It returns back the token as well as information about the token holder.
The belongs_to is optional and if it is given it must be inside the token’s scope.
In case of error raise an AstakosClientException.
Bases: kamaki.clients.ClientError
Bases: kamaki.clients.Client
Synnefo Astakos cached client wraper
Get authentication information and store it in this client As long as the CachedAstakosClient instance is alive, the latest authentication information for this token will be available
Parameters: | token – (str) custom token to authenticate |
---|
Parameters: | service_type – (str) compute, object-store, image, account, etc. |
---|---|
Returns: | (dict) {name:..., type:..., endpoints:[...]} |
Raises AstakosClientError: | |
if service_type not in service catalog |
Parameters: |
|
---|---|
Returns: | (dict) {SNF:uiURL, adminURL, internalURL, publicURL, ...} |
Raises AstakosClientError: | |
if service_type not in service catalog, or if #matching endpoints != 1 |
POST endpoint_url/user_catalogs
Parameters: |
|
---|---|
Returns: | (dict) {uuid1: name1, uuid2: name2, ...} or oposite |
Bases: kamaki.clients.astakos.AstakosClient, kamaki.clients.Logged
An AstakosClient wrapper with modified logging
Logs are adjusted to appear similar to the ones of kamaki clients. No other changes are made to the parent class.