components Package¶
api Module¶
copyright: | © 2015 by CRS4. |
---|---|
license: | gpl-2, see License for more details. |
Description¶
Base file where parent routines are defined and from where these will be inherited.
api_v1 Module¶
copyright: | © 2015 by CRS4. |
---|---|
license: | gpl-2, see License for more details. |
Description¶
API level v1 blueprint
This blueprint provides V.1 API dialect to specific functions:
- RunAndStopVM provides start and stop VMs facilities
- AssignReleaseVM provides facilities to reserve and release VMs for users and applications
- SystemStatus to have always the system under control
In api_call_examples file there are several examples about how to use and deal with the middleware.
- class dispatcher.components.api_v1.AssignReleaseVM[source]¶
Bases: dispatcher.components.api.VMManageAPI
Assign / Release VM to user
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.AssignmentStatusVM[source]¶
Bases: dispatcher.components.api.VMManageAPI
Assignment status for remote clouds
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.AuthAPI[source]¶
Bases: dispatcher.components.api.VMManageAPI
Authentication endpoint class, used to get auth token
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.CisternConnection(cloud)[source]¶
Bases: object
Service Class to route queries over CISTERN API
- get_page(url, **kwargs)[source]¶
Make a request to cistern.
url is the url to contact, protocol and servername is added on the fly with what has been specified on initialization of the object
- kwargs is an attribute of optional key/value pairs, should be:
- method, the way to contact the server, default is ‘get’,
- payload, is a dictionary structure containing additional payload useful to the request
- class dispatcher.components.api_v1.CloudConnection[source]¶
Bases: object
Service Class, used to serve queries on demand routed over clouds.
This Class is designed to provide an uniformed layer to get
- get_node()
- get_images()
- get_size()
- static fetch_object_by_field(cloud, method, id_obj, field)[source]¶
General fetching routine filtered by field
- class dispatcher.components.api_v1.CloudServed[source]¶
Bases: dispatcher.components.api.VMManageAPI
Provides a list of the served cloud pool
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.FooClass[source]¶
Bases: dispatcher.components.api.VMManageAPI
test foo class
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.HomeAPI[source]¶
Bases: dispatcher.components.api.VMManageAPI
Generic root endpoint class
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.ManageFirewall[source]¶
Bases: dispatcher.components.api.VMManageAPI
Firewall management class, used to open and close ports
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.ManageStorage[source]¶
Bases: dispatcher.components.api.VMManageAPI
ToDo class
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- class dispatcher.components.api_v1.RunAndStopVM[source]¶
Bases: dispatcher.components.api.VMManageAPI
Provides start and stop routines to launch VMs in the cloud
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
- post(cloud='default')[source]¶
Used to launch a new VM
request.data is the payload in JSON and should contain :
- image : the image identifier, a string like “3c725bdb-b575-4e0f-b21b-67b0d089867d”
- size : the size/flavor identifier, same thing as images
- metadata : custom Key/Value metadata dictionary t0o associate with a node
- keyname : A string containing the name of existing public key to inject into instance
Depending cloud provider needs this class could be enhanced and extended, each cloud takes his own attributes
- class dispatcher.components.api_v1.SystemStatus[source]¶
Bases: dispatcher.components.api.VMManageAPI
Status management class, used to get the status of VMs
- get(action, cloud='default')[source]¶
Factory GET routine, it accepts:
action: {flavors,images,nodes}
cloud: the source where we get data from, if not specified “default” is choosen
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶
api_v2 Module¶
copyright: | © 2015 by CRS4. |
---|---|
license: | gpl-2, see License for more details. |
Description¶
API level v2 blueprint
This module is a mere template for future developments.
- class dispatcher.components.api_v2.VMManageAPIV2[source]¶
Bases: dispatcher.components.api.VMManageAPI
- methods = ['DELETE', 'GET', 'OPTIONS', 'PATCH', 'POST', 'PUT']¶