cinder.service module

cinder.service module

Generic Node base class for all workers that run on hosts.

class Launcher

Bases: object

class Service(host: str, binary: str, topic: str, manager: str, report_interval: Optional[int] = None, periodic_interval: Optional[int] = None, periodic_fuzzy_delay: Optional[int] = None, service_name: Optional[str] = None, coordination: bool = False, cluster: Optional[str] = None, *args, **kwargs)

Bases: Service

Service object for binaries running on hosts.

A service takes a manager and enables rpc by listening to queues based on topic. It also periodically runs tasks on the manager and reports it state to the database services table.

basic_config_check() None

Perform basic config checks before starting service.

classmethod create(host: Optional[str] = None, binary: Optional[str] = None, topic: Optional[str] = None, manager: Optional[str] = None, report_interval: Optional[int] = None, periodic_interval: Optional[int] = None, periodic_fuzzy_delay: Optional[int] = None, service_name: Optional[str] = None, coordination: bool = False, cluster: Optional[str] = None, **kwargs) Service

Instantiates class and passes back application object.

Parameters:
  • host – defaults to CONF.host

  • binary – defaults to basename of executable

  • topic – defaults to bin_name - ‘cinder-’ part

  • manager – defaults to CONF.<topic>_manager

  • report_interval – defaults to CONF.report_interval

  • periodic_interval – defaults to CONF.periodic_interval

  • periodic_fuzzy_delay – defaults to CONF.periodic_fuzzy_delay

  • cluster – Defaults to None, as only some services will have it

periodic_tasks(raise_on_error: bool = False) None

Tasks to be run at a periodic interval.

report_state() None

Update the state of this service in the datastore.

reset() None

Reset a service in case it received a SIGHUP.

service_id = None
start() None

Start a service.

stop() None

Stop a service.

Parameters:

graceful – indicates whether to wait for all threads to finish or terminate them instantly

wait() None

Wait for a service to shut down.

class WSGIService(name, loader=None)

Bases: ServiceBase

Provides ability to launch API from a ‘paste’ configuration.

reset() None

Reset server greenpool size to default.

Returns:

None

start() None

Start serving this service using loaded configuration.

Also, retrieve updated port number in case ‘0’ was passed in, which indicates a random port should be used.

Returns:

None

stop() None

Stop serving this API.

Returns:

None

wait() None

Wait for the service to stop serving this API.

Returns:

None

class WindowsProcessLauncher

Bases: object

add_process(cmd)
wait()
get_launcher() ProcessLauncher
process_launcher() ProcessLauncher
serve(server, workers=None)
setup_profiler(binary: str, host: str) None
wait() None
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.