# octavia.common package

## Subpackages

- octavia.common.jinja package
  - Subpackages
    - octavia.common.jinja.haproxy package
      - Subpackages
        - octavia.common.jinja.haproxy.combined_listeners package
          - Submodules
          - octavia.common.jinja.haproxy.combined_listeners.jinja_cfg module
          - Module contents
        - octavia.common.jinja.haproxy.split_listeners package
          - Submodules
          - octavia.common.jinja.haproxy.split_listeners.jinja_cfg module
          - Module contents
      - Module contents
    - octavia.common.jinja.logging package
      - Submodules
      - octavia.common.jinja.logging.logging_jinja_cfg module
      - Module contents
    - octavia.common.jinja.lvs package
      - Submodules
      - octavia.common.jinja.lvs.jinja_cfg module
      - Module contents
  - Submodules
  - octavia.common.jinja.user_data_jinja_cfg module
  - Module contents
- octavia.common.tls_utils package
  - Submodules
  - octavia.common.tls_utils.cert_parser module
  - Module contents

## Submodules

## octavia.common.base_taskflow module

class `BaseTaskFlowEngine`

  Bases: `object`

  This is the task flow engine

  Use this engine to start/load flows in the code

class `DynamicLoggingConductor`(name, jobboard, persistence=None, engine=None, engine_options=None, wait_timeout=None, log=None, max_simultaneous_jobs=1)

  Bases: `taskflow.conductors.backends.impl_blocking.BlockingConductor`

class `ExtendExpiryListener`(engine, job)

  Bases: `taskflow.listeners.base.Listener`

class `RedisDynamicLoggingConductor`(name, jobboard, persistence=None, engine=None, engine_options=None, wait_timeout=None, log=None, max_simultaneous_jobs=1)

  Bases: `octavia.common.base_taskflow.DynamicLoggingConductor`

class `TaskFlowServiceController`(driver)

  Bases: `object`

  `run_conductor`(name)
  `run_poster`(flow_factory, *args, wait=False, **kwargs)

`retryMaskFilter`(record)

## octavia.common.clients module

class `CinderAuth`

  Bases: `object`

  `cinder_client` = None
  classmethod `get_cinder_client`(region, service_name=None, endpoint=None, endpoint_type='publicURL', insecure=False, cacert=None)

    Create cinder client object.

    Parameters:

    - region – The region of the service
    - service_name – The name of the cinder service in the catalog
    - endpoint – The endpoint of the service
    - endpoint_type – The endpoint type of the service
    - insecure – Turn off certificate validation
    - cacert – CA Cert file path

    Returns: | a Cinder Client object
    Raises: | Exception – if the client cannot be created

class `GlanceAuth`

  Bases: `object`

  classmethod `get_glance_client`(region, service_name=None, endpoint=None, endpoint_type='publicURL', insecure=False, cacert=None)

    Create glance client object.

    Parameters:

    - region – The region of the service
    - service_name – The name of the glance service in the catalog
    - endpoint – The endpoint of the service
    - endpoint_type – The endpoint_type of the service
    - insecure – Turn off certificate validation
    - cacert – CA Cert file path

    Returns: | a Glance Client object.
    Raises: | Exception – if the client cannot be created

  `glance_client` = None

class `NeutronAuth`

  Bases: `object`

  classmethod `get_neutron_client`(region, service_name=None, endpoint=None, endpoint_type='publicURL', insecure=False, ca_cert=None)

    Create neutron client object.

    Parameters:

    - region – The region of the service
    - service_name – The name of the neutron service in the catalog
    - endpoint – The endpoint of the service
    - endpoint_type – The endpoint_type of the service
    - insecure – Turn off certificate validation
    - ca_cert – CA Cert file path

    Returns: | a Neutron Client object.
    Raises: | Exception – if the client cannot be created

  classmethod `get_user_neutron_client`(context)

    Get neutron client for request user.

    It’s possible that the token in the context is a trust scoped which can’t be used to initialize a keystone session.

    We directly use the token and endpoint_url to initialize neutron client.

  `neutron_client` = None

class `NovaAuth`

  Bases: `object`

  classmethod `get_nova_client`(region, service_name=None, endpoint=None, endpoint_type='publicURL', insecure=False, cacert=None)

    Create nova client object.

    Parameters:

    - region – The region of the service
    - service_name – The name of the nova service in the catalog
    - endpoint – The endpoint of the service
    - endpoint_type – The type of the endpoint
    - insecure – Turn off certificate validation
    - cacert – CA Cert file path

    Returns: | a Nova Client object.
    Raises: | Exception – if the client cannot be created

  `nova_client` = None

