openstack.compute.v2.service¶
The Service Class¶
The Service class inherits from Resource.
- class openstack.compute.v2.service.Service(_synchronized=False, connection=None, **attrs)¶
The base resource
- Parameters:
_synchronized – This is not intended to be used directly. See
new()andexisting().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._connectionin Resource code should protect itself with a check for None.
- resource_key = 'service'¶
Singular form of key for resource.
- resources_key = 'services'¶
Plural form of key for resource.
- base_path = '/os-services'¶
The base part of the URI for this resource.
- allow_list = True¶
Allow list operation for this resource.
- allow_commit = True¶
Allow update operation for this resource.
- allow_delete = True¶
Allow delete operation for this resource.
- commit_opts = CommitOpts(request_key=None, response_key=<Unset.UNSET: 'UNSET'>, method='PUT', request_has_body=True, response_has_body=True)¶
Class-level configuration for the commit operation. Subclasses can override this to set per-resource defaults without overriding commit().
- availability_zone¶
The availability zone of service
- binary¶
Binary name of service
- disabled_reason¶
Disabled reason of service
- is_forced_down¶
Whether or not this service was forced down manually by an administrator after the service was fenced
- host¶
The name of the host where service runs
- name¶
Service name
- state¶
State of service
- status¶
Status of service
- updated_at¶
The date and time when the resource was updated
- classmethod find(session, name_or_id, ignore_missing=True, list_base_path=None, *, microversion=None, all_projects=None, **params)¶
Find a resource by its name or id.
- Parameters:
session – 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 – When set to
FalseNotFoundExceptionwill be raised when the resource does not exist. When set toTrue, None will be returned when attempting to find a nonexistent resource.list_base_path – base_path to be used when need listing resources.
microversion – API version to override the negotiated one.
params – Any additional parameters to be passed into underlying methods, such as to
existing()in order to pass on URI parameters.
- Returns:
The
Resourceobject matching the given name or id or None if nothing matches.- Raises:
openstack.exceptions.DuplicateResourceif more than one resource is found for this request.- Raises:
openstack.exceptions.NotFoundExceptionif nothing is found and ignore_missing isFalse.
- set_forced_down(session, host=None, binary=None, forced=False)¶
Update forced_down information of a service.
- force_down(session, host=None, binary=None, forced=False)¶
Update forced_down information of a service.
- enable(session, host, binary)¶
Enable service.
- disable(session, host, binary, reason=None)¶
Disable service.