otcextensions.sdk.dds.v3.instance

The Instance Class

The Instance class inherits from Resource.

class otcextensions.sdk.dds.v3.instance.Instance(_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 = '/instances'

The base part of the URI for this resource.

resources_key: ty.Optional[str] = 'instances'

Plural form of key for resource.

resource_key: ty.Optional[str] = 'instance'

Singular form of key for resource.

allow_create = True

Allow create operation for this resource.

allow_delete = True

Allow delete operation for this resource.

allow_commit = True

Allow update operation for this resource.

allow_list = True

Allow list operation for this resource.

allow_fetch = True

Allow get operation for this resource.

actions

Operations that is executed on the DB instance. Type:string

availability_zone

Specifies the AZ ID. Type:string

backup_strategy

Specifies the advanced backup policy. Type:dict

created

Time when a DB instance is created. Type:string

datastore

Specifies the database information. Type:dict

datastore_type

Specifies the database type. Type:string

disk_encryption_id

Specifies the key ID used for disk encryption. Type:string

engine

Specifies the storage engine. Type:string

flavor

Specifies the instance specifications. Type:list

groups

Group information Type:dict

id

DB instance ID. Type:string

job_id

Async job id Type:uuid

maintenance_window

Maintenance time window. Type:string

mode

Specifies the instance type. * Sharding indicates the cluster instance. * ReplicaSet indicate the replica set instance. Type:string

name: ty.Union[Body, URI]

DB instance name. Type:string

password

Specifies the database password. Type:string

pay_mode

Billing mode. Type:string

port

Database port number. Type:int

region

Specifies the region ID. Type:string

security_group_id

Specifies the ID of the security group where a specified DB instance belongs to. Type:string

status

Instance status. Type:string

ssl

Specifies whether to enable SSL. Type:string

subnet_id

Data store information. Type:string

time_zone

Time zone. Type:string

vpc_id

Specifies the VPC ID. Type:string

updated

Time when a DB instance is updated. Type:string

fetch(session, requires_id=True, base_path=None, error_message=None, **params)

Get a remote resource based on this instance. :param session: The session to use for making this request. :type session: Adapter :param boolean requires_id: A boolean indicating whether resource ID should be part of the requested URI. :param str base_path: Base part of the URI for fetching resources, if different from base_path. :param str error_message: An Error message to be returned if requested object does not exist. :param dict params: Additional parameters that can be consumed.

Returns:

This Resource instance.

Raises:

MethodNotSupported if Resource.allow_fetch is not set to True.

Raises:

ResourceNotFound if the resource was not found.

create(session, prepend_key=False, base_path=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.

  • base_path (str) – Base part of the URI for creating resources, if different from base_path.

  • resource_request_key (str) – Overrides the usage of self.resource_key when prepending a key to the request body. Ignored if prepend_key is false.

  • resource_response_key (str) – Overrides the usage of self.resource_key when processing response bodies. Ignored if prepend_key is false.

  • microversion (str) – API version to override the negotiated one.

  • params (dict) – Additional params to pass.

Returns:

This Resource instance.

Raises:

MethodNotSupported if Resource.allow_create is not set to True.

restart(session)

Restart Instance

enlarge(session, size, group_id)

Enlarge Instance Storage Space

add_nodes(session, node_type, spec_code, num, volume=None)

Add Nodes to Instance