Bases: object
Id mixin, add to subclasses that have an id.
Bases: object
Mixin to add to classes that are lookup tables.
Bases: object
Name mixin to add to classes which need a name.
Bases: oslo_db.sqlalchemy.models.ModelBase
Converts to a data model graph.
In order to make the resulting data model graph usable no matter how many internal references are followed, we generate a complete graph of OctaviaBase nodes connected to the object passed to this method.
_graph_nodes – Used only for internal recursion of this method. Should not be called from the outside. Contains a dictionary of all OctaviaBase type objects in the generated graph
Bases: object
Tenant mixin, add to subclasses that have a project.
This is a simple database connection check function.
It will do a simple no-op query (low overhead) against the sqlalchemy session passed in.
session – A Sql Alchemy database session.
True if the connection check is successful, False if not.
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, oslo_db.sqlalchemy.models.TimestampMixin
Bases: sqlalchemy.orm.decl_api.Base
Bases: sqlalchemy.orm.decl_api.Base
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.NameMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.NameMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.NameMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.NameMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.ProjectMixin
, oslo_db.sqlalchemy.models.TimestampMixin
, octavia.db.base_models.NameMixin
, octavia.db.base_models.TagMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.ProjectMixin
, oslo_db.sqlalchemy.models.TimestampMixin
, octavia.db.base_models.NameMixin
, octavia.db.base_models.TagMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.ProjectMixin
, oslo_db.sqlalchemy.models.TimestampMixin
, octavia.db.base_models.TagMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.ProjectMixin
, oslo_db.sqlalchemy.models.TimestampMixin
, octavia.db.base_models.NameMixin
, octavia.db.base_models.TagMixin
Bases: sqlalchemy.orm.decl_api.Base
Bases: sqlalchemy.orm.decl_api.Base
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.ProjectMixin
, oslo_db.sqlalchemy.models.TimestampMixin
, octavia.db.base_models.NameMixin
, octavia.db.base_models.TagMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.ProjectMixin
, oslo_db.sqlalchemy.models.TimestampMixin
, octavia.db.base_models.NameMixin
, octavia.db.base_models.TagMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.IdMixin
, octavia.db.base_models.ProjectMixin
, oslo_db.sqlalchemy.models.TimestampMixin
, octavia.db.base_models.NameMixin
, octavia.db.base_models.TagMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
Bases: sqlalchemy.orm.decl_api.Base
Bases: sqlalchemy.orm.decl_api.Base
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Bases: sqlalchemy.orm.decl_api.Base
, octavia.db.base_models.LookupTableMixin
Defines interface for DB access that Resource or Octavia Controllers may reference
Bases: octavia.db.repositories.BaseRepository
Adds the build request to the table.
Fetches build request with highest priority and least created_time.
priority 20 = failover (highest) priority 40 = create_loadbalancer (lowest) :param session: A Sql Alchemy database session. :returns amphora_id corresponding to highest priority and least created time in ‘WAITING’ status.
Bases: octavia.db.repositories.BaseRepository
Gets the number of build slots in use.
Number of current build slots.
alias of octavia.db.models.AmphoraBuildSlots
Bases: octavia.db.repositories.BaseRepository
check if a specific amphora is expired in the amphora_health table
session – A Sql Alchemy database session.
amphora_id – id of an amphora object
exp_age – A standard datetime delta which is used to see for how long can an amphora live without updates before it is considered expired (default: CONF.house_keeping.amphora_expiry_age)
boolean
Retrieves a stale amphora from the health manager database.
session – A Sql Alchemy database session.
[octavia.common.data_model]
alias of octavia.db.models.AmphoraHealth
Bases: octavia.db.repositories.BaseRepository
Allocate an amphora for a load balancer.
For v0.5 this is simple, find a free amp and associate the lb. In the future this needs to be enhanced.
session – A Sql Alchemy database session.
load_balancer_id – The load balancer id to associate
The amphora ID for the load balancer or None
Associates an amphora with a load balancer.
session – A Sql Alchemy database session.
load_balancer_id – The load balancer id to associate
amphora_id – The amphora id to associate
Get a list of amphorae for the API list call.
This get_all returns a data set that is only one level deep in the data graph. This is an optimized query for the API amphora list method.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
Retrieves an amphora whose cert is close to expiring..
session – A Sql Alchemy database session.
one amphora with expiring certificate
Get all of the load balancers on an amphora.
session – A Sql Alchemy database session.
amphora_id – The amphora id to list the load balancers from
[octavia.common.data_model]
This method is for the health manager status update process.
This is a time sensitive query that occurs often. It is an explicit query as the ORM produces a poorly optimized query.
Use extreme caution making any changes to this query as it can impact the scalability of the health manager. All changes should be analyzed using SQL “EXPLAIN” to make sure only indexes are being used. Changes should also be evaluated using the stressHM tool.
of the load balancer as it is not needed. This is on purpose to optimize the processing time. This is not in the normal data model objects.
session – A Sql Alchemy database session.
amphora_id – The amphora ID to lookup the load balancer for.
A dictionary containing the required load balancer details.
alias of octavia.db.models.Amphora
Tests and sets an amphora status.
Puts a lock on the amphora table to check the status of the amphora. The status must be either AMPHORA_READY or ERROR to successfuly update the amphora status.
lock_session – A Sql Alchemy database session.
id – id of Load Balancer
ImmutableObject – The amphora is not in a state that can be deleted.
NoResultFound – The amphora was not found or already deleted.
None
Bases: octavia.db.repositories._GetALLExceptDELETEDIdMixin
, octavia.db.repositories.BaseRepository
Bases: octavia.db.repositories._GetALLExceptDELETEDIdMixin
, octavia.db.repositories.BaseRepository
Special delete method for availability_zone.
Sets DELETED LBs availability_zone to NIL_UUID, then removes the availability_zone.
serial_session – A Sql Alchemy database transaction session.
filters – Filters to decide which entity should be deleted.
None
odb_exceptions.DBReferenceError
sqlalchemy.orm.exc.NoResultFound
alias of octavia.db.models.AvailabilityZone
Bases: object
Retrieves a count of entities from the database.
session – A Sql Alchemy database session.
filters – Filters to decide which entities should be retrieved.
int
Base create method for a database entity.
session – A Sql Alchemy database session.
model_kwargs – Attributes of the model to insert.
octavia.common.data_model
Deletes an entity from the database.
session – A Sql Alchemy database session.
filters – Filters to decide which entity should be deleted.
None
sqlalchemy.orm.exc.NoResultFound
Determines whether an entity exists in the database by its id.
session – A Sql Alchemy database session.
id – id of entity to check for existence.
octavia.common.data_model
Retrieves an entity from the database.
session – A Sql Alchemy database session.
filters – Filters to decide which entity should be retrieved.
octavia.common.data_model
Retrieves a list of entities from the database.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
query_options – Optional query options to apply.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
Get all previously deleted resources that are now expiring.
session – A Sql Alchemy database session.
exp_age – A standard datetime delta which is used to see for how long can a resource live without updates before it is considered expired
A list of resource IDs
Bases: octavia.db.repositories._GetALLExceptDELETEDIdMixin
, octavia.db.repositories.BaseRepository
alias of octavia.db.models.FlavorProfile
Bases: octavia.db.repositories._GetALLExceptDELETEDIdMixin
, octavia.db.repositories.BaseRepository
Sets DELETED LBs flavor_id to NIL_UUID, then removes the flavor
serial_session – A Sql Alchemy database transaction session.
filters – Filters to decide which entity should be deleted.
None
odb_exceptions.DBReferenceError
sqlalchemy.orm.exc.NoResultFound
alias of octavia.db.models.Flavor
Bases: octavia.db.repositories.BaseRepository
Get a list of health monitors for the API list call.
This get_all returns a data set that is only one level deep in the data graph. This is an optimized query for the API health monitor list method.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
alias of octavia.db.models.HealthMonitor
Bases: octavia.db.repositories.BaseRepository
Base create method for a database entity.
session – A Sql Alchemy database session.
model_kwargs – Attributes of the model to insert.
octavia.common.data_model
Deletes an entity from the database.
session – A Sql Alchemy database session.
filters – Filters to decide which entity should be deleted.
None
sqlalchemy.orm.exc.NoResultFound
Retrieves a list of entities from the database.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
query_options – Optional query options to apply.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
alias of octavia.db.models.L7Policy
Bases: octavia.db.repositories.BaseRepository
Base create method for a database entity.
session – A Sql Alchemy database session.
model_kwargs – Attributes of the model to insert.
octavia.common.data_model
Get a list of L7 Rules for the API list call.
This get_all returns a data set that is only one level deep in the data graph. This is an optimized query for the API L7 Rule list method.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
alias of octavia.db.models.L7Rule
Bases: octavia.db.repositories.BaseRepository
Base create method for a database entity.
session – A Sql Alchemy database session.
model_kwargs – Attributes of the model to insert.
octavia.common.data_model
alias of octavia.db.models.ListenerCidr
Bases: octavia.db.repositories.BaseRepository
Get a list of listeners for the API list call.
This get_all returns a data set that is only one level deep in the data graph. This is an optimized query for the API listener list method.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
alias of octavia.db.models.Listener
Bases: octavia.db.repositories.BaseRepository
Updates a listener’s statistics, incrementing by the passed deltas.
session – A Sql Alchemy database session
delta_stats (octavia.common.data_models.ListenerStatistics) – Listener statistics deltas to add
alias of octavia.db.models.ListenerStatistics
Create or override a listener’s statistics (insert/update)
session – A Sql Alchemy database session
stats_obj (octavia.common.data_models.ListenerStatistics) – Listener statistics object to store
Bases: octavia.db.repositories.BaseRepository
Get a list of load balancers for the API list call.
This get_all returns a data set that is only one level deep in the data graph. This is an optimized query for the API load balancer list method.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
alias of octavia.db.models.LoadBalancer
Tests and sets a load balancer provisioning status.
Puts a lock on the load balancer table to check the status of a load balancer. If the status is ACTIVE or ERROR then the status of the load balancer is updated and the method returns True. If the status is not ACTIVE, then nothing is done and False is returned.
session – A Sql Alchemy database session.
id – id of Load Balancer
status – Status to set Load Balancer if check passes.
raise_exception – If True, raise ImmutableObject on failure
bool
Tests and sets a load balancer and provisioning status.
Puts a lock on the load balancer table to check the status of a load balancer. If the status is ACTIVE then the status of the load balancer is updated and the method returns True. If the status is not ACTIVE, then nothing is done and False is returned.
session – A Sql Alchemy database session.
id – id of Load Balancer
status – Status to set Load Balancer if check passes.
raise_exception – If True, raise ImmutableObject on failure
bool
Bases: octavia.db.repositories.BaseRepository
Get a list of members for the API list call.
This get_all returns a data set that is only one level deep in the data graph. This is an optimized query for the API member list method.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
alias of octavia.db.models.Member
Bases: octavia.db.repositories.BaseRepository
Get a list of pools for the API list call.
This get_all returns a data set that is only one level deep in the data graph. This is an optimized query for the API pool list method.
session – A Sql Alchemy database session.
pagination_helper – Helper to apply pagination and sorting.
filters – Filters to decide which entities should be retrieved.
[octavia.common.data_model]
alias of octavia.db.models.Pool
Bases: octavia.db.repositories.BaseRepository
Deletes an entity from the database.
session – A Sql Alchemy database session.
filters – Filters to decide which entity should be deleted.
None
sqlalchemy.orm.exc.NoResultFound
alias of octavia.db.models.Quotas
Bases: object
Checks and updates object quotas.
This method makes sure the project has available quota for the resource and updates the quota to reflect the new ussage.
session – Context database session
lock_session – Locking database session (autocommit=False)
_class – Data model object requesting quota
project_id – Project ID requesting quota
count – Number of objects we’re going to create (default=1)
True if quota is met, False if quota was available
Inserts load balancer and vip entities into the database.
Inserts load balancer and vip entities into the database in one transaction and returns the data model of the load balancer.
session – A Sql Alchemy database session.
lb_dict – Dictionary representation of a load balancer
vip_dict – Dictionary representation of a vip
octavia.common.data_models.LoadBalancer
Inserts a pool and session persistence entity into the database.
session – A Sql Alchemy database session.
pool_dict – Dictionary representation of a pool
listener_id – Optional listener id that will reference this pool as its default_pool_id
octavia.common.data_models.Pool
Decrements the object quota for a project
lock_session – Locking database session (autocommit=False)
_class – Data model object to decrement quota
project_id – Project ID to decrement quota on
quantity – Quantity of quota to decrement
None
Gets the statistics for all listeners on an amphora.
session – A Sql Alchemy database session.
amp_id – The amphora ID to query.
An amphora stats dictionary
Tests and sets a load balancer and listener provisioning status.
Puts a lock on the load balancer table to check the status of a load balancer. If the status is ACTIVE then the status of the load balancer and listener is updated and the method returns True. If the status is not ACTIVE, then nothing is done and False is returned.
session – A Sql Alchemy database session.
lb_id – ID of the Load Balancer to check and lock
lb_prov_status – Status to set Load Balancer and Listener if check passes.
listener_prov_status – Status to set Listeners if check passes
listener_ids – List of IDs of listeners to check and lock (only use this when relevant to the operation)
pool_id – ID of the Pool to check and lock (only use this when relevant to the operation)
l7policy_id – ID of the L7Policy to check and lock (only use this when relevant to the operation)
bool
Bases: octavia.db.repositories.BaseRepository
alias of octavia.db.models.SNI
Bases: octavia.db.repositories.BaseRepository
alias of octavia.db.models.SessionPersistence
Bases: octavia.db.repositories.BaseRepository
alias of octavia.db.models.VRRPGroup
Bases: octavia.db.repositories.BaseRepository
alias of octavia.db.models.Vip
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.