## octavia.common.config module

Routines for configuring Octavia

`handle_deprecation_compatibility`()

`init`(args, **kwargs)

`register_cli_opts`()

`setup_logging`(conf)

  Sets up the logging options for a log with supplied name.

  Parameters: | conf – a cfg.ConfOpts object

`setup_remote_debugger`()

  Required setup for remote debugging.

## octavia.common.constants module

## octavia.common.context module

class `Context`(user_id=None, project_id=None, **kwargs)

  Bases: `oslo_context.context.RequestContext`

  `project_id`
  `session`

## octavia.common.data_models module

class `Amphora`(id=None, load_balancer_id=None, compute_id=None, status=None, lb_network_ip=None, vrrp_ip=None, ha_ip=None, vrrp_port_id=None, ha_port_id=None, load_balancer=None, role=None, cert_expiration=None, cert_busy=False, vrrp_interface=None, vrrp_id=None, vrrp_priority=None, cached_zone=None, created_at=None, updated_at=None, image_id=None, compute_flavor=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()

class `AmphoraHealth`(amphora_id=None, last_update=None, busy=False)

  Bases: `octavia.common.data_models.BaseDataModel`

class `AvailabilityZone`(name=None, description=None, enabled=None, availability_zone_profile_id=None)

  Bases: `octavia.common.data_models.BaseDataModel`

class `AvailabilityZoneProfile`(id=None, name=None, provider_name=None, availability_zone_data=None)

  Bases: `octavia.common.data_models.BaseDataModel`

class `BaseDataModel`

  Bases: `object`

  classmethod `from_dict`(dict)
  `to_dict`(calling_classes=None, recurse=False, **kwargs)

    Converts a data model to a dictionary.

  `update`(update_dict)

    Generic update method which works for simple,

    non-relational attributes.

class `Flavor`(id=None, name=None, description=None, enabled=None, flavor_profile_id=None)

  Bases: `octavia.common.data_models.BaseDataModel`

class `FlavorProfile`(id=None, name=None, provider_name=None, flavor_data=None)

  Bases: `octavia.common.data_models.BaseDataModel`

class `HealthMonitor`(id=None, project_id=None, pool_id=None, type=None, delay=None, timeout=None, fall_threshold=None, rise_threshold=None, http_method=None, url_path=None, expected_codes=None, enabled=None, pool=None, name=None, provisioning_status=None, operating_status=None, created_at=None, updated_at=None, tags=None, http_version=None, domain_name=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()

class `L7Policy`(id=None, name=None, description=None, listener_id=None, action=None, redirect_pool_id=None, redirect_url=None, position=None, listener=None, redirect_pool=None, enabled=None, l7rules=None, provisioning_status=None, operating_status=None, project_id=None, created_at=None, updated_at=None, redirect_prefix=None, tags=None, redirect_http_code=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()
  `update`(update_dict)

    Generic update method which works for simple,

    non-relational attributes.

class `L7Rule`(id=None, l7policy_id=None, type=None, enabled=None, compare_type=None, key=None, value=None, l7policy=None, invert=False, provisioning_status=None, operating_status=None, project_id=None, created_at=None, updated_at=None, tags=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()

class `Listener`(id=None, project_id=None, name=None, description=None, default_pool_id=None, load_balancer_id=None, protocol=None, protocol_port=None, connection_limit=None, enabled=None, provisioning_status=None, operating_status=None, tls_certificate_id=None, stats=None, default_pool=None, load_balancer=None, sni_containers=None, peer_port=None, l7policies=None, pools=None, insert_headers=None, created_at=None, updated_at=None, timeout_client_data=None, timeout_member_connect=None, timeout_member_data=None, timeout_tcp_inspect=None, tags=None, client_ca_tls_certificate_id=None, client_authentication=None, client_crl_container_id=None, allowed_cidrs=None, tls_ciphers=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()
  `update`(update_dict)

    Generic update method which works for simple,

    non-relational attributes.

class `ListenerCidr`(listener_id=None, cidr=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `to_dict`(**kwargs)

    Converts a data model to a dictionary.

class `ListenerStatistics`(listener_id=None, amphora_id=None, bytes_in=0, bytes_out=0, active_connections=0, total_connections=0, request_errors=0)

  Bases: `octavia.common.data_models.BaseDataModel`

  `get_stats`()

class `LoadBalancer`(id=None, project_id=None, name=None, description=None, provisioning_status=None, operating_status=None, enabled=None, topology=None, vip=None, listeners=None, amphorae=None, pools=None, vrrp_group=None, server_group_id=None, created_at=None, updated_at=None, provider=None, tags=None, flavor_id=None, availability_zone=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `update`(update_dict)

    Generic update method which works for simple,

    non-relational attributes.

class `LoadBalancerStatistics`(bytes_in=0, bytes_out=0, active_connections=0, total_connections=0, request_errors=0, listeners=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `get_stats`()

class `Member`(id=None, project_id=None, pool_id=None, ip_address=None, protocol_port=None, weight=None, backup=None, enabled=None, subnet_id=None, operating_status=None, pool=None, created_at=None, updated_at=None, provisioning_status=None, name=None, monitor_address=None, monitor_port=None, tags=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()

class `Pool`(id=None, project_id=None, name=None, description=None, protocol=None, lb_algorithm=None, enabled=None, operating_status=None, members=None, health_monitor=None, session_persistence=None, load_balancer_id=None, load_balancer=None, listeners=None, l7policies=None, created_at=None, updated_at=None, provisioning_status=None, tags=None, tls_certificate_id=None, ca_tls_certificate_id=None, crl_container_id=None, tls_enabled=None, tls_ciphers=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()
  `update`(update_dict)

    Generic update method which works for simple,

    non-relational attributes.

class `Quotas`(project_id=None, load_balancer=None, listener=None, pool=None, health_monitor=None, member=None, in_use_health_monitor=None, in_use_listener=None, in_use_load_balancer=None, in_use_member=None, in_use_pool=None)

  Bases: `octavia.common.data_models.BaseDataModel`

class `SNI`(listener_id=None, position=None, listener=None, tls_container_id=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `to_dict`(**kwargs)

    Converts a data model to a dictionary.

class `SessionPersistence`(pool_id=None, type=None, cookie_name=None, pool=None, persistence_timeout=None, persistence_granularity=None)

  Bases: `octavia.common.data_models.BaseDataModel`

  `delete`()

class `TLSContainer`(id=None, primary_cn=None, certificate=None, private_key=None, passphrase=None, intermediates=None)

  Bases: `octavia.common.data_models.BaseDataModel`

class `VRRPGroup`(load_balancer_id=None, vrrp_group_name=None, vrrp_auth_type=None, vrrp_auth_pass=None, advert_int=None, smtp_server=None, smtp_connect_timeout=None, load_balancer=None)

  Bases: `octavia.common.data_models.BaseDataModel`

class `Vip`(load_balancer_id=None, ip_address=None, subnet_id=None, network_id=None, port_id=None, load_balancer=None, qos_policy_id=None, octavia_owned=None)

  Bases: `octavia.common.data_models.BaseDataModel`

## octavia.common.decorators module

Decorators to provide backwards compatibility for V1 API.

`rename_kwargs`(**renamed_kwargs)

  Renames a class’s variables and maintains backwards compatibility.

  Parameters: | renamed_kwargs – mapping of old kwargs to new kwargs. For example, to say a class has renamed variable foo to bar the decorator would be used like: rename_kwargs(foo=’bar’)

## octavia.common.exceptions module

Octavia base exception handling.

exception `APIException`(**kwargs)

  Bases: `webob.exc.HTTPClientError`

  `code` = 500
  `msg` = 'Something unknown went wrong'

exception `CertificateGenerationException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Could not sign the certificate request: %(msg)s'

exception `CertificateRetrievalException`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Could not retrieve certificate: %(ref)s'

exception `CertificateStorageException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Could not store certificate: %(msg)s'

exception `ComputeBuildException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to build compute instance due to: %(fault)s'

exception `ComputeBuildQueueTimeoutException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to get an amphora build slot.'

exception `ComputeDeleteException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to delete compute instance. The compute service reports: %(compute_msg)s'

exception `ComputeGetException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to retrieve compute instance.'

exception `ComputeGetInterfaceException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to retrieve compute virtual interfaces.'

exception `ComputePortInUseException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Compute driver reports port %(port)s is already in use.'

exception `ComputeStatusException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to retrieve compute instance status.'

exception `ComputeUnknownException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Unknown exception from the compute driver: %(exc)s.'

exception `ComputeWaitTimeoutException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Waiting for compute id %(id)s to go active timeout.'

exception `DisabledOption`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'The selected %(option)s is not allowed in this deployment: %(value)s'

exception `DuplicateHealthMonitor`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'This pool already has a health monitor'

exception `DuplicateListenerEntry`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'Another Listener on this Load Balancer is already using protocol %(protocol)s and protocol_port %(port)d'

exception `DuplicateMemberEntry`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'Another member on this pool is already using ip %(ip_address)s on protocol_port %(port)d'

exception `DuplicatePoolEntry`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'This listener already has a default pool'

exception `GlanceNoTaggedImages`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'No Glance images are tagged with %(tag)s tag.'

exception `IDAlreadyExists`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'Already an entity with that specified id.'

exception `ImmutableObject`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = '%(resource)s %(id)s is immutable and cannot be updated.'

exception `InputFileError`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Error with file %(file_name)s. Reason: %(reason)s'

exception `InvalidAmphoraOperatingSystem`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Invalid amphora operating system: %(os_name)s'

exception `InvalidFilterArgument`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'One or more arguments are either duplicate or invalid'

exception `InvalidHMACException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = "HMAC hashes didn't match"

exception `InvalidIPAddress`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'The IP Address %(ip_addr)s is invalid.'

exception `InvalidL7PolicyAction`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Invalid L7 Policy action specified: %(action)s'

exception `InvalidL7PolicyArgs`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Invalid L7 Policy arguments: %(msg)s'

exception `InvalidL7Rule`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Invalid L7 Rule: %(msg)s'

exception `InvalidLimit`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = "Supplied pagination limit '%(key)s' is not valid."

exception `InvalidMarker`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = "Supplied pagination marker '%(key)s' is not valid."

exception `InvalidOption`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = '%(value)s is not a valid option for %(option)s'

exception `InvalidRegex`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Unable to parse regular expression: %(e)s'

exception `InvalidSortDirection`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = "Supplied sort direction '%(key)s' is not valid."

exception `InvalidSortKey`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = "Supplied sort key '%(key)s' is not valid."

exception `InvalidString`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Invalid characters in %(what)s'

exception `InvalidSubresource`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = '%(resource)s %(id)s not found.'

exception `InvalidTopology`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Invalid topology specified: %(topology)s'

exception `InvalidURL`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Not a valid URL: %(url)s'

exception `InvalidURLPath`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Not a valid URLPath: %(url_path)s'

exception `L7RuleValidation`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Error parsing L7Rule: %(error)s'

exception `LBPendingStateError`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'Invalid state %(state)s of loadbalancer resource %(id)s'

exception `MisMatchedKey`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Key and x509 certificate do not match'

exception `MissingAPIProjectID`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `message` = 'Missing project ID in request where one is required.'

exception `MissingArguments`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Missing arguments.'

exception `MissingProjectID`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Missing project ID in request where one is required.'

exception `MissingVIPSecurityGroup`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'VIP security group is missing for load balancer: %(lb_id)s'

exception `NeedsPassphrase`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Passphrase needed to decrypt key but client did not provide one.'

exception `NetworkConfig`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Unable to allocate network resource from config'

exception `NetworkServiceError`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'The networking service had a failure: %(net_error)s'

exception `NoReadyAmphoraeException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'There are not any READY amphora available.'

exception `NotFound`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 404
  `msg` = '%(resource)s %(id)s not found.'

exception `ObjectInUse`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = '%(object)s %(id)s is in use and cannot be modified.'

exception `OctaviaException`(*args, **kwargs)

  Bases: `Exception`

  Base Octavia Exception.

  To correctly use this class, inherit from it and define a ‘message’ property. That message will get printf’d with the keyword arguments provided to the constructor.

  `message` = 'An unknown exception occurred.'
  `orig_code` = None
  `orig_msg` = None
  static `use_fatal_exceptions`()

exception `PolicyForbidden`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 403
  `msg` = 'Policy does not allow this request to be performed.'

exception `PoolInUseByL7Policy`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'Pool %(id)s is in use by L7 policy %(l7policy_id)s'

exception `ProjectBusyException`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 503
  `msg` = 'Project busy. Unable to lock the project. Please try again.'

exception `ProviderDriverError`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 500
  `msg` = "Provider '%(prov)s' reports error: %(user_msg)s"

exception `ProviderFlavorMismatchError`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = "Flavor '%(flav)s' is not compatible with provider '%(prov)s'"

exception `ProviderNotEnabled`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = "Provider '%(prov)s' is not enabled."

exception `ProviderNotFound`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 501
  `msg` = "Provider '%(prov)s' was not found."

exception `ProviderNotImplementedError`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 501
  `msg` = "Provider '%(prov)s' does not support a requested action: %(user_msg)s"

exception `ProviderUnsupportedOptionError`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 501
  `msg` = "Provider '%(prov)s' does not support a requested option: %(user_msg)s"

exception `QuotaException`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 403
  `msg` = 'Quota has been met for resources: %(resource)s'

exception `RecordAlreadyExists`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'A %(field)s of %(name)s already exists.'

exception `ServerGroupObjectCreateException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to create server group object.'

exception `ServerGroupObjectDeleteException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to delete server group object.'

exception `SingleCreateDetailsMissing`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Missing details for %(type)s object: %(name)s'

exception `TooManyL7RulesOnL7Policy`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 409
  `msg` = 'Too many rules on L7 policy %(id)s'

exception `UnreadableCert`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Could not read X509 from PEM'

exception `UnreadablePKCS12`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'The PKCS12 bundle is unreadable. Please check the PKCS12 bundle validity. In addition, make sure it does not require a pass phrase. Error: %(error)s'

exception `VIPValidationException`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Validation failure: VIP must contain one of: %(objects)s.'

exception `ValidationException`(**kwargs)

  Bases: `octavia.common.exceptions.APIException`

  `code` = 400
  `msg` = 'Validation failure: %(detail)s'

exception `VolumeDeleteException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to delete volume instance.'

exception `VolumeGetException`(*args, **kwargs)

  Bases: `octavia.common.exceptions.OctaviaException`

  `message` = 'Failed to retrieve volume instance.'

## octavia.common.keystone module

class `KeystoneSession`(section='service_auth')

  Bases: `object`

  `get_auth`()
  `get_service_user_id`()
  `get_session`()

    Initializes a Keystone session.

    Returns: | a Keystone Session object

class `SkippingAuthProtocol`(app, conf)

  Bases: `keystonemiddleware.auth_token.AuthProtocol`

  SkippingAuthProtocol to reach special endpoints

  Bypasses keystone authentication for special request paths, such as the api version discovery path.

  Note:
    SkippingAuthProtocol is lean customization of `keystonemiddleware.auth_token.AuthProtocol` that disables keystone communication if the request path is in the _NOAUTH_PATHS list.
  `process_request`(request)

    Process request.

    Evaluate the headers in a request and attempt to authenticate the request. If authenticated then additional headers are added to the request for use by applications. If not authenticated the request will be rejected or marked unauthenticated depending on configuration.

## octavia.common.policy module

Policy Engine For Octavia.

class `IsAdminCheck`(kind, match)

  Bases: `oslo_policy._checks.Check`

  An explicit check for is_admin.

class `Policy`(conf=<oslo_config.cfg.ConfigOpts object>, policy_file=None, rules=None, default_rule=None, use_conf=True, overwrite=True)

  Bases: `oslo_policy.policy.Enforcer`

  `authorize`(action, target, context, do_raise=True, exc=None)

    Verifies that the action is valid on the target in this context.

    Parameters:

    - context – The oslo context for this request.
    - action – string representing the action to be checked this should be colon separated for clarity. i.e. `compute:create_instance`, `compute:attach_volume`, `volume:attach_volume`
    - target – dictionary representing the object of the action for object creation this should be a dictionary representing the location of the object e.g. `{'project_id': context.project_id}`
    - do_raise – if True (the default), raises PolicyForbidden; if False, returns False
    - exc – Class of the exceptions to raise if the check fails. Any remaining arguments passed to `enforce()` (both positional and keyword arguments) will be passed to the exceptions class. If not specified, `PolicyForbidden` will be used.

    Raises: | PolicyForbidden – if verification fails and do_raise is True. Or if ‘exc’ is specified it will raise an exceptions of that type.
    Returns: | returns a non-False value (not necessarily “True”) if authorized, and the exact value False if not authorized and do_raise is False.

  `check_is_admin`(context)

    Does roles contains ‘admin’ role according to policy setting.

  `get_rules`()

`get_enforcer`()

`get_no_context_enforcer`()

`reset`()

## octavia.common.rpc module

`cleanup`()

`create_transport`(url)

`get_client`(target, version_cap=None, serializer=None, call_monitor_timeout=None)

`get_server`(target, endpoints, executor='threading', access_policy=<class 'oslo_messaging.rpc.dispatcher.DefaultRPCAccessPolicy'>, serializer=None)

`get_transport_url`(url_str=None)

`init`()

## octavia.common.service module

`prepare_service`(argv=None)

  Sets global config from config file and sets up logging.

## octavia.common.stats module

class `StatsMixin`

  Bases: `object`

  `get_listener_stats`(session, listener_id)

    Gets the listener statistics data_models object.

  `get_loadbalancer_stats`(session, loadbalancer_id)

## octavia.common.utils module

Utilities and helper functions.

`b`(s)

`base64_sha1_string`(string_to_hash)

  Get a b64-encoded sha1 hash of a string. Not intended to be secure!

class `exception_logger`(logger=None)

  Bases: `object`

  Wrap a function and log raised exception

  Parameters: | logger – the logger to log the exception default is LOG.exception
  Returns: | origin value if no exception raised; re-raise the exception if any occurred

`expand_expected_codes`(codes)

  Expand the expected code string in set of codes.

  200-204 -> 200, 201, 202, 204 200, 203 -> 200, 203

`get_amphora_driver`()

`get_compatible_server_certs_key_passphrase`()

`get_compatible_value`(value)

`get_hostname`()

`get_network_driver`()

`get_vip_security_group_name`(loadbalancer_id)

`ip_netmask_to_cidr`(ip, netmask)

`ip_port_str`(ip_address, port)

  Return IP port as string representation depending on address family.

`is_cidr_ipv6`(cidr)

  Check if CIDR is IPv6 address with subnet prefix.

`is_ipv4`(ip_address)

  Check if ip address is IPv4 address.

`is_ipv6`(ip_address)

  Check if ip address is IPv6 address.

`is_ipv6_lla`(ip_address)

  Check if ip address is IPv6 link local address.

`netmask_to_prefix`(netmask)

`subnet_ip_availability`(nw_ip_avail, subnet_id, req_num_ips)

## octavia.common.validate module

Several handy validation functions that go beyond simple type checking. Defined here so these can also be used at deeper levels than the API.

`check_port_in_use`(port)

  Raise an exception when a port is used.

`check_session_persistence`(SP_dict)

`cookie_value_string`(value, what=None)

  Raises an error if the value string contains invalid characters.

`header_name`(header, what=None)

  Raises an error if header does not look like an HTML header name.

`header_value_string`(value, what=None)

  Raises an error if the value string contains invalid characters.

`ip_not_reserved`(ip_address)

`is_flavor_spares_compatible`(flavor)

`is_ip_member_of_cidr`(address, cidr)

`l7rule_data`(l7rule)

  Raises an error if the l7rule given is invalid in some way.

`network_allowed_by_config`(network_id, valid_networks=None)

`network_exists_optionally_contains_subnet`(network_id, subnet_id=None, context=None)

  Raises an exception when a network does not exist.

  If a subnet is provided, also validate the network contains that subnet.

`port_exists`(port_id, context=None)

  Raises an exception when a port does not exist.

`qos_extension_enabled`(network_driver)

`qos_policy_exists`(qos_policy_id)

`regex`(regex)

  Raises an error if the string given is not a valid regex.

`sanitize_l7policy_api_args`(l7policy, create=False)

  Validate and make consistent L7Policy API arguments.

  This method is mainly meant to sanitize L7 Policy create and update API dictionaries, so that we strip ‘None’ values that don’t apply for our particular update. This method does not verify that any redirect_pool_id exists in the database, but will raise an error if a redirect_url doesn’t look like a URL.

  Parameters: | l7policy – The L7 Policy dictionary we are santizing / validating

`subnet_exists`(subnet_id, context=None)

  Raises an exception when a subnet does not exist.

`url`(url, require_scheme=True)

  Raises an error if the url doesn’t look like a URL.

`url_path`(url_path)

  Raises an error if the url_path doesn’t look like a URL Path.

`validate_l7rule_ssl_types`(l7rule)

## Module contents

this page last updated: 2023-10-24 12:56:13

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

found an error? report a bug questions?