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.v3._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.

Parameters:

cluster – key id or an instance of Cluster

Returns:

instance of Cluster

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 to True, 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 to True, no exception will be set when attempting to delete a nonexistent cluster.

Cluster Nodes Operations

class otcextensions.sdk.cce.v3._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_node(cluster, node, ignore_missing=True)

Delete nodes from the cluster.

Parameters:
  • cluster – The value can be the ID of a cluster or a Cluster instance.

  • node – The value can be the ID of a cluster node or a ClusterNode instance.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the node does not exist. When set to True, no exception will be set when attempting to delete a nonexistent cluster node.

create_cluster_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 ClusterNode, comprised of the properties on the ClusterNode class.

Returns:

The results of config creation

Return type:

ClusterNode

Node Pool Operations

class otcextensions.sdk.cce.v3._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
node_pools(cluster)

List all CCE node pools.

Parameters:

cluster – The value can be the ID of a cluster or a Cluster instance.

Returns:

a generator of (NodePool) instances

get_node_pool(cluster, node_pool_id)

Get the CCE node pool by it’s UUID.

Parameters:
  • cluster – key id or an instance of Cluster

  • node_pool_id – Node pool id to be fetched

Returns:

instance of NodePool

find_node_pool(cluster, node_pool)

Find the cluster node by it’s UUID or name.

Parameters:
  • cluster – key id or an instance of Cluster

  • node_pool – Node pool id or name to be fetched

Returns:

instance of NodePool

delete_node_pool(cluster, node_pool, ignore_missing=True)

Delete node pool from the cluster.

Parameters:
  • cluster – The value can be the ID of a cluster or a Cluster instance.

  • node_pool – The value can be the ID of a CCE node pool or a NodePool instance.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the node does not exist. When set to True, no exception will be set when attempting to delete a nonexistent cluster node pool.

create_node_pool(cluster, **attrs)

Add a new node pool 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 NodePool, comprised of the properties on the NodePool class.

Returns:

The results of config creation

Return type:

NodePool

Job Operations

class otcextensions.sdk.cce.v3._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
get_job(job)

Get the job by UUID.

Parameters:

job – key id or an instance of Job

Returns:

instance of Job