os_service_types.
ServiceTypes
(session=None, only_remote=False, warn=False)¶Encapsulation of the OpenStack Service Types Authority data.
The Service Types Authority data will be either pulled from its remote location or from local files as is appropriate.
If the user passes a Session, remote data will be fetched. If the user does not do that, local builtin data will be used.
Parameters: |
|
---|---|
Raises: |
|
forward
¶Mapping service-type names to their aliases.
get_aliases
(service_type)¶Returns the list of aliases for a given official service-type.
Parameters: | service_type (str) – An official service-type. |
---|---|
Returns list: | List of aliases, or empty list if there are none. |
get_all_types
(service_type)¶Get a list of official types and all known aliases.
Parameters: | service_type (str) – The service-type or alias to get data for. |
---|---|
Returns dict: | Service data for the service or None if not found. |
get_official_service_data
(service_type)¶Get the service data for an official service_type.
Parameters: | service_type (str) – The official service-type to get data for. |
---|---|
Returns dict: | Service data for the service or None if not found. |
get_project_name
(service_type)¶Return the OpenStack project name for a given service_type.
Parameters: | service_type (str) – An official service-type or alias. |
---|---|
Returns str: | The OpenStack project name or None if there is no match. |
get_service_data
(service_type)¶Get the service data for a given service_type.
Parameters: | service_type (str) – The service-type or alias to get data for. |
---|---|
Returns dict: | Service data for the service or None if not found. |
get_service_data_for_project
(project_name)¶Return the service information associated with a project.
Parameters: | name (str) – A repository or project name in the form
'openstack/{project}' or just '{project}' . |
---|---|
Returns: | dict or None if not found |
get_service_type
(service_type)¶Given a possible service_type, return the official type.
Parameters: | service_type (str) – A potential service-type. |
---|---|
Returns str: | The official service-type, or None if there is no match. |
is_alias
(service_type)¶Is the given service-type an alias?
Parameters: | service_type (str) – The service-type to test. |
---|---|
Returns bool: | True if it’s an alias type, False otherwise. |
is_known
(service_type)¶Is the given service-type an official type or an alias?
Parameters: | service_type (str) – The service-type to test. |
---|---|
Returns bool: | True if it’s a known type, False otherwise. |
is_match
(requested, found)¶Does a requested service-type match one found in the catalog?
A requested service-type matches a service-type in the catalog if it is either a direct match, if the service-type in the catalog is an official type and the requested type is one of its aliases, or if the requested type is an official type and the type in the catalog is one of its aliases.
A requested alias cannot match a different alias because there are historical implications related to versioning to some historical aliases that cannot be safely reasoned about in an automatic fashion.
Parameters: |
|
---|---|
Returns bool: | True if the service-type being requested matches the entry in the catalog. False if it does not. |
is_official
(service_type)¶Is the given service-type an official service-type?
Parameters: | service_type (str) – The service-type to test. |
---|---|
Returns bool: | True if it’s an official type, False otherwise. |
reverse
¶Mapping aliases to their service-type names.
services
¶Full service-type data listing.
url
¶The URL from which the data was retrieved.
version
¶The version of the data.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.