CCE API¶
The Cloud Container Engine Class¶
The cce high-level interface is available through the cce
member of a
Connection
object. The cce
member will only
be added if the otcextensions.sdk.register_otc_extensions(conn)
method is
called.
Cluster Operations¶
- class otcextensions.sdk.cce.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- clusters()
List all Clusters.
- Returns:
a generator of (
Cluster
) instances
- get_cluster(cluster)
Get the cluster by UUID
- find_cluster(name_or_id, ignore_missing=True)
Find a single cluster
- Parameters:
name_or_id – The name or ID of a cluster
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent group.
- Returns:
None
- delete_cluster(cluster, ignore_missing=True)
Delete a cluster
- Parameters:
cluster – The value can be the ID of a cluster or a
Cluster
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent cluster.
Cluster Nodes Operations¶
- class otcextensions.sdk.cce.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- cluster_nodes(cluster)
List all Cluster nodes.
- Parameters:
cluster – The value can be the ID of a cluster or a
Cluster
instance.- Returns:
a generator of (
ClusterNode
) instances
- get_cluster_node(cluster, node_id)
Get the cluster node by it’s UUID
- Parameters:
cluster – key id or an instance of
Cluster
node_id – Cluster node id to be fetched
- Returns:
instance of
ClusterNode
- find_cluster_node(cluster, node)
Find the cluster node by it’s UUID or name
- Parameters:
cluster – key id or an instance of
Cluster
node – Cluster node id or name to be fetched
- Returns:
instance of
ClusterNode
- delete_cluster_nodes(cluster, node_names)
Delete nodes from the cluster
- Parameters:
cluster – The value can be the ID of a cluster or a
Cluster
instance.node_names – List of node names to be deleted. Can be also a single node name.
- add_node(cluster, **attrs)
Add a new node to the cluster
- Parameters:
cluster – The value can be the ID of a cluster or a
Cluster
instance.attrs (dict) – Keyword arguments which will be used to create a
ClusterHost
, comprised of the properties on the ClusterHost class.
- Returns:
The results of config creation
- Return type:
Config