taf.testlib.tempest_clients.magnum¶
taf.testlib.tempest_clients.magnum.clients¶
taf.testlib.tempest_clients.magnum.clients.cert_client¶
cert_client
-
class
taf.testlib.tempest_clients.magnum.clients.cert_client.CertClient(auth_provider)[source]¶ Bases:
testlib.tempest_clients.magnum.clients.client.MagnumClientEncapsulates REST calls and maps JSON to/from models
-
classmethod
cert_uri(cluster_id)[source]¶ Construct cluster uri.
Parameters: cluster_id – cluster uuid or name Returns: url string
-
get_cert(cluster_id, **kwargs)[source]¶ Makes GET /certificates/cluster_id request and returns CertEntity.
Abstracts REST call to return a single cert based on uuid or name
Parameters: cluster_id – cluster uuid or name Returns: response object and ClusterCollection object
-
post_cert(model, **kwargs)[source]¶ Makes POST /certificates request and returns CertEntity.
Abstracts REST call to sign new certificate
Parameters: model – CertEntity Returns: response object and CertEntity object
-
url= '/certificates'¶
-
classmethod
taf.testlib.tempest_clients.magnum.clients.client¶
client.py
-
class
taf.testlib.tempest_clients.magnum.clients.client.MagnumClient(auth_provider)[source]¶ Bases:
RestClientAbstract class responsible for setting up auth provider
-
classmethod
add_filters(url, filters)[source]¶ add_filters adds dict values (filters) to url as query parameters.
Parameters: - url – base URL for the request
- filters – dict with var:val pairs to add as parameters to URL
Returns: url string
-
tenant_id¶
-
classmethod
taf.testlib.tempest_clients.magnum.clients.cluster_client¶
cluster_client.py
-
class
taf.testlib.tempest_clients.magnum.clients.cluster_client.ClusterClient(auth_provider)[source]¶ Bases:
testlib.tempest_clients.magnum.clients.client.MagnumClientEncapsulates REST calls and maps JSON to/from models.
-
LOG¶
-
classmethod
cluster_uri(cluster_id)[source]¶ Construct cluster uri.
Parameters: cluster_id – cluster uuid or name Returns: url string
-
classmethod
clusters_uri(filters=None)[source]¶ Construct clusters uri with optional filters.
Parameters: filters – Optional k:v dict that’s converted to url query Returns: url string
-
delete_cluster(cluster_id, **kwargs)[source]¶ Makes DELETE /cluster request and returns response object
Abstracts REST call to delete cluster based on uuid or name
Parameters: cluster_id – UUID or name of cluster Returns: Response object
-
get_cluster(cluster_id, **kwargs)[source]¶ Makes GET /cluster request and returns ClusterEntity.
Abstracts REST call to return a single cluster based on uuid or name.
Parameters: cluster_id – cluster uuid or name Returns: Response object and ClusterCollection object
-
list_clusters(filters=None, **kwargs)[source]¶ Makes GET /clusters request and returns ClusterCollection.
Abstracts REST call to return all clusters.
Parameters: filters – Optional k:v dict that’s converted to url query Returns: Response object and ClusterCollection object
-
patch_cluster(cluster_id, clusterpatch_listmodel, **kwargs)[source]¶ Makes PATCH /cluster request and returns ClusterIdEntity
Abstracts REST call to update cluster attributes
Parameters: - cluster_id – UUID of cluster
- clusterpatch_listmodel – ClusterPatchCollection
Returns: Response object and ClusterIdEntity object
-
taf.testlib.tempest_clients.magnum.clients.cluster_template_client¶
cluster_template_client.py
-
class
taf.testlib.tempest_clients.magnum.clients.cluster_template_client.ClusterTemplateClient(auth_provider)[source]¶ Bases:
testlib.tempest_clients.magnum.clients.client.MagnumClientEncapsulates REST calls and maps JSON to/from models
-
classmethod
cluster_template_uri(cluster_template_id)[source]¶ Construct cluster_template uri.
Parameters: cluster_template_id – cluster_template uuid or name Returns: url string
-
classmethod
cluster_templates_uri(filters=None)[source]¶ Construct clustertemplates uri with optional filters.
Parameters: filters – Optional k:v dict that’s converted to url query Returns: url string
-
delete_cluster_template(cluster_template_id, **kwargs)[source]¶ Makes DELETE /clustertemplate request and returns response object
Abstracts REST call to delete clustertemplate based on uuid or name
Parameters: cluster_template_id – UUID or name of clustertemplate Returns: Response object
-
get_cluster_template(cluster_template_id, **kwargs)[source]¶ Makes GET /clustertemplate request and returns ClusterTemplateEntity.
Abstracts REST call to return a single clustertempalte based on uuid or name.
Parameters: cluster_template_id – clustertempalte uuid or name Returns: Response object and ClusterTemplateCollection object
-
list_cluster_templates(filters=None, **kwargs)[source]¶ Makes GET /clustertemplates request.
Abstracts REST call to return all clustertemplates.
Parameters: filters – Optional k:v dict that’s converted to url query Returns: Response object and ClusterTemplateCollection object
-
patch_cluster_template(cluster_template_id, cluster_templatepatch_listmodel, **kwargs)[source]¶ Makes PATCH /clustertemplate and returns ClusterTemplateEntity
Abstracts REST call to update clustertemplate attributes
Parameters: - cluster_template_id – UUID of clustertemplate
- cluster_templatepatch_listmodel – ClusterTemplatePatchCollection
Returns: Response object and ClusterTemplateEntity object
-
classmethod
taf.testlib.tempest_clients.magnum.clients.magnum_service_client¶
magnum_service_client.py
-
class
taf.testlib.tempest_clients.magnum.clients.magnum_service_client.MagnumServiceClient(auth_provider)[source]¶ Bases:
testlib.tempest_clients.magnum.clients.client.MagnumClientEncapsulates REST calls and maps JSON to/from models
taf.testlib.tempest_clients.magnum.common¶
taf.testlib.tempest_clients.magnum.common.utils¶
utils.py
-
taf.testlib.tempest_clients.magnum.common.utils.memoized(func)[source]¶ A decorator to cache function’s return value
-
taf.testlib.tempest_clients.magnum.common.utils.parameterized(data)[source]¶ A function decorator for parameterized test cases.
Example:
@parameterized({ 'zero': dict(val=0), 'one': dict(val=1), }) def test_val(self, val): self.assertEqual(val, self.get_val())
The above will generate two test cases:
`test_val_zero` which runs with val=0 `test_val_one` which runs with val=1
Parameters: data (dict) – A dictionary that looks like {tag: {arg1: val1, …}}
taf.testlib.tempest_clients.magnum.models¶
taf.testlib.tempest_clients.magnum.models.cert_model¶
cert_model.py
taf.testlib.tempest_clients.magnum.models.cluster_id_model¶
cluster_id_model.py
-
class
taf.testlib.tempest_clients.magnum.models.cluster_id_model.ClusterIdData[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.BaseModelData that encapsulates ClusterId attributes
-
class
taf.testlib.tempest_clients.magnum.models.cluster_id_model.ClusterIdEntity[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.EntityModelEntity Model that represents a single instance of CertData
-
ENTITY_NAME= 'clusterid'¶
-
MODEL_TYPE¶ alias of
ClusterIdData
-
taf.testlib.tempest_clients.magnum.models.cluster_model¶
cluster_model.py
-
class
taf.testlib.tempest_clients.magnum.models.cluster_model.ClusterCollection[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.CollectionModelCollection Model that represents a list of ClusterData objects
-
COLLECTION_NAME= 'clusterlists'¶
-
MODEL_TYPE¶ alias of
ClusterData
-
-
class
taf.testlib.tempest_clients.magnum.models.cluster_model.ClusterData[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.BaseModelData that encapsulates cluster attributes
-
class
taf.testlib.tempest_clients.magnum.models.cluster_model.ClusterEntity[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.EntityModelEntity Model that represents a single instance of ClusterData
-
ENTITY_NAME= 'cluster'¶
-
MODEL_TYPE¶ alias of
ClusterData
-
taf.testlib.tempest_clients.magnum.models.cluster_template_model¶
cluster_template_model.py
-
class
taf.testlib.tempest_clients.magnum.models.cluster_template_model.ClusterTemplateCollection[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.CollectionModelCollection that represents a list of ClusterTemplateData objects
-
COLLECTION_NAME= 'clustertemplatelists'¶
-
MODEL_TYPE¶ alias of
ClusterTemplateData
-
-
class
taf.testlib.tempest_clients.magnum.models.cluster_template_model.ClusterTemplateData[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.BaseModelData that encapsulates clustertemplate attributes
-
class
taf.testlib.tempest_clients.magnum.models.cluster_template_model.ClusterTemplateEntity[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.EntityModelEntity Model that represents a single instance of ClusterTemplateData
-
ENTITY_NAME= 'clustertemplate'¶
-
MODEL_TYPE¶ alias of
ClusterTemplateData
-
taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model¶
cluster_templatepatch_model.py
-
class
taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model.ClusterTemplatePatchCollection[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.CollectionModelModel that represents a list of ClusterTemplatePatchData objects
-
COLLECTION_NAME= 'clustertemplatepatchlist'¶
-
MODEL_TYPE¶ alias of
ClusterTemplatePatchData
-
classmethod
from_dict(data)[source]¶ Converts dict to ClusterTemplatePatchData
Converts data dict to list of ClusterTemplatePatchData objects and stores it in COLLECTION_NAME
Example of dict data:
[{ "path": "/name", "value": "myname", "op": "replace" }]
Parameters: data (dict) – dict of patch data Returns: json object
-
to_json()[source]¶ Converts ClusterTemplatePatchCollection to json
Retrieves list from COLLECTION_NAME attribute and converts each object to dict, appending it to a list. Then converts the entire list to json
This is required due to COLLECTION_NAME holding a list of objects that needed to be converted to dict individually
Returns: json object
-
-
class
taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model.ClusterTemplatePatchData[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.BaseModelData that encapsulates clustertemplatepatch attributes
-
class
taf.testlib.tempest_clients.magnum.models.cluster_templatepatch_model.ClusterTemplatePatchEntity[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.EntityModelModel that represents a single instance of ClusterTemplatePatchData
-
ENTITY_NAME= 'clustertemplatepatch'¶
-
MODEL_TYPE¶ alias of
ClusterTemplatePatchData
-
taf.testlib.tempest_clients.magnum.models.clusterpatch_model¶
taf.testlib.tempest_clients.magnum.models.magnum_service_model¶
magnum_service_model.py
-
class
taf.testlib.tempest_clients.magnum.models.magnum_service_model.MagnumServiceCollection[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.CollectionModelCollection Model that represents a list of MagnumServiceData objects
-
COLLECTION_NAME= 'mservicelists'¶
-
MODEL_TYPE¶ alias of
MagnumServiceData
-
-
class
taf.testlib.tempest_clients.magnum.models.magnum_service_model.MagnumServiceData[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.BaseModelData that encapsulates magnum_service attributes
-
class
taf.testlib.tempest_clients.magnum.models.magnum_service_model.MagnumServiceEntity[source]¶ Bases:
testlib.tempest_clients.magnum.models.models.EntityModelEntity Model that represents a single instance of MagnumServiceData
-
ENTITY_NAME= 'mservice'¶
-
MODEL_TYPE¶ alias of
MagnumServiceData
-
taf.testlib.tempest_clients.magnum.models.models¶
models.py
-
class
taf.testlib.tempest_clients.magnum.models.models.BaseModel[source]¶ Bases:
objectSuperclass Responsible for converting json data to/from model
-
MODEL_TYPE¶ alias of
builtins.object
-
-
class
taf.testlib.tempest_clients.magnum.models.models.CollectionModel[source]¶ Bases:
taf.testlib.tempest_clients.magnum.models.models.BaseModelSuperclass resposible from converting dict to list of models
-
COLLECTION_NAME= ''¶
-