otcextensions.sdk.cce.v1.cluster_node

The CCE Cluster Host (Node) Class

The ClusterHost class inherits from Resource.

class otcextensions.sdk.cce.v1.cluster_node.ClusterNode(_synchronized=False, connection=None, **attrs)

The base resource

Parameters:
  • _synchronized (bool) – This is not intended to be used directly. See new() and existing().

  • connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of self._connection in Resource code should protect itself with a check for None.

base_path: str = '/clusters/%(cluster_uuid)s/hosts'

The base part of the URI for this resource.

allow_create = True

Allow create operation for this resource.

allow_delete = True

Allow delete operation for this resource.

allow_list = True

Allow list operation for this resource.

spec

Spec

status

Status

replica_count

Replicas count

message

Message

classmethod new(**kwargs)

Create a new instance of this resource.

When creating the instance set the _synchronized parameter of Resource to False to indicate that the resource does not yet exist on the server side. This marks all attributes passed in **kwargs as “dirty” on the resource, and thusly tracked as necessary in subsequent calls such as update().

Parameters:

kwargs (dict) – Each of the named arguments will be set as attributes on the resulting Resource object.

classmethod list(session, endpoint_override=None, headers=None, **params)

Override default list to incorporate endpoint overriding and custom headers

Since SDK Resource.list method is passing hardcoded headers do override the function

This resource object list generator handles pagination and takes query params for response filtering.

Parameters:
  • session (Adapter) – The session to use for making this request.

  • paginated (bool) – True if a GET to this resource returns a paginated series of responses, or False if a GET returns only one page of data. When paginated is False only one page of data will be returned regardless of the API’s support of pagination.

  • params (dict) – These keyword arguments are passed through the _transpose() method to find if any of them match expected query parameters to be sent in the params argument to get(). They are additionally checked against the base_path format string to see if any path fragments need to be filled in by the contents of this argument.

Returns:

A generator of Resource objects.

Raises:

MethodNotSupported if Resource.allow_list is not set to True.

Raises:

InvalidResourceQuery if query contains invalid params.

delete(session, error_message=None, endpoint_override=None, headers=None, params=None)

Delete the remote resource based on this instance.

This function overrides default Resource.delete to enable headers

Parameters:

session (Adapter) – The session to use for making this request.

Returns:

This Resource instance.

Raises:

MethodNotSupported if Resource.allow_update is not set to True.

create(session, prepend_key=True, requires_id=True, endpoint_override=None, headers=None)

Create a remote resource based on this instance.

Parameters:
  • session (Adapter) – The session to use for making this request.

  • prepend_key – A boolean indicating whether the resource_key should be prepended in a resource creation request. Default to True.

Returns:

This Resource instance.

Raises:

MethodNotSupported if Resource.allow_create is not set to True.