otcextensions.sdk.auto_scaling.v1.policy

The AS Policy Class

The Policy class inherits from Resource.

class otcextensions.sdk.auto_scaling.v1.policy.Policy(_synchronized=False, connection=None, **attrs)

AutoScaling Policy Resource

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.

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

Singular form of key for resource.

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

Plural form of key for resource.

base_path: str = '/scaling_policy'

The base part of the URI for this resource.

allow_create = True

Allow create operation for this resource.

allow_list = True

Allow list operation for this resource.

allow_fetch = True

Allow get operation for this resource.

allow_delete = True

Allow delete operation for this resource.

allow_commit = True

Allow update operation for this resource.

id

Properties AutoScaling policy ID

name: ty.Union[Body, URI]

AutoScaling policy name

type

AutoScaling policy trigger type valid values include: ALARM, SCHEDULED, RECURRENCE

scaling_group_id

AutoScaling group reference the policy apply to

status

valid values include: INSERVICE, PAUSED

execute(session)

execute policy

pause(session)

pause policy

resume(session)

resume policy

classmethod find(session, name_or_id, ignore_missing=True, **params)

Find a resource by its name or id.

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

  • name_or_id – This resource’s identifier, if needed by the request. The default is None.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.

  • params (dict) – Any additional parameters to be passed into underlying methods, such as to existing() in order to pass on URI parameters.

Returns:

The Resource object matching the given name or id or None if nothing matches.

Raises:

openstack.exceptions.DuplicateResource if more than one resource is found for this request.

Raises:

openstack.exceptions.ResourceNotFound if nothing is found and ignore_missing is False.