PYTHON-TROVECLIENT(1)
π NAME π
python-troveclient β python-troveclient 8.11.0
Okay bestie, this is the client for the OpenStack Trove API. Thereβs a Python API β the troveclient module β and an openstack command-line plugin. Two paths, both valid, periodt.
π CONTENTS π
π Trove Client User Guide π
π₯οΈ Command-line Interface π₯οΈ
Installing this package lets you use the openstack command to interact with Trove. Refer to <https://docs.openstack.org/python-openstackclient/latest> for how to install the openstack command and configuration.
You can find all supported Trove commands in the openstack.database.v1 entry_points section in the setup.cfg file of the repo. Iykyk.
π Python API π
Thereβs also a complete Python API. Quick-start using keystone:
>>> from troveclient import client
>>> trove_client = client.Client('1.0', session=keystone_session, endpoint_type='public', service_type='database', region_name='RegionOne')
>>> trove_client.datastores.list()
[...]
>>> trove_client.instances.list()
[...]
π§βπ» Using the Client Programmatically π§βπ»
π Authentication π
Authenticating is necessary to use every feature of the client. No auth, no slay.
To create the client, create an instance of the Client class. The auth url, username, password, and project name must be specified in the call to the constructor.
from troveclient.v1 import client
tc = client.Client(username="testuser",
password="PASSWORD",
project_id="test_project",
region_name="EAST",
auth_url="http://api-server:5000/v2.0")
The default authentication strategy assumes a keystone compliant auth system.
Once you have an authenticated client object you can make calls with it, for example:
flavors = tc.flavors.list()
datastores = tc.datastores.list()
π Instances π
The following example creates a 512 MB instance with a 1 GB volume:
from troveclient.v1 import client
tc = client.Client(username="testuser",
password="PASSWORD",
project_id="test_project",
region_name="EAST",
auth_url="http://api-server:5000/v2.0")
flavor_id = '1'
volume = {'size':1}
databases = [{"name": "my_db",
"character_set": "latin2", # These two fields
"collate": "latin2_general_ci"}] # are optional.
datastore = 'mysql'
datastore_version = '5.6-104'
users = [{"name": "jsmith", "password": "12345",
"databases": [{"name": "my_db"}]
}]
instance = client.instances.create("My Instance", flavor_id, volume,
databases, users, datastore=datastore,
datastore_version=datastore_version)
To retrieve the instance, use the "get" method of "instances":
updated_instance = client.instances.get(instance.id)
print(updated_instance.name)
print(" Status=%s Flavor=%s" %
(updated_instance.status, updated_instance.flavor['id']))
My Instance
Status=BUILD Flavor=1
You can delete an instance by calling "delete" on the instance object itself, or by using the delete method on "instances."
# Wait for the instance to be ready before we delete it.
import time
from troveclient.exceptions import NotFound
while instance.status == "BUILD":
instance.get()
time.sleep(1)
print("Ready in an %s state." % instance.status)
instance.delete()
# Delete and wait for the instance to go away.
while True:
try:
instance = client.instances.get(instance.id)
assert instance.status == "SHUTDOWN"
except NotFound:
break
Ready in an ACTIVE state.
π Listing Items and Pagination π
Lists paginate after twenty items, meaning youβll only get twenty items back even if there are more. To see the next set of items, send a marker. The marker is a key value (in the case of instances, the ID) which is the non-inclusive starting point for all returned items.
The lists returned by the client always include a "next" property. This can be used as the "marker" argument to get the next section of the list back from the server. If no more items are available, then the next property is None.
Pagination applies to all listed objects, like instances, datastores, etc. The example below is for instances.
# There are currently 30 instances.
instances = client.instances.list()
print(len(instances))
print(instances.next is None)
instances2 = client.instances.list(marker=instances.next)
print(len(instances2))
print(instances2.next is None)
20
False
10
True
π troveclient Reference Guide π
π¦ troveclient π¦
π¦ troveclient package π¦
π§© Subpackages π§©
troveclient.apiclient package
π§© Submodules π§©
π troveclient.apiclient.auth module π
class troveclient.apiclient.auth.BaseAuthPlugin(auth_system=None, **kwargs) Bases: object
Base class for authentication plugins. An authentication plugin needs to override at least the authenticate method to be a valid plugin.
classmethod add_common_opts(parser)β Add options that are common for several plugins.classmethod add_opts(parser)β Populate the parser with the options for this plugin.auth_system = Noneauthenticate(http_client)β Authenticate using the plugin-defined method. The method usually analysesself.optsand performs a request to the authentication server.- Parameters:
http_client(troveclient.client.HTTPClient) β client object that needs authentication. - Raises:
AuthorizationFailure
- Parameters:
common_opt_names = ['auth_system', 'username', 'password', 'tenant_name', 'token', 'auth_url']static get_opt(opt_name, args)β Return option name and value.- Parameters:
opt_nameβ name of the option, e.g.,"username"argsβ parsed arguments
- Parameters:
opt_names = []parse_opts(args)β Parse the actual auth-system options if any. This method is expected to populate the attributeself.optswith a dict containing the options and values needed to make authentication.sufficient_options()β Check if all required options are present.- Raises:
AuthPluginOptionsMissing
- Raises:
abstractmethod token_and_endpoint(endpoint_type, service_type)β Return token and endpoint.- Parameters:
service_type(string) β Service type of the endpointendpoint_type(string) β Type of endpoint. Possible values:publicorpublicURL,internalorinternalURL,adminoradminURL
- Returns: tuple of token and endpoint strings
- Raises:
EndpointException
- Parameters:
troveclient.apiclient.auth.discover_auth_systems() β Discover the available auth-systems. This wonβt take into account the old style auth-systems.
troveclient.apiclient.auth.load_auth_system_opts(parser) β Load options needed by the available auth-systems into a parser. This function will try to populate the parser with options from the available plugins.
troveclient.apiclient.auth.load_plugin(auth_system)
troveclient.apiclient.auth.load_plugin_from_args(args) β Load required plugin and populate it with options. Try to guess auth system if it is not specified. Systems are tried in alphabetical order.
- Raises:
AuthPluginOptionsMissing
π§± troveclient.apiclient.base module π§±
Base utilities to build API operation managers and objects on top of. Very foundation-coded.
class troveclient.apiclient.base.BaseManager(client) Bases: HookableMixin
Basic manager type providing common operations. Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.
resource_class = None
class troveclient.apiclient.base.CrudManager(client) Bases: BaseManager
Base manager class for manipulating entities. Children of this class are expected to define a collection_key and key.
collection_key: Usually a plural noun by convention (e.g.entities); used to refer to collections in both URLβs (e.g./v3/entities) and JSON objects containing a list of member resources (e.g.{'entities': [{}, {}, {}]}).key: Usually a singular noun by convention (e.g.entity); used to refer to an individual member of the collection.build_url(base_url=None, **kwargs)β Builds a resource URL for the givenkwargs.
Given an example collection where collection_key = 'entities' and key = 'entity', the following URLβs could be generated.
By default, the URL will represent a collection of entities, e.g.:
/entities
If kwargs contains an entity_id, then the URL will represent a specific member, e.g.:
/entities/{entity_id}
- Parameters:
base_urlβ if provided, the generated URL will be appended to it.
collection_key = Nonecreate(**kwargs)delete(**kwargs)find(base_url=None, **kwargs)β Find a single item with attributes matching**kwargs.- Parameters:
base_urlβ if provided, the generated URL will be appended to it.
- Parameters:
get(**kwargs)head(**kwargs)key = Nonelist(base_url=None, **kwargs)β List the collection.- Parameters:
base_urlβ if provided, the generated URL will be appended to it.
- Parameters:
put(base_url=None, **kwargs)β Update an element.- Parameters:
base_urlβ if provided, the generated URL will be appended to it.
- Parameters:
update(**kwargs)
class troveclient.apiclient.base.Extension(name, module) Bases: HookableMixin
Extension descriptor.
SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
manager_class = None
πΈ troveclient.apiclient.base.HookableMixin
Bases: object
okay so this is the mixin that lets classes register hooks and then run them β it's giving "backstage pass" energy, fr fr. π
classmethod add_hook(hook_type, hook_func) Add a new hook of the specified type. Literally just registering it, bestie.
Parameters:
clsβ the class that registers hookshook_typeβ hook type, e.g.,'__pre_parse_args__'hook_funcβ hook function
classmethod run_hooks(hook_type, *args, **kwargs) Run all hooks of the specified type. all of them. no skipping. β¨
Parameters:
clsβ the class that registers hookshook_typeβ hook type, e.g.,'__pre_parse_args__'argsβ args to be passed to every hook functionkwargsβ kwargs to be passed to every hook function
π troveclient.apiclient.base.ManagerWithFind(client)
Bases: BaseManager
A manager with the extra find()/findall() methods β like a regular manager but with search superpowers. π
find(**kwargs) Find a single item whose attributes match **kwargs.
real talk: this isn't very efficient β it loads the entire list and then filters on the Python side. so like, it works, but it's giving brute force. π
findall(**kwargs) Find all items whose attributes match **kwargs.
same warning, bestie: not very efficient either β loads the entire list, then filters on the Python side.
abstractmethod list()
π troveclient.apiclient.base.Resource(manager, info, loaded=False)
Bases: object
The base class for OpenStack resources (tenant, user, etc.). Honestly it's pretty much just a bag for attributes β a cute little container, no cap. π
HUMAN_ID = FalseNAME_ATTR = 'name'
property human_id A human-readable ID that you can use for bash completion. π
property is_loaded
to_dict()
π«Ά troveclient.apiclient.base.getid(obj)
Return the id if the argument is a Resource.
It abstracts that super common pattern of letting you pass either an object or an object's ID (UUID) whenever you're dealing with relationships. iconic convenience behavior honestly. β¨
π troveclient.apiclient.client module
OpenStack Client interface. Handles the REST calls and responses. this is the main character of the networking world fr fr. π₯
π class troveclient.apiclient.client.BaseClient(http_client, extensions=None)
Bases: object
The top-level object to access the OpenStack API. π
This client uses HTTPClient to send requests β and HTTPClient handles a whole bunch of issues such as authentication, so you don't have to.
cached_endpoint = Noneclient_request(method, url, **kwargs)delete(url, **kwargs)endpoint_type = Noneget(url, **kwargs)
static get_class(api_name, version, version_map) Returns the client class for the requested API version. π―
Parameters:
api_nameβ the name of the API, e.g.'compute','image', etcversionβ the requested API versionversion_mapβ a dict of client classes keyed by version
Return type: a client class for the requested API version
head(url, **kwargs)patch(url, **kwargs)post(url, **kwargs)put(url, **kwargs)service_type = None
π class troveclient.apiclient.client.HTTPClient(auth_plugin, region_name=None, endpoint_type='publicURL', original_ip=None, verify=True, cert=None, timeout=None, timings=False, keyring_saver=None, debug=False, user_agent=None, http=None)
Bases: object
This client handles sending HTTP requests to OpenStack servers. it's the whole vibe. β¨
Features β buckle up bestie, there's a lot and they're all slay:
- share authentication information between several clients to different services (e.g., for compute and image clients);
- reissue authentication request for expired tokens;
- encode/decode JSON bodies;
- raise exceptions on HTTP errors;
- pluggable authentication;
- store authentication information in a keyring;
- store time spent for requests;
- register clients for particular services, so one can use
http_client.identityorhttp_client.compute; - log requests and responses in a format that is easy to copy-and-paste into terminal and send the same request with
curl.
add_client(base_client_instance) Add a new instance of BaseClient descendant.
self will store a reference to base_client_instance.
Example:
>>> def test_clients():
... from keystoneclient.auth import keystone
... from openstack.common.apiclient import client
... auth = keystone.KeystoneAuthPlugin(
... username="user", password="pass", tenant_name="tenant",
... auth_url="http://auth:5000/v2.0")
... openstack_client = client.HTTPClient(auth)
... # create nova client
... from novaclient.v1_1 import client
... client.Client(openstack_client)
... # create keystone client
... from keystoneclient.v2_0 import client
... client.Client(openstack_client)
... # use them
... openstack_client.identity.tenants.list()
... openstack_client.compute.servers.list()
authenticate()
client_request(client, method, url, **kwargs) Send an http request using the client's endpoint and the specified url. π
If the request was rejected as unauthorized (possibly because the token is expired), it issues one authorization attempt and sends the request once again. the way it just retries for you. π«Ά
Parameters:
clientβ instance ofBaseClientdescendantmethodβ method of HTTP requesturlβ URL of HTTP requestkwargsβ any other parameter that can be passed toHTTPClient.request
static concat_url(endpoint, url) Concatenate the endpoint and the final URL.
E.g., "http://keystone/v2.0/" and "/tokens" are concatenated to "http://keystone/v2.0/tokens". math but make it URLs. π§
Parameters:
endpointβ the base URLurlβ the final URL
get_timings()
request(method, url, **kwargs) Send an http request with the specified characteristics.
Wrapper around requests.Session.request to handle tasks such as setting headers, JSON encoding/decoding, and error handling.
Parameters:
methodβ method of HTTP requesturlβ URL of HTTP requestkwargsβ any other parameter that can be passed torequests.Session.request(such asheaders) orjson, which will be encoded as JSON and used as thedataargument
reset_timings()
serialize(kwargs)
user_agent = 'troveclient.apiclient'
π troveclient.apiclient.exceptions module
Exception definitions. the drama section, honestly. π
exception troveclient.apiclient.exceptions.AmbiguousEndpoints(endpoints=None)
Bases: EndpointException
Found more than one matching endpoint in the Service Catalog. like when you have too many options and the code panics. π
exception troveclient.apiclient.exceptions.AuthPluginOptionsMissing(opt_names)
Bases: AuthorizationFailure
Auth plugin misses some options. rip.
exception troveclient.apiclient.exceptions.AuthSystemNotFound(auth_system)
Bases: AuthorizationFailure
The user has specified an AuthSystem that is not installed.
exception troveclient.apiclient.exceptions.AuthorizationFailure
Bases: ClientException
Cannot authorize API client. π
exception troveclient.apiclient.exceptions.BadGateway(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpServerError
HTTP 502 - Bad Gateway.
The server was acting as a gateway or proxy and received an invalid response from the upstream server.
http_status = 502message = 'Bad Gateway'
exception troveclient.apiclient.exceptions.BadRequest(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 400 - Bad Request.
The request cannot be fulfilled due to bad syntax.
http_status = 400message = 'Bad Request'
exception troveclient.apiclient.exceptions.ClientException
Bases: Exception
The base exception class for all exceptions this library raises. the mother of all drama. π
exception troveclient.apiclient.exceptions.CommandError
Bases: ClientException
Error in CLI tool.
exception troveclient.apiclient.exceptions.Conflict(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 409 - Conflict.
Indicates that the request could not be processed because of a conflict in the request, such as an edit conflict.
http_status = 409message = 'Conflict'
exception troveclient.apiclient.exceptions.ConnectionRefused
Bases: ClientException
Cannot connect to API service. π
exception troveclient.apiclient.exceptions.EndpointException
Bases: ClientException
Something is rotten in the Service Catalog. literally the Shakespeare of error messages, iykyk. π
exception troveclient.apiclient.exceptions.EndpointNotFound
Bases: EndpointException
Could not find the requested endpoint in the Service Catalog. π
exception troveclient.apiclient.exceptions.ExpectationFailed(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 417 - Expectation Failed.
The server cannot meet the requirements of the Expect request-header field.
http_status = 417message = 'Expectation Failed'
exception troveclient.apiclient.exceptions.Forbidden(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 403 β Forbidden. Bestie, the request was a valid request, but the server is straight-up refusing to respond to it. Like it saw your fit and said "not today." π«
http_status = 403message = 'Forbidden'
exception troveclient.apiclient.exceptions.GatewayTimeout(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpServerError
HTTP 504 β Gateway Timeout. The server was acting as a gateway or proxy and did not receive a timely response from the upstream server. It literally waited and the other server ghosted it π
http_status = 504message = 'Gateway Timeout'
exception troveclient.apiclient.exceptions.Gone(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 410 β Gone. Indicates that the resource requested is no longer available and will not be available again. Not "brb" gone β gone gone. It's not coming back, periodt. π
http_status = 410message = 'Gone'
exception troveclient.apiclient.exceptions.HTTPClientError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpError
Client-side HTTP error. This is the exception for cases in which the client seems to have erred β aka the 4xx family vibes. π
message = 'HTTP Client Error'
exception troveclient.apiclient.exceptions.HttpError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: ClientException
The base exception class for all HTTP exceptions. The main character of the error hierarchy, fr fr. π
http_status = 0message = 'HTTP Error'
exception troveclient.apiclient.exceptions.HttpNotImplemented(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpServerError
HTTP 501 β Not Implemented. The server either does not recognize the request method, or it lacks the ability to fulfill the request. It's giving "that's not in my skill set." π
http_status = 501message = 'Not Implemented'
exception troveclient.apiclient.exceptions.HttpServerError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpError
Server-side HTTP error. The exception for cases in which the server is aware that it has erred or is incapable of performing the request. At least it's self-aware bestie π«Ά (the 5xx squad)
message = 'HTTP Server Error'
exception troveclient.apiclient.exceptions.HttpVersionNotSupported(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpServerError
HTTP 505 β HttpVersion Not Supported. The server does not support the HTTP protocol version used in the request. Wrong era, wrong timeline, wrong protocol π
http_status = 505message = 'HTTP Version Not Supported'
exception troveclient.apiclient.exceptions.InternalServerError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpServerError
HTTP 500 β Internal Server Error. A generic error message, given when no more specific message is suitable. The classic "it's not you it's me" of HTTP errors π
http_status = 500message = 'Internal Server Error'
exception troveclient.apiclient.exceptions.LengthRequired(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 411 β Length Required. The request did not specify the length of its content, which is required by the requested resource. Bestie forgot to say how big it was π
http_status = 411message = 'Length Required'
exception troveclient.apiclient.exceptions.MethodNotAllowed(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 405 β Method Not Allowed. A request was made of a resource using a request method not supported by that resource. Wrong verb, wrong move, wrong energy π«
http_status = 405message = 'Method Not Allowed'
exception troveclient.apiclient.exceptions.MissingArgs(missing, message=None)
Bases: ClientException
Supplied arguments are not sufficient for calling a function. You forgot stuff, bestie β it happens to the best of us π
exception troveclient.apiclient.exceptions.NoUniqueMatch
Bases: ClientException
Multiple entities found instead of one. Ambush situation β the search said "one" and the API said "girl, there's a whole group chat." π
exception troveclient.apiclient.exceptions.NotAcceptable(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 406 β Not Acceptable. The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request. The β¨vibe checkβ¨ failed π
http_status = 406message = 'Not Acceptable'
exception troveclient.apiclient.exceptions.NotFound(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 404 β Not Found. The requested resource could not be found but may be available again in the future. So likeβ¦ it's not ghosting you forever, just for rn π«Ά
http_status = 404message = 'Not Found'
exception troveclient.apiclient.exceptions.PaymentRequired(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 402 β Payment Required. Reserved for future use. It's the "coming soon" of HTTP status codes, no cap π
http_status = 402message = 'Payment Required'
exception troveclient.apiclient.exceptions.PreconditionFailed(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 412 β Precondition Failed. The server does not meet one of the preconditions that the requester put on the request. You set terms, the server said "can't relate." π
http_status = 412message = 'Precondition Failed'
exception troveclient.apiclient.exceptions.ProxyAuthenticationRequired(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 407 β Proxy Authentication Required. The client must first authenticate itself with the proxy. Like, proxy needs to see your ID before it lets you in πͺͺ
http_status = 407message = 'Proxy Authentication Required'
exception troveclient.apiclient.exceptions.RequestEntityTooLarge(*args, **kwargs)
Bases: HTTPClientError
HTTP 413 β Request Entity Too Large. The request is larger than the server is willing or able to process. Too much. Overflowing. The server said "I can't take all that." π
http_status = 413message = 'Request Entity Too Large'
exception troveclient.apiclient.exceptions.RequestTimeout(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 408 β Request Timeout. The server timed out waiting for the request. Bestie took too long to send it and the server moved on π
http_status = 408message = 'Request Timeout'
exception troveclient.apiclient.exceptions.RequestUriTooLong(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 414 β Request-URI Too Long. The URI provided was too long for the server to process. That URL was giving essay. π
http_status = 414message = 'Request-URI Too Long'
exception troveclient.apiclient.exceptions.RequestedRangeNotSatisfiable(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 416 β Requested Range Not Satisfiable. The client has asked for a portion of the file, but the server cannot supply that portion. You asked for a slice and the server said "there is no slice." π°β
http_status = 416message = 'Requested Range Not Satisfiable'
exception troveclient.apiclient.exceptions.ServiceUnavailable(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HttpServerError
HTTP 503 β Service Unavailable. The server is currently unavailable. She's on a break, leave a message π«Ά
http_status = 503message = 'Service Unavailable'
exception troveclient.apiclient.exceptions.Unauthorized(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 401 β Unauthorized. Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. Like the bouncer situation: no wristband, no entry. ποΈ
http_status = 401message = 'Unauthorized'
exception troveclient.apiclient.exceptions.UnprocessableEntity(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 422 β Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors. Grammatically fine, morally confusing π
http_status = 422message = 'Unprocessable Entity'
exception troveclient.apiclient.exceptions.UnsupportedMediaType(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
Bases: HTTPClientError
HTTP 415 β Unsupported Media Type. The request entity has a media type which the server or resource does not support. It's giving "we don't accept that file format here, bestie." πΌ
http_status = 415message = 'Unsupported Media Type'
exception troveclient.apiclient.exceptions.UnsupportedVersion
Bases: ClientException
User is trying to use an unsupported version of the API. Time-traveling to an era the API doesn't cover π°οΈ
exception troveclient.apiclient.exceptions.ValidationError
Bases: ClientException
Error in validation on API client side. Literally the API client checking its own fit in the mirror and finding a flaw πͺ
troveclient.apiclient.exceptions.from_response(response, method, url)
Returns an instance of HttpError or subclass based on response. The matchmaker that picks the perfect error class for your situation π
Parameters
- response β instance of
requests.Responseclass - method β HTTP method used for request
- url β URL used for request
β¨ MODULE CONTENTS β¨
π§Έ troveclient.compat package
π§ Submodules
troveclient.compat.auth module
class troveclient.compat.auth.Auth1_1(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
Bases: Authenticator.
authenticate()β Authenticate against a v2.0 auth service. Slay, v2 energy.
class troveclient.compat.auth.Authenticator(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
Bases: object.
Helper class to perform Keystone or other miscellaneous authentication. The "authenticate" method returns a ServiceCatalog, which can be used to obtain a token.
URL_REQUIRED = True
authenticate()β the auth method itself, bestie.
class troveclient.compat.auth.FakeAuth(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
Bases: Authenticator.
Useful for faking auth. Yes, that's literally its whole job.
authenticate()β fake-auth time.
class troveclient.compat.auth.KeyStoneV2Authenticator(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
Bases: Authenticator.
authenticate()β the Keystone v2 auth method.
class troveclient.compat.auth.KeyStoneV3Authenticator(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
Bases: Authenticator.
authenticate()β the Keystone v3 auth method.
class troveclient.compat.auth.ServiceCatalog(resource_dict, region=None, service_type=None, service_name=None, service_url=None, root_key='access')
Bases: object.
Represents a Keystone Service Catalog which describes a service. This class has methods to obtain a valid token as well as a public service url and a management url.
get_management_url()get_public_url()get_token()
class troveclient.compat.auth.ServiceCatalog3(resource_dict, region=None, service_type=None, service_name=None, service_url=None, token=None)
Bases: object.
Represents a Keystone Service Catalog which describes a service. This class has methods to obtain a valid token as well as a public service url and a management url.
get_management_url()get_public_url()get_token()
troveclient.compat.auth.get_authenticator_cls(cls_or_name)
Factory method to retrieve Authenticator class. It's giving "auth class vending machine," honestly.
troveclient.compat.base module
Base utilities to build API operation managers and objects on top of. Lowkey the foundation of the whole vibe.
class troveclient.compat.base.Manager(api)
Bases: HookableMixin (from troveclient.compat.utils.HookableMixin).
Manager defining CRUD operations for API. Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.
completion_cache(cache_type, obj_class, mode)β Bash-completion cache. The completion cache store items that can be used for bash autocompletion, like UUIDs or human-friendly IDs. A resource listing will clear and repopulate the cache. A resource create will append to the cache. Delete is not handled because listings are assumed to be performed often enough to keep the cache reasonably up-to-date.resource_class = Nonewrite_to_completion_cache(cache_type, val)
class troveclient.compat.base.ManagerWithFind(api)
Bases: Manager.
Like a Manager, but with additional find()/findall() methods. Fancy.
find(**kwargs)β Find a single item with attributes matching**kwargs. This isn't very efficient: it loads the entire list then filters on the Python side.findall(**kwargs)β Find all items with attributes matching**kwargs. This isn't very efficient: it loads the entire list then filters on the Python side.list()
class troveclient.compat.base.Resource(manager, info, loaded=False)
Bases: object.
A resource represents a particular instance of an object like server. This is pretty much just a bag for attributes. :param manager: Manager object; :param info: dictionary representing resource attributes; :param loaded: prevent lazy-loading if set to True.
HUMAN_ID = False
get()property human_idβ Provides a pretty ID which can be used for bash completion.is_loaded()set_loaded(val)
troveclient.compat.base.getid(obj)
Retrives an id from object or integer. Abstracts the common pattern of allowing both an object or an object's ID as a parameter when dealing with relationships. Iconic convenience behavior, fr fr.
troveclient.compat.cli module
Trove Command line tool. The CLI bestie we all deserve.
class troveclient.compat.cli.BackupsCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Command to manage and show backups.
create()β Create a new backup.delete()β Delete a backup.get()β Get details for the specified backup.list()β List backups.params = ['name', 'instance', 'description']
class troveclient.compat.cli.ConfigurationsCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Command to manage and show configurations.
create()β Create a new configuration.delete()β Delete a configuration.edit()β Edit an existing configuration values.get()β Get details for the specified configuration.list()β List configurations.list_instances()β Get details for the specified configuration.params = ['name', 'instances', 'values', 'description', 'parameter']update()β Update an existing configuration.
class troveclient.compat.cli.DatabaseCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Database CRUD operations on an instance.
create()β Create a database.delete()β Delete a database.list()β List the databases.params = ['name', 'id', 'limit', 'marker']
class troveclient.compat.cli.DatastoreConfigurationParameters(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Command to show configuration parameters for a datastore.
get_parameter()β List parameters that can be set.parameters()β List parameters that can be set.params = ['datastore', 'parameter']
class troveclient.compat.cli.FlavorsCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Command for listing Flavors.
list()β List the available flavors.params = []
class troveclient.compat.cli.InstanceCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Commands to perform various instance operations and actions.
backups()β Get a list of backups for the specified instance.configuration()β Get configuration for the specified instance.create()β Create a new instance.delete()β Delete the specified instance.get()β Get details for the specified instance.list()β List all instances for account.modify()β Modify an instance.params = ['flavor', 'id', 'limit', 'marker', 'name', 'size', 'backup', 'availability_zone', 'configuration_id']resize_instance()β Resize an instance flavorresize_volume()β Resize an instance volume.restart()β Restart the database.
class troveclient.compat.cli.LimitsCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Show the rate limits and absolute limits.
list()β List the rate limits and absolute limits.
class troveclient.compat.cli.MetadataCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Commands to create/update/replace/delete/show metadata for an instance.
params = ['instance_id', 'metadata']show()β Show instance metadata.
class troveclient.compat.cli.RootCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Root user related operations on an instance.
create()β Enable the instance's root user.delete()β Disable the instance's root user.enabled()β Check the instance for root access.params = ['id']
class troveclient.compat.cli.SecurityGroupCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
Commands to list and show Security Groups For an Instance and create and delete security group rules for them.
add_rule()β Add a security group rule.delete_rule()β Delete a security group rule.get()β Get a security group associated with an instance.list()β List all the Security Groups and the rules.params = ['id', 'secgroup_id', 'protocol', 'from_port', 'to_port', 'cidr']
class troveclient.compat.cli.UserCommands(parser)
Bases: AuthedCommandsBase (troveclient.compat.common.AuthedCommandsBase).
User CRUD operations on an instance.
access()β Show all databases the user has access to.change_password()β Change the password of a single user.create()β Create a user in instance, with access to one or more databases.delete()β Delete the specified userget()β Get a single user.grant()β Allow an existing user permissions to access one or more databases.list()β List all the users for an instance.
params = ['id', 'database', 'databases', 'hostname', 'name',
'password', 'new_name', 'new_host', 'new_password']
revoke()β takes away an existing user's access permissions to a database. like, revoking their invite to the group chat but for your data πupdate_attributes()β updates the attributes of one single user. one. not a crowd. π
β¨ troveclient.compat.cli.VersionCommands(parser) β¨
Bases: AuthedCommandsBase (linked as <#troveclient.compat.common.AuthedCommandsBase> in the docs, iykyk)
Lists the versions you've got available. very "which era are we in" of it.
list()β lists all the supported versions.
params = ['url']
πΈ troveclient.compat.cli.main() πΈ
literally the entry point. that's the whole vibe. π«Ά
π troveclient.compat.client module π
class troveclient.compat.client.Dbaas(username, api_key, tenant=None, auth_url=None, service_type='database', service_name=None, service_url=None, insecure=False, auth_strategy='keystone', region_name=None, client_cls=<class 'troveclient.compat.client.TroveHTTPClient'>)
Bases: object
okay so this is the top-level object you use to access the Rackspace Database as a Service API. the main character, fr.
Make an instance with your creds:
>> red = Dbaas(USERNAME, API_KEY, TENANT, AUTH_URL, SERVICE_NAME, SERVICE_URL)
Then call methods on its managers:
>> red.instances.list()
...
>> red.flavors.list()
...
&c. β yes the manpage literally says &c., we love a vintage moment π
authenticate()
Authenticates against the server. π¦
This is the thing that actually gets called to perform an authentication and grab you a token.
Returns on success; raises exceptions.Unauthorized if the credentials are wrong. bestie if you see that one, check your creds before you spiral π
get_timings()
gets the timings. β±οΈ literally what it says on the tin.
set_management_url(url)
sets the management url to url. π
class troveclient.compat.client.TroveHTTPClient(user, password, tenant, auth_url, service_name, service_url=None, auth_strategy=None, insecure=False, timeout=None, proxy_tenant_id=None, proxy_token=None, region_name=None, endpoint_type='publicURL', service_type=None, timings=False)
Bases: Http
USER_AGENT = 'python-troveclient'
the whole class is literally identified as python-troveclient. branding icon. β¨
authenticate()
Auths the client and gets a token. May optionally set a service url.
The client will get auth errors until the authentication step occurs β so like, don't come for it before it's ready π. Additionally, if a service_url was not explicitly given in the client's __init__ method, one will be obtained from the auth service. it'll find its own way, she's resourceful.
authenticate_with_token(token, service_url=None)
authenticate, but with a token instead. and optionally a service_url. two args, no notes. π«Ά
delete(url, **kwargs)
DELETE request to url, with **kwargs passed through. bye bye π
get(url, **kwargs)
GET request to url, with **kwargs. the classic.
get_timings()
timings!! get 'em!! β±οΈ
http_log(args, kwargs, resp, body)
logs the http stuff: the args, the kwargs, the resp and the body. π
morph_request(kwargs)
morphs the request based on kwargs. it's giving shapeshifter π§
morph_response_body(raw_body)
morphs the response body from raw_body. matching energy, we love a coordinated moment.
patch(url, **kwargs)
PATCH request to url, with **kwargs. the β¨artisticβ¨ one.
post(url, **kwargs)
POST request to url, with **kwargs. new data who dis.
pretty_log(args, kwargs, resp, body)
same as the log one but pretty. args, kwargs, resp, body, but make it cute π
put(url, **kwargs)
PUT request to url, with **kwargs. replace the whole thing, no cap.
raise_error_from_status(resp, body)
raises the appropriate error based on resp and body. it will absolutely let you know. π
request(*args, **kwargs)
Performs a single HTTP request. okay here's the full tea:
- The
'uri'is the URI of the HTTP resource and can begin with either'http'or'https'. The value of'uri'must be an absolute URI. no shortcuts, bestie. - The
'method'is the HTTP method to perform, such asGET,POST,DELETE, etc. There is no restriction on the methods allowed. go feral. - The
'body'is the entity body to be sent with the request. It is a string object. string. noted. π - Any extra headers that are to be sent with the request should be provided in the
'headers'dictionary. - The maximum number of redirect to follow before raising an exception is
'redirections. The default is 5.
The return value is a tuple of (response, content) β the first being an instance of the 'Response' class, the second being a string that contains the response entity body. two-for-one slay. π
simple_log(args, kwargs, resp, body)
the simple version of the logging: args, kwargs, resp, body. no frills, just facts.
troveclient.compat.client.log_to_streamhandler(stream=None)
wires your logging up to a stream handler, optionally to stream. lowkey essential if you actually want to see anything π
π troveclient.compat.common module π
exception troveclient.compat.common.ArgumentRequired(param)
Bases: Exception
you forgot a param. it's telling you. π
exception troveclient.compat.common.ArgumentsRequired(*params)
Bases: ArgumentRequired
plural edition β you forgot several. genuinely devastating. π
class troveclient.compat.common.Auth(parser)
Bases: CommandsBase
Authenticate with your username and api key. π
login()
Login to retrieve an auth token to use for other api calls. the whole "get your ticket so you can get in the door" of it all.
params = ['apikey', 'auth_strategy', 'auth_type', 'auth_url',
'options', 'region', 'service_name', 'service_type',
'service_url', 'tenant_id', 'username']
class troveclient.compat.common.AuthedCommandsBase(parser)
Bases: CommandsBase
Commands that work only with an authenticated client. no token no entry, periodt.
class troveclient.compat.common.CliOptions(**kwargs)
Bases: object
A token object containing the user, apikey and token which is pickleable. yes. pickleable. don't make it weird. π₯
APITOKEN = '/homeless-shelter/.apitoken'
β οΈ heads up bestie, that path is literally /homeless-shelter/.apitoken in the source β keep it, don't "fix" it, it's iconic in a cursed way π
DEFAULT_VALUES = {'apikey': None, 'auth_type': 'keystone',
'auth_url': None, 'debug': False, 'insecure': False, 'region':
'RegionOne', 'service_name': '', 'service_type': 'database',
'service_url': None, 'tenant_id': None, 'token': None,
'username': None, 'verbose': False}
classmethod create_optparser(load_file)β builds the optparser, takingload_fileinto account. π οΈclassmethod default()β hands you a default one. comfy.classmethod load_from_file()β loads the whole thing from a file. πΎclassmethod save_from_instance_fields(instance)β saves it out from aninstance's fields. putting it back where it belongs π
class troveclient.compat.common.CommandsBase(parser)
Bases: object
params = []
empty list. blank slate. main character energy before the makeover montage. β
class troveclient.compat.common.Paginated(items=None, next_marker=None, links=None)
Bases: object
okay this one is so clever. It pretends to be a list if you iterate over it, but also keeps a next property you can use to get the next page of data. so you get list vibes and pagination. obsessed. π¦
troveclient.compat.common.check_for_exceptions(resp, body)
looks at resp and body and checks whether something went wrong. your little error lookout π§
troveclient.compat.common.limit_url(url, limit=None, marker=None)
builds a url out of url with an optional limit and marker. π
troveclient.compat.common.methods_of(obj)
Get all callable methods of an object that don't start with underscore. returns a list of tuples of the form (method_name, method). so like, the public roster only, we don't dig into the private stuff π
troveclient.compat.common.print_actions(cmd, actions)
Print help for the command cmd with the list of options and description. actions and all. π
troveclient.compat.common.print_commands(commands)
Print the list of available commands and their description. this is the canonical "so what can I actually do" moment β¨
troveclient.compat.common.quote_user_host(user, host)
quotes user and host together. small function, big responsibility π«Ά
π¦ troveclient.compat.exceptions module π¦
okay this is the whole drama department. every one of these is a mood. let's go π
exception troveclient.compat.exceptions.AmbiguousEndpoints(endpoints=None)
Bases: Exception
Found more than one matching endpoint in Service Catalog.
endpoints optional. it literally cannot choose. relatable.
exception troveclient.compat.exceptions.AuthUrlNotGiven
Bases: EndpointNotFound
The auth url was not given.
you didn't give it an auth url. give it an auth url. π
exception troveclient.compat.exceptions.AuthorizationFailure
Bases: Exception
authorization failed. that's the whole thing. π
exception troveclient.compat.exceptions.BadRequest(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 400 - Bad request: you sent some malformed data.
http_status = 400
message = 'Bad request'
the formatting was giving nothing, bestie.
exception troveclient.compat.exceptions.ClientException(code, message=None, details=None, request_id=None)
Bases: Exception
The base exception class for all exceptions this library raises. the mother of the whole family π
exception troveclient.compat.exceptions.CommandError
Bases: Exception
the command errored. no further commentary. π
exception troveclient.compat.exceptions.Conflict(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 409 - Conflict.
http_status = 409
message = 'Conflict'
two things wanted the same spot. it's giving sibling rivalry.
exception troveclient.compat.exceptions.EndpointNotFound
Bases: Exception
Could not find Service or Region in Service Catalog.
we looked. it wasn't there. π΅οΈ
exception troveclient.compat.exceptions.Forbidden(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 403 - Forbidden: your don't have access to this resource.
http_status = 403
message = 'Forbidden'
(and yes, the manpage says "your don't have access". we're keeping it. character, not bug π)
exception troveclient.compat.exceptions.HTTPNotImplemented(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 501 - Not Implemented: the server does not support this operation.
http_status = 501
message = 'Not Implemented'
it's not a skill issue, the server genuinely can't.
exception troveclient.compat.exceptions.NoTokenLookupException
Bases: Exception
This form of authentication does not support looking up endpoints from an existing token.
sorry bestie, this auth style doesn't do lookups from a token you already have. rules are rules. π
exception troveclient.compat.exceptions.NoUniqueMatch
Bases: Exception
no unique match found. multiple candidates, zero winners. π
exception troveclient.compat.exceptions.NotFound(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 404 - Not found.
http_status = 404
message = 'Not found'
the original "it's not here". legend.
exception troveclient.compat.exceptions.OverLimit(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 413 - Over limit: you're over the API limits for this time period.
http_status = 413
message = 'Over limit'
you maxed out your allowance for the period. respectfully, slow down π₯
exception troveclient.compat.exceptions.ResponseFormatError
Bases: Exception
Could not parse the response format.
we tried to read it and it was gibberish. π«
exception troveclient.compat.exceptions.ServiceUrlNotGiven
Bases: EndpointNotFound
The service url was not given.
the service url. was not given. it's in the name, babe.
exception troveclient.compat.exceptions.Unauthorized(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 401 - Unauthorized: bad credentials.
http_status = 401
message = 'Unauthorized'
bad creds. wrong password. whose password? not ours, allegedly π
exception troveclient.compat.exceptions.UnprocessableEntity(code, message=None, details=None, request_id=None)
Bases: ClientException
HTTP 422 - Unprocessable Entity: The request cannot be processed.
http_status = 422
message = 'Unprocessable Entity'
the request is valid in shape and yet we cannot process it. humbling.
exception troveclient.compat.exceptions.UnsupportedVersion
Bases: Exception
Indicates that the user is trying to use an unsupported version of the API.
you picked a version that isn't supported. we're not mad, just disappointed β¨
troveclient.compat.exceptions.from_response(response, body)
Return an instance of a ClientException based on a request's response. π
Usage:
resp, body = http.request(...)
if resp.status != 200:
raise exception_from_response(resp, body)
that's literally the pattern. copy it into your muscle memory, iykyk π§
π troveclient.compat.mcli module π
Trove Management Command line tool
that's it. that's the module. the management command line tool of it all. π₯
π class troveclient.compat.mcli.AccountCommands(parser)
Bases: AuthedCommandsBase (full path: troveclient.compat.common.AuthedCommandsBase). This one is all about account info, okay? Itβs literally the commands to list account info.
get()β grabs the details for the account you provided.list()β lists every account that has non-deleted instances. No deleted-instance ghosts here, bestie.params = ['id']β yep, thatβs the params list, exactly like that.
π«Ά class troveclient.compat.mcli.FlavorsCommands(parser)
Bases: AuthedCommandsBase (full path: troveclient.compat.common.AuthedCommandsBase). Commands for managing Flavors. Flavor management era.
create()β creates a new flavor. Slay.params = ['name', 'ram', 'disk', 'vcpus', 'flavor_id', 'ephemeral', 'swap', 'rxtx_factor', 'service_type']β the whole param lineup, exactly as listed.
π class troveclient.compat.mcli.HostCommands(parser)
Bases: AuthedCommandsBase (full path: troveclient.compat.common.AuthedCommandsBase). Commands to list info on hosts.
get()β lists details for the specified host.list()β lists all compute hosts.params = ['name']β the param list, right there.update_all()β updates all instances on a host.
π¦ class troveclient.compat.mcli.InstanceCommands(parser)
Bases: AuthedCommandsBase (full path: troveclient.compat.common.AuthedCommandsBase). List details about an instance.
diagnostic()β lists diagnostic details about an instance.get()β lists details for the instance.hwinfo()β shows hardware information details about an instance.list()β lists all instances for account.migrate()β migrates the instance.params = ['deleted', 'id', 'limit', 'marker', 'host']β exact param list, no cap.reboot()β reboots the instance.reset_task_status()β sets the instanceβs task status toNONE.stop()β stops MySQL on the given instance.
πΈ class troveclient.compat.mcli.QuotaCommands(parser)
Bases: AuthedCommandsBase (full path: troveclient.compat.common.AuthedCommandsBase). List and update quota limits for a tenant.
list()β lists all quotas for a tenant.params = ['id', 'instances', 'volumes', 'backups']β exact param list.update()β updates quota limits for a tenant.
π class troveclient.compat.mcli.RootCommands(parser)
Bases: AuthedCommandsBase (full path: troveclient.compat.common.AuthedCommandsBase). List details about the root info for an instance.
history()β lists root history for the instance.params = ['id']β param list, periodt.
π class troveclient.compat.mcli.StorageCommands(parser)
Bases: AuthedCommandsBase (full path: troveclient.compat.common.AuthedCommandsBase). Commands to list devices info.
list()β lists details for the storage device.params = []β empty list, exactly.troveclient.compat.mcli.config_options(oparser)β thatβs the function signature, bestie.troveclient.compat.mcli.main()β and hereβsmain(), same as the original.
π§ troveclient.compat.utils module
class troveclient.compat.utils.HookableMixin
Bases: object. Mixin so classes can register and run hooks.
classmethod add_hook(hook_type, hook_func)β classmethod signature, exact.classmethod run_hooks(hook_type, *args, **kwargs)β classmethod signature, exact.troveclient.compat.utils.env(*vars, **kwargs)β returns environment variables. It returns the first environment variable set if none are non-empty, and defaults to''or the keyword arg default. iykyk.
π troveclient.compat.versions module
class troveclient.compat.versions.Version(manager, info, loaded=False)
Bases: Resource (full path: troveclient.compat.base.Resource). Version is an opaque instance used to hold version information. Opaque and iconic.
class troveclient.compat.versions.Versions(api)
Bases: ManagerWithFind (full path: troveclient.compat.base.ManagerWithFind). Manages Versions information.
index(url)β gets a list of all versions. Return type:list of Versions.resource_classβ alias ofVersion.
π¦ Module contents
π¦ troveclient.osc package
Subpackages
π§ troveclient.osc.v1 package
Submodules
β troveclient.osc.v1.base module
class troveclient.osc.v1.base.TroveDeleter(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command.
delete_resources(ids)β deletes one or more resources.log = <Logger troveclient.osc.v1.base.TroveDeleter (WARNING)>β exact logger line.
π troveclient.osc.v1.database_backup_strategy module
class troveclient.osc.v1.database_backup_strategy.CreateDatabaseBackupStrategy(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne.
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backup_strategy.CreateDatabaseBackupStrategy (WARNING)>β exact logger line.take_action(parsed_args)β runs the command. Returns a tuple containing the column names and an iterable containing the data to be listed.
class troveclient.osc.v1.database_backup_strategy.DeleteDatabaseBackupStrategy(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command.
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backup_strategy.DeleteDatabaseBackupStrategy (WARNING)>β exact logger line.take_action(parsed_args)β override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_backup_strategy.ListDatabaseBackupStrategies(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister.
columns = ['Project ID', 'Instance ID', 'Swift Container']β exact columns.get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backup_strategy.ListDatabaseBackupStrategies (WARNING)>β exact logger line.take_action(parsed_args)β runs the command. Returns a tuple containing the column names and an iterable containing the data to be listed.
π troveclient.osc.v1.database_backups module
Database v1 Backups action implementations. Say that five times fast.
class troveclient.osc.v1.database_backups.CreateDatabaseBackup(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne.
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backups.CreateDatabaseBackup (WARNING)>β exact logger line.take_action(parsed_args)β runs the command. Returns a tuple containing the column names and an iterable containing the data to be listed.
class troveclient.osc.v1.database_backups.DeleteDatabaseBackup(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: TroveDeleter (full path: troveclient.osc.v1.base.TroveDeleter).
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backups.DeleteDatabaseBackup (WARNING)>β exact logger line.take_action(parsed_args)β override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_backups.DeleteDatabaseBackupExecution(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command.
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backups.DeleteDatabaseBackupExecution (WARNING)>β exact logger line.take_action(parsed_args)β override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_backups.ListDatabaseBackups(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister.
columns = ['ID', 'Instance ID', 'Name', 'Status', 'Parent ID', 'Updated', 'Project ID']β exact columns.get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backups.ListDatabaseBackups (WARNING)>β exact logger line.take_action(parsed_args)β runs the command. Returns a tuple containing the column names and an iterable containing the data to be listed.
class troveclient.osc.v1.database_backups.ListDatabaseInstanceBackups(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister.
columns = ['ID', 'Instance ID', 'Name', 'Status', 'Parent ID', 'Updated']β exact columns.get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backups.ListDatabaseInstanceBackups (WARNING)>β exact logger line.take_action(parsed_args)β runs the command. Returns a tuple containing the column names and an iterable containing the data to be listed.
class troveclient.osc.v1.database_backups.ShowDatabaseBackup(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne.
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_backups.ShowDatabaseBackup (WARNING)>β exact logger line.take_action(parsed_args)β runs the command. Returns a tuple containing the column names and an iterable containing the data to be listed.troveclient.osc.v1.database_backups.set_attributes_for_print_detail(backup)β the helper signature, exactly as listed.
π
troveclient.osc.v1.database_clusters module
Database v1 Clusters action implementations.
class troveclient.osc.v1.database_clusters.CreateDatabaseCluster(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne.
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_clusters.CreateDatabaseCluster (WARNING)>β exact logger line.take_action(parsed_args)β runs the command. Returns a tuple containing the column names and an iterable containing the data to be listed.
class troveclient.osc.v1.database_clusters.DeleteDatabaseCluster(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command.
get_parser(prog_name)β returns anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_clusters.DeleteDatabaseCluster (WARNING)>β exact logger line.
log = <Logger troveclient.osc.v1.database_clusters.DeleteDatabaseCluster (WARNING)>
take_action(parsed_args) β bestie this is the override hook, k? "Override to do something useful." The returned value is literally what the program hands back. That's the whole vibe. π
class troveclient.osc.v1.database_clusters.ForceDeleteDatabaseCluster(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser. That's it, that's the job. β¨
log = <Logger troveclient.osc.v1.database_clusters.ForceDeleteDatabaseCluster (WARNING)>
take_action(parsed_args) β "Override to do something useful." Whatever it returns, the program returns. π«Ά
class troveclient.osc.v1.database_clusters.GrowDatabaseCluster(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser. π
log = <Logger troveclient.osc.v1.database_clusters.GrowDatabaseCluster (WARNING)>
take_action(parsed_args) β "Override to do something useful." And yeah, the returned value gets returned by the program. round and round we go π
class troveclient.osc.v1.database_clusters.ListDatabaseClusterInstances(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister β ok so this one's a lister, she lists things β¨
columns = ['ID', 'Name', 'Flavor ID', 'Size', 'Status'] β these are the column headers, keep them exactly, no cap.
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_clusters.ListDatabaseClusterInstances (WARNING)>
take_action(parsed_args) β "Run command." Returns a tuple containing the column names and an iterable containing the data to be listed. iconique π
class troveclient.osc.v1.database_clusters.ListDatabaseClusterModules(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columns = ['instance_name', 'Module Name', 'Module Type', 'md5', 'created', 'updated'] β yes the lowercase instance_name is on purpose, don't come for her π
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_clusters.ListDatabaseClusterModules (WARNING)>
take_action(parsed_args) β "Run command." Returns a tuple of the column names + an iterable with the data to list. π¦
class troveclient.osc.v1.database_clusters.ListDatabaseClusters(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columns = ['ID', 'Name', 'Datastore', 'Datastore Version', 'Task Name']
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_clusters.ListDatabaseClusters (WARNING)>
take_action(parsed_args) β "Run command." Tuple with column names + iterable of the data to be listed. π
class troveclient.osc.v1.database_clusters.ResetDatabaseClusterStatus(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_clusters.ResetDatabaseClusterStatus (WARNING)>
take_action(parsed_args) β "Override to do something useful." Returned value comes right back out of the program. π
class troveclient.osc.v1.database_clusters.ShowDatabaseCluster(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne β she shows you one thing, main character energy π
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_clusters.ShowDatabaseCluster (WARNING)>
take_action(parsed_args) β "Run command." Returns a tuple containing the column names and an iterable containing the data to be listed. (yes even the ShowOne one says that, we don't make the rules π« )
class troveclient.osc.v1.database_clusters.ShrinkDatabaseCluster(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_clusters.ShrinkDatabaseCluster (WARNING)>
take_action(parsed_args) β "Override to do something useful." Returned value = program's return value. π
class troveclient.osc.v1.database_clusters.UpgradeDatabaseCluster(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_clusters.UpgradeDatabaseCluster (WARNING)>
take_action(parsed_args) β "Override to do something useful." And the returned value gets returned by the program, we been knew. β¨
troveclient.osc.v1.database_clusters.set_attributes_for_print_detail(cluster)
That's a module-level function right there, take cluster as its arg. Lowkey just a helper, ok? π
π troveclient.osc.v1.database_configurations module
"Database v1 Configurations action implementations" β that's the official little subtitle, bestie, and we're keeping it exactly.
class troveclient.osc.v1.database_configurations.AttachDatabaseConfiguration(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.AttachDatabaseConfiguration (WARNING)>
take_action(parsed_args) β "Override to do something useful." The returned value is returned by the program. attach and slay π
class troveclient.osc.v1.database_configurations.CreateDatabaseConfiguration(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.CreateDatabaseConfiguration (WARNING)>
take_action(parsed_args) β "Run command." Returns a tuple containing the column names and an iterable containing the data to be listed. π
class troveclient.osc.v1.database_configurations.DefaultDatabaseConfiguration(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.DefaultDatabaseConfiguration (WARNING)>
take_action(parsed_args) β "Run command." Tuple of column names + iterable of data to be listed. β¨
class troveclient.osc.v1.database_configurations.DeleteDatabaseConfiguration(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.DeleteDatabaseConfiguration (WARNING)>
take_action(parsed_args) β "Override to do something useful." Returned value comes back out of the program, periodt. π
class troveclient.osc.v1.database_configurations.DetachDatabaseConfiguration(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.DetachDatabaseConfiguration (WARNING)>
take_action(parsed_args) β "Override to do something useful." The returned value is returned by the program. detach era π¦
class troveclient.osc.v1.database_configurations.ListDatabaseConfigurationInstances(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columns = ['ID', 'Name'] β short and sweet, we love a minimal queen πΈ
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.ListDatabaseConfigurationInstances (WARNING)>
take_action(parsed_args) β "Run command." Returns a tuple containing the column names and an iterable containing the data to be listed. π₯
class troveclient.osc.v1.database_configurations.ListDatabaseConfigurationParameters(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columns = ['Name', 'Type', 'Min Size', 'Max Size', 'Restart Required']
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.ListDatabaseConfigurationParameters (WARNING)>
take_action(parsed_args) β "Run command." Tuple with the column names + an iterable of the data to be listed. π«Ά
class troveclient.osc.v1.database_configurations.ListDatabaseConfigurations(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columns = ['ID', 'Name', 'Description', 'Datastore Name', 'Datastore Version Name', 'Datastore Version Number']
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.ListDatabaseConfigurations (WARNING)>
take_action(parsed_args) β "Run command." Returns a tuple containing the column names and an iterable containing the data to be listed. π
class troveclient.osc.v1.database_configurations.SetDatabaseConfiguration(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name) β returns an argparse.ArgumentParser.
log = <Logger troveclient.osc.v1.database_configurations.SetDatabaseConfiguration (WARNING)>
take_action(parsed_args) β "Override to do something useful." The returned value will be returned by the program. set it and forget it, bestie πβ¨
class troveclient.osc.v1.database_configurations.ShowDatabaseConfiguration(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne β okay so this one is the "show me ONE config" girly π
, and she's a ShowOne, meaning she shows exactly one thing, no chaotic list energy here.
get_parser(prog_name)β Return anargparse.ArgumentParser. That's it, that's the whole job β¨log = <Logger troveclient.osc.v1.database_configurations.ShowDatabaseConfiguration (WARNING)>β yes bestie, she has her own logger and it's sitting atWARNINGlevel, very demure
log = <Logger troveclient.osc.v1.database_configurations.ShowDatabaseConfiguration (WARNING)>
take_action(parsed_args)β Run command. Returns a tuple containing the column names and an iterable containing the data to be listed π
class troveclient.osc.v1.database_configurations.ShowDatabaseConfigurationParameter(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne π«Ά β same energy as her sister above, but she's here for one parameter specifically. Iconic specialization.
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_configurations.ShowDatabaseConfigurationParameter (WARNING)>:
log = <Logger troveclient.osc.v1.database_configurations.ShowDatabaseConfigurationParameter (WARNING)>
take_action(parsed_args)β Run command. Returns a tuple containing the column names and an iterable containing the data to be listed. no notes π
class troveclient.osc.v1.database_configurations.UpdateDatabaseConfiguration(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β the mutating one, she's not here to look, she's here to CHange things π (note the _app.App in her signature, keep that exactly, it's not a typo bestie, it's just how she's built).
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_configurations.UpdateDatabaseConfiguration (WARNING)>:
log = <Logger troveclient.osc.v1.database_configurations.UpdateDatabaseConfiguration (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program. (that's the docstring, fr fr, she's saying "yeah, subclass me and make me do something") π¦
troveclient.osc.v1.database_configurations.set_attributes_for_print_detail(configuration)
A whole standalone function, not even a method, just vibing on her own in the module πΈ. She takes configuration and does the print-detail attribute setting. periodt.
π§ troveclient.osc.v1.database_flavors module
Database v1 Flavors action implementations. (Yes, flavors β the size/shape girls. RAM, vCPUs, disk, the whole runway π.)
class troveclient.osc.v1.database_flavors.ListDatabaseFlavors(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister β she lists, that's her whole personality and she's GOOD at it π
columns = ['ID', 'Name', 'RAM', 'vCPUs', 'Disk', 'Ephemeral']β these are the columns, exactly these, in exactly this order, no cap:
columns = ['ID', 'Name', 'RAM', 'vCPUs', 'Disk', 'Ephemeral']
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_flavors.ListDatabaseFlavors (WARNING)>:
log = <Logger troveclient.osc.v1.database_flavors.ListDatabaseFlavors (WARNING)>
take_action(parsed_args)β Run command. Returns a tuple containing the column names and an iterable containing the data to be listed β¨
class troveclient.osc.v1.database_flavors.ShowDatabaseFlavor(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne β one flavor, shown, done. main character energy for a single flavor π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_flavors.ShowDatabaseFlavor (WARNING)>:
log = <Logger troveclient.osc.v1.database_flavors.ShowDatabaseFlavor (WARNING)>
take_action(parsed_args)β Run command. Returns a tuple containing the column names and an iterable containing the data to be listed.
troveclient.osc.v1.database_flavors.set_attributes_for_print_detail(flavor)
Another little standalone helper, this time she takes flavor π. Print-detail attribute setting, same as her config sister above.
π troveclient.osc.v1.database_instances module
Database v1 Instances action implementations β okay this is the BIG one, the whole main-character module, so many classes, get comfy π.
class troveclient.osc.v1.database_instances.CreateDatabaseInstance(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne β fun fact, she creates an instance but she's a ShowOne, that's just how it is, we don't question the family tree π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.CreateDatabaseInstance (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.CreateDatabaseInstance (WARNING)>
take_action(parsed_args)β Run command. Returns a tuple containing the column names and an iterable containing the data to be listed π₯
class troveclient.osc.v1.database_instances.DeleteDatabaseInstance(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: TroveDeleter β the deletion girlie π she inherits from TroveDeleter and honestly, goodbye instance, you had a good run.
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.DeleteDatabaseInstance (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.DeleteDatabaseInstance (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.DetachDatabaseInstanceReplica(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β detaching a replica, as one does π¦
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.DetachDatabaseInstanceReplica (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.DetachDatabaseInstanceReplica (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.EjectDatabaseInstanceReplicaSource(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β ejecting the replica source, very dramatic word choice, love that for her π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.EjectDatabaseInstanceReplicaSource (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.EjectDatabaseInstanceReplicaSource (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.ForceDeleteDatabaseInstance(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β the word Force is right there, bestie, she is not being gentle π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.ForceDeleteDatabaseInstance (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.ForceDeleteDatabaseInstance (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.ListDatabaseInstances(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister β and she has TWO column lists, because she contains multitudes π
admin_columns = ['ID', 'Name', 'Datastore', 'Datastore Version', 'Status', 'Operating Status', 'Public', 'Addresses', 'Flavor ID', 'Size', 'Role', 'Server ID', 'Tenant ID']β the admin view, extra columns, extra power:
admin_columns = ['ID', 'Name', 'Datastore', 'Datastore Version',
'Status', 'Operating Status', 'Public', 'Addresses', 'Flavor ID',
'Size', 'Role', 'Server ID', 'Tenant ID']
columns = ['ID', 'Name', 'Datastore', 'Datastore Version', 'Status', 'Operating Status', 'Public', 'Addresses', 'Flavor ID', 'Size', 'Role']β the regular view, still cute, just fewer columns:
columns = ['ID', 'Name', 'Datastore', 'Datastore Version',
'Status', 'Operating Status', 'Public', 'Addresses', 'Flavor ID',
'Size', 'Role']
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.ListDatabaseInstances (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.ListDatabaseInstances (WARNING)>
take_action(parsed_args)β Run command. Returns a tuple containing the column names and an iterable containing the data to be listed β¨
class troveclient.osc.v1.database_instances.PromoteDatabaseInstanceToReplicaSource(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β promoting someone to replica source, glow-up arc, we love to see it π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.PromoteDatabaseInstanceToReplicaSource (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.PromoteDatabaseInstanceToReplicaSource (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.RebootDatabaseInstance(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β have you tried turning it off and on again π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.RebootDatabaseInstance (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.RebootDatabaseInstance (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.RebuildDatabaseInstance(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β rebuild, not reboot, do NOT mix them up bestie, they are different girls π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.RebuildDatabaseInstance (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.RebuildDatabaseInstance (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.ResetDatabaseInstanceStatus(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β the "she's stuck in BUILD and I need her OUT" button, resetting that status π«Ά
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.ResetDatabaseInstanceStatus (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.ResetDatabaseInstanceStatus (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.ResizeDatabaseInstanceFlavor(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β changing the flavor, aka the database's whole silhouette π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.ResizeDatabaseInstanceFlavor (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.ResizeDatabaseInstanceFlavor (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.ResizeDatabaseInstanceVolume(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β same resize energy but for the volume, the storage girlie π
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.ResizeDatabaseInstanceVolume (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.ResizeDatabaseInstanceVolume (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.RestartDatabaseInstance(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command β restart, yet another sibling, this family is HUGE π§
get_parser(prog_name)β Return anargparse.ArgumentParser.log = <Logger troveclient.osc.v1.database_instances.RestartDatabaseInstance (WARNING)>:
log = <Logger troveclient.osc.v1.database_instances.RestartDatabaseInstance (WARNING)>
take_action(parsed_args)β Override to do something useful. The returned value will be returned by the program.
class troveclient.osc.v1.database_instances.ShowDatabaseInstance(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne β the one that shows you a single instance in all her glory β
get_parser(prog_name)β Return anargparse.ArgumentParser.
ShowDatabaseInstance β¨
Base vibe: Command (the base class, bestie)
logβ literally set tolog = <Logger troveclient.osc.v1.database_instances.ShowDatabaseInstance (WARNING)>π«Άtake_action(parsed_args)β runs the command. Returns a tuple: the column names, plus an iterable holding all the data that's getting listed. That's the whole deal π
UpdateDatabaseInstance π
class troveclient.osc.v1.database_instances.UpdateDatabaseInstance(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Command (again, yes)
get_parser(prog_name)β hands you back anargparse.ArgumentParser. That's it, that's the method β¨logβlog = <Logger troveclient.osc.v1.database_instances.UpdateDatabaseInstance (WARNING)>take_action(parsed_args)β the docs say: "Override to do something useful." Which is so funny honestly π Whatever you return from here is what the program spits back out.
UpgradeDatabaseInstance π¦
class troveclient.osc.v1.database_instances.UpgradeDatabaseInstance(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Command (the one and only)
get_parser(prog_name)β returns anargparse.ArgumentParserπΈlogβlog = <Logger troveclient.osc.v1.database_instances.UpgradeDatabaseInstance (WARNING)>take_action(parsed_args)β "Override to do something useful." The returned value gets returned by the program, periodt.
okay now some loose functions just vibing on their own in the module π§
troveclient.osc.v1.database_instances.get_instances_info(instances)β that's the whole signature, no notes πtroveclient.osc.v1.database_instances.set_attributes_for_print_detail(instance)β same deal, signature only β¨
troveclient.osc.v1.database_limits module π
Database v1 Limits action implementations (the limits, the ceiling, the whole quota energy)
ListDatabaseLimits π
class troveclient.osc.v1.database_limits.ListDatabaseLimits(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Lister (listing queen behavior)
columnsβcolumns = ['Value', 'Verb', 'Remaining', 'Unit']β those four, in that exact order, no cap πlogβlog = <Logger troveclient.osc.v1.database_limits.ListDatabaseLimits (WARNING)>take_action(parsed_args)β run command. Returns a tuple of column names + an iterable of the data getting listed π
troveclient.osc.v1.database_logs module π
ListDatabaseLogs β
class troveclient.osc.v1.database_logs.ListDatabaseLogs(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Lister
columnsβ okay the full roster:columns = ['Name', 'Type', 'Status', 'Published', 'Pending', 'Container', 'Prefix']β seven of them, iconic β¨get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_logs.ListDatabaseLogs (WARNING)>take_action(parsed_args)β run command, return the tuple of column names + iterable of data π
SaveDatabaseInstanceLog πΈ
class troveclient.osc.v1.database_logs.SaveDatabaseInstanceLog(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπ«Άlogβlog = <Logger troveclient.osc.v1.database_logs.SaveDatabaseInstanceLog (WARNING)>take_action(parsed_args)β "Override to do something useful." Whatever's returned is what the program returns, lowkey that simple.
SetDatabaseInstanceLog π¦
class troveclient.osc.v1.database_logs.SetDatabaseInstanceLog(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne (one thing at a time, main character energy)
get_parser(prog_name)β returns anargparse.ArgumentParserβ¨logβlog = <Logger troveclient.osc.v1.database_logs.SetDatabaseInstanceLog (WARNING)>take_action(parsed_args)β run command. Returns the column-names tuple plus an iterable of the data getting listed π
ShowDatabaseInstanceLog π
class troveclient.osc.v1.database_logs.ShowDatabaseInstanceLog(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_logs.ShowDatabaseInstanceLog (WARNING)>take_action(parsed_args)β run command. Tuple of column names + iterable of data, as always bestie π
ShowDatabaseInstanceLogContents π₯
class troveclient.osc.v1.database_logs.ShowDatabaseInstanceLogContents(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπΈlogβlog = <Logger troveclient.osc.v1.database_logs.ShowDatabaseInstanceLogContents (WARNING)>take_action(parsed_args)β "Override to do something useful." Returned value β returned by the program π«Ά
troveclient.osc.v1.database_quota module π
Database v1 Quota action implementations (quotas!!! the numbers!!! we love to see it)
ShowDatabaseQuota β
class troveclient.osc.v1.database_quota.ShowDatabaseQuota(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Lister
columnsβcolumns = ['Resource', 'In Use', 'Reserved', 'Limit']β exactly those four πget_parser(prog_name)β returns anargparse.ArgumentParserβ¨logβlog = <Logger troveclient.osc.v1.database_quota.ShowDatabaseQuota (WARNING)>take_action(parsed_args)β run command, return column names + iterable of data π
UpdateDatabaseQuota π·
class troveclient.osc.v1.database_quota.UpdateDatabaseQuota(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπ¦logβlog = <Logger troveclient.osc.v1.database_quota.UpdateDatabaseQuota (WARNING)>take_action(parsed_args)β run command. Tuple of column names + iterable of the data being listed π
troveclient.osc.v1.database_root module π
Database v1 Root action implementations (root access, the forbidden snack)
DisableDatabaseRoot π
class troveclient.osc.v1.database_root.DisableDatabaseRoot(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Command
get_parser(prog_name)β returns anargparse.ArgumentParserβ¨logβlog = <Logger troveclient.osc.v1.database_root.DisableDatabaseRoot (WARNING)>take_action(parsed_args)β "Override to do something useful." Return value gets returned by the program, fr fr.
EnableDatabaseRoot π±
class troveclient.osc.v1.database_root.EnableDatabaseRoot(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_root.EnableDatabaseRoot (WARNING)>take_action(parsed_args)β run command. Column names + iterable of data, standard slay π
ShowDatabaseRoot πΈ
class troveclient.osc.v1.database_root.ShowDatabaseRoot(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserβ¨logβlog = <Logger troveclient.osc.v1.database_root.ShowDatabaseRoot (WARNING)>take_action(parsed_args)β run command, returns the tuple of column names plus the iterable of data π«Ά
helper function moment π§
troveclient.osc.v1.database_root.find_instance_or_cluster(database_client_manager, instance_or_cluster)β returns an instance or a cluster, found either by ID or by name, along with the type of resource β so,instanceorcluster. If nothing gets found it raises aCommandError, no cap π«₯
troveclient.osc.v1.database_ssl module π
Database v1 SSL action implementations (secure the bag, literally)
DisableInstanceSSL π
class troveclient.osc.v1.database_ssl.DisableInstanceSSL(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_ssl.DisableInstanceSSL (WARNING)>take_action(parsed_args)β run command. Tuple of column names + iterable of data π
EnableInstanceSSL π¦
class troveclient.osc.v1.database_ssl.EnableInstanceSSL(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserβ¨logβlog = <Logger troveclient.osc.v1.database_ssl.EnableInstanceSSL (WARNING)>take_action(parsed_args)β run command, column names + iterable of data π«Ά
RollbackInstanceSSL πΈ
class troveclient.osc.v1.database_ssl.RollbackInstanceSSL(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_ssl.RollbackInstanceSSL (WARNING)>take_action(parsed_args)β run command. Returns the column-names tuple + iterable of listing data π
ShowInstanceSSL β
class troveclient.osc.v1.database_ssl.ShowInstanceSSL(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_ssl.ShowInstanceSSL (WARNING)>take_action(parsed_args)β run command, standard column-names-plus-iterable situation π
and one little helper π§
troveclient.osc.v1.database_ssl.set_attributes_for_print_detail(ssl)β that's the signature, that's the whole story β¨
troveclient.osc.v1.database_users module π«Ά
Database v1 Users action implementations (the people!!! the accounts!!! hiii)
CreateDatabaseUser π
class troveclient.osc.v1.database_users.CreateDatabaseUser(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Base vibe: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_users.CreateDatabaseUser (WARNING)>take_action(parsed_args)β "Override to do something useful." Whatever comes back out of here is what the program returns, periodt πget_parser(prog_name)β hands you back anargparse.ArgumentParser, that's literally the whole job β¨logβlog = <Logger troveclient.osc.v1.database_users.DeleteDatabaseUser (WARNING)>πtake_action(parsed_args)β "Override to do something useful." And the returned value is what the program hands back to you. That's it, that's the vibe π«Ά
troveclient.osc.v1.database_users.GrantDatabaseUserAccess
class troveclient.osc.v1.database_users.GrantDatabaseUserAccess(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParser, iconic behaviour honestly πΈlogβlog = <Logger troveclient.osc.v1.database_users.GrantDatabaseUserAccess (WARNING)>βtake_action(parsed_args)β "Override to do something useful." Whatever it returns is what the program returns, no cap π
troveclient.osc.v1.database_users.ListDatabaseUsers
class troveclient.osc.v1.database_users.ListDatabaseUsers(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columnsβcolumns = ['Name', 'Host', 'Databases']get_parser(prog_name)β yep, returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_users.ListDatabaseUsers (WARNING)>take_action(parsed_args)β "Run command." Returns a tuple with the column names plus an iterable holding all the data to be listed. The way that just works πβ¨
troveclient.osc.v1.database_users.RevokeDatabaseUserAccess
class troveclient.osc.v1.database_users.RevokeDatabaseUserAccess(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπ₯logβlog = <Logger troveclient.osc.v1.database_users.RevokeDatabaseUserAccess (WARNING)>take_action(parsed_args)β "Override to do something useful." The returned value is what the program returns, periodt π
troveclient.osc.v1.database_users.ShowDatabaseUser
class troveclient.osc.v1.database_users.ShowDatabaseUser(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπ¦logβlog = <Logger troveclient.osc.v1.database_users.ShowDatabaseUser (WARNING)>take_action(parsed_args)β "Run command." Gives you back a tuple of column names and an iterable of the data to be listed π
troveclient.osc.v1.database_users.ShowDatabaseUserAccess
class troveclient.osc.v1.database_users.ShowDatabaseUserAccess(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columnsβcolumns = ['Name']get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.database_users.ShowDatabaseUserAccess (WARNING)>take_action(parsed_args)β "Run command." Returns a tuple with the column names and an iterable of the data to be listed π
troveclient.osc.v1.database_users.UpdateDatabaseUserAttributes
class troveclient.osc.v1.database_users.UpdateDatabaseUserAttributes(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπ§logβlog = <Logger troveclient.osc.v1.database_users.UpdateDatabaseUserAttributes (WARNING)>take_action(parsed_args)β "Override to do something useful." The returned value gets returned by the program π
ποΈ troveclient.osc.v1.databases module
Database v1 Databases action implementations β putting the "database" in database, bestie π
troveclient.osc.v1.databases.CreateDatabase
class troveclient.osc.v1.databases.CreateDatabase(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserβ¨logβlog = <Logger troveclient.osc.v1.databases.CreateDatabase (WARNING)>take_action(parsed_args)β "Override to do something useful." Returned value = what the program returns π«Ά
troveclient.osc.v1.databases.DeleteDatabase
class troveclient.osc.v1.databases.DeleteDatabase(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπΈlogβlog = <Logger troveclient.osc.v1.databases.DeleteDatabase (WARNING)>take_action(parsed_args)β "Override to do something useful." And yeah, the returned value is returned by the program π
troveclient.osc.v1.databases.ListDatabases
class troveclient.osc.v1.databases.ListDatabases(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columnsβcolumns = ['Name']get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.databases.ListDatabases (WARNING)>take_action(parsed_args)β "Run command." Returns a tuple of column names plus an iterable of the data to be listed π
π§Ί troveclient.osc.v1.datastores module
Database v1 Datastores action implementations β this is where the datastore lore lives, iykyk π¦
troveclient.osc.v1.datastores.CreateDatastoreVersion
class troveclient.osc.v1.datastores.CreateDatastoreVersion(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserβlogβlog = <Logger troveclient.osc.v1.datastores.CreateDatastoreVersion (WARNING)>take_action(parsed_args)β "Override to do something useful." The returned value is returned by the program, fr fr π
troveclient.osc.v1.datastores.DeleteDatastore
class troveclient.osc.v1.datastores.DeleteDatastore(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπ₯logβlog = <Logger troveclient.osc.v1.datastores.DeleteDatastore (WARNING)>take_action(parsed_args)β "Override to do something useful." Returned value goes right back out of the program π
troveclient.osc.v1.datastores.DeleteDatastoreVersion
class troveclient.osc.v1.datastores.DeleteDatastoreVersion(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.datastores.DeleteDatastoreVersion (WARNING)>take_action(parsed_args)β "Override to do something useful." And the returned value? Returned by the program. Character development π
troveclient.osc.v1.datastores.ListDatastoreVersions
class troveclient.osc.v1.datastores.ListDatastoreVersions(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columnsβcolumns = ['ID', 'Name', 'Version']get_parser(prog_name)β returns anargparse.ArgumentParserπ§logβlog = <Logger troveclient.osc.v1.datastores.ListDatastoreVersions (WARNING)>take_action(parsed_args)β "Run command." Returns a tuple containing the column names and an iterable with the data to be listed π
troveclient.osc.v1.datastores.ListDatastores
class troveclient.osc.v1.datastores.ListDatastores(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Lister
columnsβcolumns = ['ID', 'Name']logβlog = <Logger troveclient.osc.v1.datastores.ListDatastores (WARNING)>take_action(parsed_args)β "Run command." Returns a tuple of column names plus an iterable of the data to be listed β¨
lowkey noticed this one has no get_parser(prog_name) listed? yeah, bestie, that's just how it's written here β don't come for me, I'm reporting the facts π
troveclient.osc.v1.datastores.ShowDatastore
class troveclient.osc.v1.datastores.ShowDatastore(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.datastores.ShowDatastore (WARNING)>take_action(parsed_args)β "Run command." Returns a tuple with the column names and an iterable of the data to be listed π«Ά
troveclient.osc.v1.datastores.ShowDatastoreVersion
class troveclient.osc.v1.datastores.ShowDatastoreVersion(app: App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: ShowOne
get_parser(prog_name)β returns anargparse.ArgumentParserπlogβlog = <Logger troveclient.osc.v1.datastores.ShowDatastoreVersion (WARNING)>take_action(parsed_args)β "Run command." Returns a tuple containing the column names and an iterable containing the data to be listed π
troveclient.osc.v1.datastores.UpdateDatastoreVersion
class troveclient.osc.v1.datastores.UpdateDatastoreVersion(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)
Bases: Command
get_parser(prog_name)β returns anargparse.ArgumentParserπ₯logβlog = <Logger troveclient.osc.v1.datastores.UpdateDatastoreVersion (WARNING)>take_action(parsed_args)β "Override to do something useful." The returned value is returned by the program, that's the whole contract π
module-level helper
troveclient.osc.v1.datastores.set_attributes_for_print_detail(datastore)β that's the signature, bestie, no extra description attached πΈ
π¦ Module contents
Submodules
π troveclient.osc.plugin module
troveclient.osc.plugin.build_option_parser(parser)β "Hook to add global options" β that's literally what it's for β¨troveclient.osc.plugin.make_client(instance)β "Returns a database service client" β cute, does exactly what it says on the tin π
Module contents
ποΈ troveclient.v1 package
Submodules
π³ troveclient.v1.accounts module
troveclient.v1.accounts.Account
class troveclient.v1.accounts.Account(manager, info, loaded=False)
Bases: Resource <#troveclient.base.Resource>
"Account is an opaque instance used to hold account information." Opaque, meaning don't peek behind the curtain, she's private π
troveclient.v1.accounts.Accounts
class troveclient.v1.accounts.Accounts(api)
Bases: ManagerWithFind <#troveclient.base.ManagerWithFind>
"Manage Account information." Main character energy fr fr π
resource_classβ alias ofAccountindex()β "Get a list of all accounts with non-deleted instances." Note the non-deleted part, bestie β deleted ones are not invited to the party π¦list()β that's it, it's justlist(), no description needed πshow(account)β "Get details of one account." Return type:Account.π
π§· troveclient.v1.backup_strategy module
troveclient.v1.backup_strategy.BackupStrategiesManager
class troveclient.v1.backup_strategy.BackupStrategiesManager(api)
Bases: ManagerWithFind <#troveclient.base.ManagerWithFind>
resource_classβ alias ofBackupStrategycreate(instance_id=None, swift_container=None)β signature is exactly as shown, no more, no less π«Άdelete(instance_id=None, project_id=None)β same deal, those two kwargs withNonedefaults πΈlist(instance_id=None, project_id=None)β yep, same keyword args, both defaulting toNoneβclass troveclient.v1.backup_strategy.BackupStrategy(manager, info, loaded=False)β bases:Resource. That's genuinely the whole thing, she's just standing there being a resource π
π troveclient.v1.backups module π
Backup πΈ
class troveclient.v1.backups.Backup(manager, info, loaded=False)
Bases: Resource.
Backup is a resource used to hold backup information. Literally her whole job, and she does it slayfully.
Backups π
class troveclient.v1.backups.Backups(api)
Bases: ManagerWithFind.
Manage Backups information. This is the manager bestie, the one you actually talk to.
backup_create_workflow='trove.backup_create'β class attribute, exact string, do not touch, do not "fix", periodt β¨create(name, instance, description=None, parent_id=None, incremental=False, storage_driver=None, swift_container=None, restore_from=None, restore_ds_version=None, restore_size=None)β Create or restore a new backup. Yes, both, same method, main character energy fr fr.- name β name for backup.
- instance β instance to backup.
- description β (optional).
- parent_id β base for incremental backup (optional).
- incremental β flag to indicate incremental backup based on last backup.
- storage_driver β The storage driver used to create the backup.
- swift_container β Swift container name.
- restore_from β The original backup data location, typically this is a Swift object URL.
- restore_ds_version β ID of the local datastore version corresponding to the original backup.
- restore_size β The original backup size.
Returns: Backups.
delete(backup)β Delete the specified backup.- backup β The backup to delete.
execution_delete(execution, mistral_client=None)β Remove a given schedule execution.- id β id of execution to remove. (and yes, the docs say
ideven though the argument is literally calledexecution, iykyk π not me pointing it out, but also me pointing it out)
- id β id of execution to remove. (and yes, the docs say
execution_list(schedule, mistral_client=None, marker='', limit=None)β Get a list of all executions of a scheduled backup.- schedule β schedule for which to list executions.
Return type: list of ScheduleExecution.
get(backup)β Get a specific backup.
Return type: Backups.
list(limit=None, marker=None, datastore=None, instance_id=None, all_projects=False, project_id=None)β Get a list of all backups. That's it, that's the whole description, she's lowkey mysterious π¦resource_classβ alias ofBackup.schedule_create(instance, pattern, name, description=None, incremental=None, mistral_client=None)β Create a new schedule to backup the given instance. Obsessed with her honestly.- instance β instance to backup.
- name β name for backup.
- description β (optional).
- incremental β flag for incremental backup (optional).
- pattern β cron pattern for schedule.
Returns: Backups.
schedule_delete(schedule, mistral_client=None)β Remove a given backup schedule.- schedule β schedule to delete.
schedule_list(instance, mistral_client=None)β Get a list of all backup schedules for an instance.- instance β instance for which to list schedules.
Return type: list of Schedule.
schedule_show(schedule, mistral_client=None)β Get details of a backup schedule.- schedule β schedule to show.
Return type: Schedule.
Schedule π
class troveclient.v1.backups.Schedule(manager, info, loaded=False)
Bases: Resource.
Schedule is a resource used to hold information about scheduled backups. She's the planner, she has a calendar, she's organized π
ScheduleExecution β
class troveclient.v1.backups.ScheduleExecution(manager, info, loaded=False)
Bases: Resource.
ScheduleExecution is a resource used to hold information about the execution of a scheduled backup. The moment the plan actually happens, iconic.
π¦ troveclient.v1.client module π¦
Client
class troveclient.v1.client.Client(username=None, password=None,
project_id=None, auth_url='', insecure=False, timeout=None,
tenant_id=None, proxy_tenant_id=None, proxy_token=None,
region_name=None, endpoint_type='publicURL', extensions=None,
service_type='database', service_name=None, database_service_name=None,
retries=None, http_log_debug=False, cacert=None, bypass_url=None,
auth_system='keystone', auth_plugin=None, session=None, auth=None,
**kwargs)
Bases: object.
Top-level object to access the OpenStack Database API. She's the final boss, the main character, the one you actually instantiate π
Create an instance with your creds:
>> client = Client(USERNAME,
PASSWORD,
project_id=TENANT_NAME,
auth_url=AUTH_URL)
Then call methods on its managers:
>> client.instances.list()
...
That's the whole vibe. You make her once, then you just vibe with her managers forever π«Ά
authenticate()β Authenticate against the server.
Normally this is called automatically when you first access the API, but you can call this method to force authentication right now, if you're the impatient type (same).
Returns on success; raises exceptions.Unauthorized if the credentials are wrong. So like, if you typed your password with caps lock on, that's on you π
get_database_api_version_from_endpoint()β that's it, that's the entry, no extra lore in the docs, she's just there, doing her thing quietly β¨
π troveclient.v1.clusters module π
Cluster π§
class troveclient.v1.clusters.Cluster(manager, info, loaded=False)
Bases: Resource.
A Cluster is an opaque cluster used to store Database clusters. Opaque! Mysterious! Doesn't owe you an explanation!
delete()β Delete the cluster.force_delete()β Force delete the cluster. Same energy, but with zero patience π₯
ClusterStatus π
class troveclient.v1.clusters.ClusterStatus
Bases: object.
The statuses, in order, no cap:
ACTIVE='ACTIVE'BUILD='BUILD'FAILED='FAILED'SHUTDOWN='SHUTDOWN'
That is the entire list, do not invent new ones, do not add a VIBING status, I checked π
Clusters π
class troveclient.v1.clusters.Clusters(api)
Bases: ManagerWithFind.
Manage Cluster resources.
add_shard(cluster)β Adds a shard to the specified cluster.- cluster β The cluster to add a shard to.
create(name, datastore, datastore_version, instances=None, locality=None, extended_properties=None, configuration=None)β Create (boot) a new cluster. Boot it, bestie π₯Ύdelete(cluster)β Delete the specified cluster.- cluster β The cluster to delete.
get(cluster)β Get a specific cluster.
Return type: Cluster.
grow(cluster, instances=None)β Grow a cluster.- cluster β The cluster to grow.
- instances β List of instances to add.
list(limit=None, marker=None)β Get a list of all clusters.
Return type: list of Cluster.
reset_status(cluster)β Reset the status of a cluster.- cluster β The cluster to reset.
resource_classβ alias ofCluster.shrink(cluster, instances=None)β Shrink a cluster.- cluster β The cluster to shrink.
- instances β List of instances to drop.
upgrade(cluster, datastore_version)β Upgrades a cluster to a new datastore version.- cluster β The cluster to upgrade.
- datastore_version β Datastore version to which to upgrade.
π troveclient.v1.configurations module π
Configuration π
class troveclient.v1.configurations.Configuration(manager, info, loaded=False)
Bases: Resource.
Configuration is a resource used to hold configuration information. She holds the settings, she holds the lore π
ConfigurationParameter πΈ
class troveclient.v1.configurations.ConfigurationParameter(manager, info,
loaded=False)
Bases: Resource.
Configuration Parameter. That's the entire description, she's concise and honestly? Respect.
ConfigurationParameters β¨
class troveclient.v1.configurations.ConfigurationParameters(api)
Bases: ManagerWithFind.
Manage ConfigurationParameters information.
get_parameter(datastore, version, key)β Get a list of valid parameters that can be changed.get_parameter_by_version(version, key)β Get a list of valid parameters that can be changed.list()β no description in the docs, she just exists, a mystery, a vibe π¦parameters(datastore, version)β Get a list of valid parameters that can be changed.parameters_by_version(version)β Get a list of valid parameters that can be changed.resource_classβ alias ofConfigurationParameter.
Yes, four of those have the exact same one-line description. That's what the docs say, so that's what you get, I am not out here editing the source, bestie π
Configurations π
class troveclient.v1.configurations.Configurations(api)
Bases: ManagerWithFind.
Manage Configurations information.
create(name, values, description=None, datastore=None, datastore_version=None, datastore_version_number=None)β Create a new configuration. Look at that, an actual description with words in it πdelete(configuration)β Delete the specified configuration.- configuration β The configuration id to delete.
edit(configuration, values)β Update an existing configuration.get(configuration)β Get a specific configuration.
Return type: Configurations.
instances(configuration, limit=None, marker=None)β Get a list of instances on a configuration.
Return type: Configurations.
list(limit=None, marker=None)β Get a list of all configurations.
Return type: list of Configurations.
resource_classβ alias ofConfiguration.update(configuration, values, name=None, description=None)β Update an existing configuration.
troveclient.v1.databases module
class troveclient.v1.databases.Database(manager, info, loaded=False)β Bases:Resource. Ngl this one is literally just the Wikipedia definition of a database, quoted in the docstring: "A database is a system intended to organize, store, and retrieve large amounts of data easily." πclass troveclient.v1.databases.Databases(api)β Bases:ManagerWithFind. This is the manager that managesDatabasesresources, bestie. πcreate(instance, databases)β creates new databases inside the instance you point at. New DBs, fresh out the box. β¨delete(instance, dbname)β deletes an existing database in the specified instance. bye bye bb πlist(instance, limit=None, marker=None)β gets a list of all theDatabasesfrom the instance. Return type: list ofDatabase. πresource_classβ alias ofDatabase.
troveclient.v1.datastores module
class troveclient.v1.datastores.Datastore(manager, info, loaded=False)β Bases:Resource. that's it, that's the whole vibe πclass troveclient.v1.datastores.DatastoreVersion(manager, info, loaded=False)β Bases:Resource.update(visibility=None)β changes something in a datastore version. lil glow-up πΈ
class troveclient.v1.datastores.DatastoreVersionMember(manager, info, loaded=False)β Bases:Resource.class troveclient.v1.datastores.DatastoreVersionMembers(api)β Bases:ManagerWithFind. ManagesDatastoreVersionMemberresources. π«Άadd(datastore, datastore_version, tenant)β adds a member to a datastore version.delete(datastore, datastore_version, member_id)β deletes a member from a datastore version.get(datastore, datastore_version, member_id)β gets a datastore version member.get_by_tenant(datastore, tenant, limit=None, marker=None)β lists members by tenant id.list(datastore, datastore_version, limit=None, marker=None)β lists members of a datastore version.resource_classβ alias ofDatastoreVersionMember.
class troveclient.v1.datastores.DatastoreVersions(api)β Bases:ManagerWithFind. ManagesDatastoreVersionresources. πget(datastore, datastore_version)β gets a specific datastore version. Return type:DatastoreVersion.get_by_uuid(datastore_version)β also gets a specific datastore version, but by uuid this time. Return type:DatastoreVersion. πlist(datastore, limit=None, marker=None)β gets a list of all datastore versions. Return type: list ofDatastoreVersion.resource_classβ alias ofDatastoreVersion.update(datastore, datastore_version, visibility)β updates a specific datastore version.
class troveclient.v1.datastores.Datastores(api)β Bases:ManagerWithFind. ManagesDatastoreresources. πdelete(datastore)β deletes a specific datastore.get(datastore)β gets a specific datastore. Return type:Datastore.list(limit=None, marker=None)β gets a list of all datastores. Return type: list ofDatastore.resource_classβ alias ofDatastore.
troveclient.v1.diagnostics module
class troveclient.v1.diagnostics.Diagnostics(manager, info, loaded=False)β Bases:Resource. Docstring says: "Account is an opaque instance used to hold account information." (yes, account β we don't question the icon, we just report it π).class troveclient.v1.diagnostics.DiagnosticsInterrogator(api)β Bases:ManagerWithFind. Manager class for the Interrogator resource. π΅οΈget(instance)β gets the diagnostics of the guest on the instance.list()β lists 'em. no args, no notes.resource_classβ alias ofDiagnostics.
class troveclient.v1.diagnostics.HwInfo(manager, info, loaded=False)β Bases:Resource.class troveclient.v1.diagnostics.HwInfoInterrogator(api)β Bases:ManagerWithFind. Manager class forHwInfo. π₯οΈget(instance)β gets the hardware information of the instance.list()β lists 'em.resource_classβ alias ofHwInfo.
troveclient.v1.flavors module
class troveclient.v1.flavors.Flavor(manager, info, loaded=False)β Bases:Resource. So aFlavoris an Instance type, and it specifies other things too, like RAM size. the way that a flavor is just a whole vibe spec πclass troveclient.v1.flavors.Flavors(api)β Bases:ManagerWithFind. ManagesFlavorresources. πget(flavor)β gets a specific flavor. Return type:Flavor.list()β gets a list of all flavors. :rtype: list ofFlavor.list_datastore_version_associated_flavors(datastore, version_id)β gets a list of all the flavors for the specified datastore type and datastore version. :rtype: list ofFlavor. πresource_classβ alias ofFlavor.
troveclient.v1.hosts module
class troveclient.v1.hosts.Host(manager, info, loaded=False)β Bases:Resource. "A Hosts is an opaque instance used to store Host instances." (grammar said what it said, we're keeping it π )class troveclient.v1.hosts.Hosts(api)β Bases:ManagerWithFind. ManagesHostresources. πget(host)β gets a specific host. Return type:host.index()β gets a list of all hosts. Return type: list ofHosts.list()β lists 'em.resource_classβ alias ofHost.update_all(host_id)β updates all instances on a host. all of 'em. at once. π₯
troveclient.v1.instances module
class troveclient.v1.instances.DatastoreLog(manager, info, loaded=False)β Bases:Resource. ADatastoreLogis a log on the database guest instance. πclass troveclient.v1.instances.Instance(manager, info, loaded=False)β Bases:Resource. AnInstanceis an opaque instance used to store Database instances. so meta of it. πdelete()β deletes the instance.detach_replica()β stops the replica database from being replicated to.force_delete()β force deletes the instance. no takebacks πlist_databases()β lists the databases.restart()β restarts the database instance. have you tried turning it off and on again β¨
class troveclient.v1.instances.InstanceStatusβ Bases:object. The status constants, all of them, in all their uppercase glory:ACTIVE = 'ACTIVE'BLOCKED = 'BLOCKED'BUILD = 'BUILD'EJECTING = 'EJECTING'FAILED = 'FAILED'LOGGING = 'LOGGING'PROMOTING = 'PROMOTING'REBOOT = 'REBOOT'RESIZE = 'RESIZE'RESTART_REQUIRED = 'RESTART_REQUIRED'SHUTDOWN = 'SHUTDOWN'
class troveclient.v1.instances.Instances(api)β Bases:ManagerWithFind. ManagesInstanceresources. this is the main character of the module, fr fr πbackups(instance, limit=None, marker=None)β gets the list of backups for a specific instance. Return type: list ofBackups.- instance β the instance for which to list backups.
- limit β max items to return.
- marker β marker start point.
configuration(instance)β gets a configuration on instances. Return type:Instance.create(...)β creates (boots) a brand new instance. The full signature, verbatim, because we do not cut corners:
create(name, flavor_id=None, volume=None, databases=None,
users=None, restorePoint=None, availability_zone=None,
datastore=None, datastore_version=None, nics=None,
configuration=None, replica_of=None, replica_count=None,
modules=None, locality=None, region_name=None, access=None,
datastore_version_number=None, **kwargs)
delete(instance)β deletes the specified instance. instance β a reference to the instance to delete.eject_replica_source(instance)β ejects a replica source from its set. instance β theInstance(or its ID) of the database instance to eject. πforce_delete(instance)β force deletes the specified instance. instance β a reference to the instance to force delete.get(instance)β gets a specific instances. Return type:Instance.list(limit=None, marker=None, include_clustered=False, detailed=False)β gets a list of all instances. Return type: list ofInstance. πlog_action(instance, log_name, enable=None, disable=None, publish=None, discard=None)β performs an action on the guest log. Return type: list ofDatastoreLog.- instance β the
Instance(or its ID) of the database instance to get the log for. - log_name β the name of
<log>to publish. - enable β turn on
<log>. - disable β turn off
<log>. - publish β publish log to associated container.
- discard β delete the associated container.
- instance β the
log_generator(instance, log_name, lines=50, swift=None)β returns a generator that yields the last<lines>lines of the guest log. π§- instance β the
Instance(or its ID) of the database instance to get the log for. - log_name β the name of
<log>to publish. - lines β display last
<lines>lines of log (0for all lines).
- instance β the
swiftβ Connection to swift
Return type: generator function to yield log as chunks. (yes bestie, it yields, it doesn't dump everything at once π )
log_list(instance)β Get a list of all guest logs.
Parameters: instance β The Instance (or its ID) of the database instance to get the log for. Return type: list of DatastoreLog.
log_save(instance, log_name, filename=None)β Saves a guest log to a file. π
Parameters:
instanceβ The Instance (or its ID) of the database instance to get the log for.log_nameβ The name of<log>to publish
Return type: Filename to which log was saved.
log_show(instance, log_name)β the manpage gives this one literally zero blurb, so here's the signature and that's it β¨modify(instance, configuration=None)β This method is deprecated, useupdateinstead. (fr fr, don't use this one, it's giving legacy code π)module_apply(instance, modules)β Apply modules to an instance.module_query(instance)β Query an instance about installed modules.module_remove(instance, module)β Remove a module from an instance.module_retrieve(instance, directory=None, prefix=None)β Retrieve the module data file from an instance. This includes the contents of the module data file. π¦modules(instance)β Get the list of modules for a specific instance.promote_to_replica_source(instance)β Promote a replica to be the newreplica_sourceof its set π
Parameters: instance β The Instance (or its ID) of the database instance to promote.
reset_status(instance)β Reset the status of an instance.
Parameters: instance β A reference to the instance
resize_instance(instance, flavor_id)β Resizes an instance with a new flavor.resize_volume(instance, volume_size)β Resize the volume on an existing instances.resource_classβ alias ofInstancerestart(instance)β Restart the database instance.
Parameters: instance β The Instance (or its ID) of the database instance to restart.
ssl_disable(instance)β signature only, no blurb in the source πssl_enable(instance, mode, container_ref, password_ref=None)β signature only, no blurb in the source πssl_rollback(instance)β signature only, no blurb in the source πssl_show(instance, include_certificate=False)β signature only, no blurb in the source πupdate(instance, configuration=None, name=None, detach_replica_source=False, remove_configuration=False, is_public=None, allowed_cidrs=None)β Update instance. β οΈ The configuration change, detach_replica and access change cannot be updated at the same time. (pick a lane bestie, one at a time π )upgrade(instance, datastore_version)β Upgrades an instance with a new datastore version.
πΈ troveclient.v1.limits module πΈ
class troveclient.v1.limits.Limit(manager, info, loaded=False) β Bases: Resource
class troveclient.v1.limits.Limits(api) β Bases: ManagerWithFind. Manages Limit resources.
list()β Retrieve the limits.resource_classβ alias ofLimit
π troveclient.v1.management module π
class troveclient.v1.management.Management(api) β Bases: ManagerWithFind. Manage Instances resources.
index(**kwargs)β A wrapper forlistmethod.list(limit=None, marker=None, deleted=False, **kwargs)β Get all the database instances.migrate(instance_id, host=None)β Migrate the instance.
Parameters: instance_id β The Instance (or its ID) to share onto.
reboot(instance_id)β Reboot the underlying OS.
Parameters: instance_id β The Instance (or its ID) to share onto.
rebuild(instance_id, image_id)β Rebuild the underlying OS.reset_task_status(instance_id)β Set the task status toNONE.resource_classβ alias ofInstanceroot_enabled_history(instance)β Get root access history of one instance.show(instance)β Get details of one instance. Return type:Instance.stop(instance_id)β signature only, no blurb in the source π«Άupdate(instance_id)β Update the guest agent viaapt-get.
class troveclient.v1.management.MgmtClusters(api) β Bases: ManagerWithFind. Manage Cluster resources.
index(deleted=None, limit=None, marker=None)β Show an overview of all local clusters. Optionally, filter by deleted status. Return type: list ofCluster.list()β signature only, no blurb in the source π«Άreset_task(cluster_id)β Reset the current cluster task toNONE.resource_classβ alias ofClustershow(cluster)β Get details of one cluster.
class troveclient.v1.management.MgmtConfigurationParameters(api) β Bases: ConfigurationParameters
create(version, name, restart_required, data_type, max_size=None, min_size=None)β Mgmt call to create a new configuration parameter.delete(version, name)β Mgmt call to delete a configuration parameter.get_any_parameter_by_version(version, key)β Get any configuration parameter, deleted or not.list_all_parameter_by_version(version)β List all configuration parameters, deleted or not.modify(version, name, restart_required, data_type, max_size=None, min_size=None)β Mgmt call to modify an existing configuration parameter.
class troveclient.v1.management.MgmtDatastoreVersions(api) β Bases: ManagerWithFind. Manage DatastoreVersion resources.
create(name, datastore_name, datastore_manager, image, packages=None, registry_ext=None, repl_strategy=None, active='true', default='false', image_tags=[], version=None)β Create a new datastore version. πdelete(datastore_version_id)β Delete a datastore version.edit(datastore_version_id, datastore_manager=None, image=None, packages=None, registry_ext=None, repl_strategy=None, active=None, default=None, image_tags=None, name=None)β Update a datastore-version.get(datastore_version_id)β Get details of a datastore version.list(limit=None, marker=None)β List all datastore versions.resource_classβ alias ofDatastoreVersion
class troveclient.v1.management.MgmtFlavors(api) β Bases: ManagerWithFind. Manage Flavor resources.
create(name, ram, disk, vcpus, flavorid='auto', ephemeral=None, swap=None, rxtx_factor=None, service_type=None)β Create a new flavor. β¨list()β signature only, no blurb in the source π«Άresource_classβ alias ofFlavor
class troveclient.v1.management.RootHistory(manager, info, loaded=False) β Bases: Resource
π¦ troveclient.v1.metadata module π¦
class troveclient.v1.metadata.Metadata(api) β Bases: Manager
create(instance_id, key, value)β create it, bestiedelete(instance_id, key)β gone, periodtedit(instance_id, key, value)β tweak itlist(instance_id)β gimme the listresource_classβ alias ofMetadataResourceshow(instance_id, key)β show it offupdate(instance_id, key, newkey, value)β full glow-up with a new key
class troveclient.v1.metadata.MetadataResource(manager, info, loaded=False) β Bases: Resource
π§ troveclient.v1.modules module π§
class troveclient.v1.modules.Module(manager, info, loaded=False) β Bases: Resource. ALL_KEYWORD = 'all'
class troveclient.v1.modules.Modules(api) β Bases: ManagerWithFind. Manage Module resources.
create(name, module_type, contents, description=None, all_tenants=None, datastore=None, datastore_version=None, auto_apply=None, visible=None, live_update=None, priority_apply=None, apply_order=None, full_access=None)β Create a new module.delete(module)β Delete the specified module.get(module)β Get a specific module.instances(module, limit=None, marker=None, include_clustered=False, count_only=False)β Get a list of all instances this module has been applied to.list(limit=None, marker=None, datastore=None)β Get a list of all modules.reapply(module, md5=None, include_clustered=None, batch_size=None, delay=None, force=None)β Reapplies the specified module.resource_classβ alias ofModuleupdate(module, name=None, module_type=None, contents=None, description=None, all_tenants=None, datastore=None, datastore_version=None, auto_apply=None, visible=None, live_update=None, all_datastores=None, all_datastore_versions=None, priority_apply=None, apply_order=None, full_access=None)β Update an existing module. β οΈ Passing indatastore=Noneordatastore_version=Nonehas the effect of making it available for all datastores/versions.
π troveclient.v1.quota module π
class troveclient.v1.quota.Quotas(api) β Bases: ManagerWithFind. Manage Quota information.
list()β signature only, no blurb in the source π«Άresource_classβ alias ofResourceshow(tenant_id)β Get a list of all quotas for a tenant id.update(id, quotas)β Set limits for quotas.
π troveclient.v1.root module π
class troveclient.v1.root.Root(api)β bestie, this is the manager class for the Root resource β¨ (it inherits fromManagerWithFind, iykyk)clusters_url = '/clusters/%s/root'β yes the URL template is literally that, keep it exactly πcreate(instance)β implements the root-enable API π enable the root user and hand you back the root password for the specified db instance π₯create_cluster_root(cluster, root_password=None)β root-enable, but make it clusters π¦ note thatroot_passworddefaults toNonecreate_instance_root(instance, root_password=None)β same energy, but for instances πroot_passworddefaults toNonehere toodelete(instance)β implements the root-disable API π disables access to the root user for the specified db instance.:param instance:the instance on which the root user is enableddisable_instance_root(instance)β root-disable, instance edition βinstances_url = '/instances/%s/root'β the other URL template, also exact πΈis_cluster_root_enabled(cluster)β returns whether root is enabled for the cluster πis_instance_root_enabled(instance)β returns whether root is enabled for the instance πis_root_enabled(instance)β return whether root is enabled for the instance, yes it's the classic one πlist()β lists stuff, that's the whole vibe π«Άresource_classβ alias ofUserπ§
π troveclient.v1.security_groups module π
class troveclient.v1.security_groups.SecurityGroup(manager, info, loaded=False)β bases:Resourceπ a Security Group is a resource used to hold security group information, no capclass troveclient.v1.security_groups.SecurityGroupRule(manager, info, loaded=False)β bases:Resourceβ¨ this resource is used to hold security group rule informationclass troveclient.v1.security_groups.SecurityGroupRules(api)β bases:ManagerWithFindπ manageSecurityGroupRulesresources, that's her jobcreate(group_id, cidr)β create a new security group rule πdelete(security_group_rule)β delete the specified security group rule. Parameters:security_group_rule-- the security group rule to delete ποΈlist()β lists them π¦resource_classβ alias ofSecurityGroupRuleπ
class troveclient.v1.security_groups.SecurityGroups(api)β bases:ManagerWithFindπΈ manageSecurityGroupresourcesget(security_group)β get a specific security group. Return type:SecurityGroupπlist(limit=None, marker=None)β get a list of all security groups. Return type:list of SecurityGroup.β (limitandmarkerboth default toNone, fyi)resource_classβ alias ofSecurityGroupπ
π troveclient.v1.shell module π
okay this one is long, but every single one of these little do_ functions is a real one and we're not skipping a single crumb π
troveclient.v1.shell.do_backup_create(cs, args)β creates a backup of an instance πΎtroveclient.v1.shell.do_backup_delete(cs, args)β deletes a backup ποΈtroveclient.v1.shell.do_backup_list(cs, args)β lists available backups πtroveclient.v1.shell.do_backup_list_instance(cs, args)β lists available backups for an instance πtroveclient.v1.shell.do_backup_show(cs, args)β shows details of a backup β¨troveclient.v1.shell.do_cluster_create(cs, args)β creates a new cluster πtroveclient.v1.shell.do_cluster_delete(cs, args)β delete specified cluster(s) ποΈtroveclient.v1.shell.do_cluster_force_delete(cs, args)β force delete a cluster πtroveclient.v1.shell.do_cluster_grow(cs, args)β adds more instances to a cluster π±troveclient.v1.shell.do_cluster_instances(cs, args)β lists all instances of a cluster πtroveclient.v1.shell.do_cluster_list(cs, args)β lists all the clusters πtroveclient.v1.shell.do_cluster_modules(cs, args)β lists all modules for each instance of a cluster π§©troveclient.v1.shell.do_cluster_reset_status(cs, args)β set the cluster task toNONEπtroveclient.v1.shell.do_cluster_show(cs, args)β shows details of a cluster β¨troveclient.v1.shell.do_cluster_shrink(cs, args)β drops instances from a cluster πtroveclient.v1.shell.do_cluster_upgrade(cs, args)β upgrades a cluster to a new datastore version β¬οΈtroveclient.v1.shell.do_configuration_attach(cs, args)β attaches a configuration group to an instance πtroveclient.v1.shell.do_configuration_create(cs, args)β creates a configuration group πtroveclient.v1.shell.do_configuration_default(cs, args)β shows the default configuration of an instance πtroveclient.v1.shell.do_configuration_delete(cs, args)β deletes a configuration group ποΈtroveclient.v1.shell.do_configuration_detach(cs, args)β detaches a configuration group from an instance βοΈtroveclient.v1.shell.do_configuration_instances(cs, args)β lists all instances associated with a configuration group πtroveclient.v1.shell.do_configuration_list(cs, args)β lists all configuration groups πΈtroveclient.v1.shell.do_configuration_parameter_list(cs, args)β lists available parameters for a configuration group πtroveclient.v1.shell.do_configuration_parameter_show(cs, args)β shows details of a configuration parameter πtroveclient.v1.shell.do_configuration_patch(cs, args)β patches a configuration group π©Ήtroveclient.v1.shell.do_configuration_show(cs, args)β shows details of a configuration group β¨troveclient.v1.shell.do_configuration_update(cs, args)β updates a configuration group πtroveclient.v1.shell.do_create(cs, args)β creates a new instance πtroveclient.v1.shell.do_database_create(cs, args)β creates a database on an instance ποΈtroveclient.v1.shell.do_database_delete(cs, args)β deletes a database from an instance ποΈtroveclient.v1.shell.do_database_list(cs, args)β lists available databases on an instance πtroveclient.v1.shell.do_datastore_list(cs, args)β lists available datastores ποΈtroveclient.v1.shell.do_datastore_show(cs, args)β shows details of a datastore πtroveclient.v1.shell.do_datastore_version_list(cs, args)β lists available versions for a datastore πtroveclient.v1.shell.do_datastore_version_show(cs, args)β shows details of a datastore version β¨troveclient.v1.shell.do_delete(cs, args)β delete specified instance(s) πtroveclient.v1.shell.do_detach_replica(cs, args)β detaches a replica instance from its replication source βοΈtroveclient.v1.shell.do_eject_replica_source(cs, args)β ejects a replica source from its set πtroveclient.v1.shell.do_execution_delete(cs, args)β deletes an execution ποΈtroveclient.v1.shell.do_execution_list(cs, args)β lists executions of a scheduled backup of an instance πtroveclient.v1.shell.do_flavor_list(cs, args)β lists available flavors π¦troveclient.v1.shell.do_flavor_show(cs, args)β shows details of a flavor πtroveclient.v1.shell.do_force_delete(cs, args)β force delete an instance πtroveclient.v1.shell.do_limit_list(cs, args)β lists the limits for a tenant πtroveclient.v1.shell.do_list(cs, args)β lists all the instances πtroveclient.v1.shell.do_log_disable(cs, args)β instructs Trove guest to stop collecting log details πtroveclient.v1.shell.do_log_discard(cs, args)β instructs Trove guest to discard the container of the published log ποΈtroveclient.v1.shell.do_log_enable(cs, args)β instructs Trove guest to start collecting log details βΆοΈtroveclient.v1.shell.do_log_list(cs, args)β lists the log files available for instance πtroveclient.v1.shell.do_log_publish(cs, args)β instructs Trove guest to publish latest log entries on instance π€troveclient.v1.shell.do_log_save(cs, args)β save log file for instance πΎtroveclient.v1.shell.do_log_show(cs, args)β instructs Trove guest to show details of log πtroveclient.v1.shell.do_log_tail(cs, args)β display log entries for instance πtroveclient.v1.shell.do_metadata_create(cs, args)β creates metadata in the database for instance<id>π·οΈtroveclient.v1.shell.do_metadata_delete(cs, args)β deletes metadata for instance<id>ποΈtroveclient.v1.shell.do_metadata_edit(cs, args)β replaces metadata value with a new one, this is non-destructive π«Άtroveclient.v1.shell.do_metadata_list(cs, args)β shows all metadata for instance<id>πtroveclient.v1.shell.do_metadata_show(cs, args)β shows metadata entry for key<key>and instance<id>πtroveclient.v1.shell.do_metadata_update(cs, args)β updates metadata, this is destructive π (fr fr, be careful)troveclient.v1.shell.do_module_apply(cs, args)β apply modules to an instance π§©troveclient.v1.shell.do_module_create(cs, args)β create a module πtroveclient.v1.shell.do_module_delete(cs, args)β delete a module ποΈtroveclient.v1.shell.do_module_instance_count(cs, args)β lists a count of the instances for each module md5 π’troveclient.v1.shell.do_module_instances(cs, args)β lists the instances that have a particular module applied πtroveclient.v1.shell.do_module_list(cs, args)β lists the modules available πΈtroveclient.v1.shell.do_module_list_instance(cs, args)β lists the modules that have been applied to an instance π§©troveclient.v1.shell.do_module_query(cs, args)β query the status of the modules on an instance βtroveclient.v1.shell.do_module_reapply(cs, args)β reapply a module πtroveclient.v1.shell.do_module_remove(cs, args)β remove a module from an instance βοΈtroveclient.v1.shell.do_module_retrieve(cs, args)β retrieve module contents from an instance π₯troveclient.v1.shell.do_module_show(cs, args)β shows details of a module β¨troveclient.v1.shell.do_module_update(cs, args)β update a module πtroveclient.v1.shell.do_promote_to_replica_source(cs, args)β promotes a replica to be the new replica source of its set πtroveclient.v1.shell.do_quota_show(cs, args)β show quotas for a tenant πtroveclient.v1.shell.do_quota_update(cs, args)β update quotas for a tenant πtroveclient.v1.shell.do_reset_status(cs, args)β set the task status of an instance toNONEif the instance is inBUILDorERRORstate. Resetting task status of an instance inBUILDstate will allow the instance to be deleted π₯ (yes that's the actual behaviour, no cap)troveclient.v1.shell.do_resize_instance(cs, args)β resizes an instance with a new flavor π like a glow-up but for computetroveclient.v1.shell.do_resize_volume(cs, args)β resizes the volume size of an instance, giving it more room to breathetroveclient.v1.shell.do_restart(cs, args)β restarts an instance, the eternal "have you tried turning it off and on again" energytroveclient.v1.shell.do_root_disable(cs, args)β disables root for an instance, closing the door behind you πͺtroveclient.v1.shell.do_root_enable(cs, args)β enables root for an instance and resets if it already exists, no captroveclient.v1.shell.do_root_show(cs, args)β gets status if root was ever enabled for an instance or cluster πtroveclient.v1.shell.do_schedule_create(cs, args)β schedules backups for an instance, future-you says thank you π«Άtroveclient.v1.shell.do_schedule_delete(cs, args)β deletes a schedule, bye bestietroveclient.v1.shell.do_schedule_list(cs, args)β lists scheduled backups for an instance πtroveclient.v1.shell.do_schedule_show(cs, args)β shows details of a schedule, the receiptstroveclient.v1.shell.do_secgroup_add_rule(cs, args)β creates a security group rule πtroveclient.v1.shell.do_secgroup_delete_rule(cs, args)β deletes a security group ruletroveclient.v1.shell.do_secgroup_list(cs, args)β lists all security groupstroveclient.v1.shell.do_secgroup_list_rules(cs, args)β lists all rules for a security grouptroveclient.v1.shell.do_secgroup_show(cs, args)β shows details of a security grouptroveclient.v1.shell.do_show(cs, args)β shows details of an instance πtroveclient.v1.shell.do_update(cs, args)β updates an instance: edits name, configuration, or replica source β¨troveclient.v1.shell.do_upgrade(cs, args)β upgrades an instance to a new datastore version, level up behavior frtroveclient.v1.shell.do_user_create(cs, args)β creates a user on an instancetroveclient.v1.shell.do_user_delete(cs, args)β deletes a user from an instancetroveclient.v1.shell.do_user_grant_access(cs, args)β grants access to a database(s) for a user ποΈtroveclient.v1.shell.do_user_list(cs, args)β lists the users for an instancetroveclient.v1.shell.do_user_revoke_access(cs, args)β revokes access to a database for a user, access denied eratroveclient.v1.shell.do_user_show(cs, args)β shows details of a user of an instancetroveclient.v1.shell.do_user_show_access(cs, args)β shows access details of a user of an instancetroveclient.v1.shell.do_user_update_attributes(cs, args)β updates a user's attributes on an instance. at least one optional argument must be provided, that part is not optional bestie πtroveclient.v1.shell.do_volume_type_list(cs, args)β lists available volume typestroveclient.v1.shell.do_volume_type_show(cs, args)β shows details of a volume type
troveclient.v1.storage module
class troveclient.v1.storage.Device(manager, info, loaded=False)- Bases:
Resource<#troveclient.base.Resource> - Storage is an opaque instance used to hold storage information β it's giving mystery box π
- Bases:
class troveclient.v1.storage.StorageInfo(api)- Bases:
ManagerWithFind<#troveclient.base.ManagerWithFind> - Manage Storage resources.
index()β get a list of all storages. Return type: list of Storages.list()β the lister, doing exactly what it says on the tinresource_classβ alias ofDevice
- Bases:
troveclient.v1.users module
class troveclient.v1.users.User(manager, info, loaded=False)- Bases:
Resource<#troveclient.base.Resource> - A database user π§βπ»
- Bases:
class troveclient.v1.users.Users(api)- Bases:
ManagerWithFind<#troveclient.base.ManagerWithFind> - Manage Users resources.
change_passwords(instance, users)β change the password for one or more users πcreate(instance, users)β create users with permissions to the specified databasesdelete(instance, username, hostname=None)β delete an existing user in the specified instanceget(instance, username, hostname=None)β get a single User from the instance's Database. Return type: User.grant(instance, username, databases, hostname=None)β allow an existing user permissions to access a databaselist(instance, limit=None, marker=None)β get a list of all Users from the instance's Database. Return type: list of User.list_access(instance, username, hostname=None)β show all databases the given user has access toresource_classβ alias ofUserrevoke(instance, username, database, hostname=None)β revoke from an existing user access permissions to a database π«update_attributes(instance, username, newuserattr=None, hostname=None)β update attributes of a single User in an instance. Return type: User.
- Bases:
troveclient.v1.volume_types module
class troveclient.v1.volume_types.VolumeType(manager, info, loaded=False)- Bases:
Resource<#troveclient.base.Resource> - A VolumeType is an Cinder volume type πΎ
- Bases:
class troveclient.v1.volume_types.VolumeTypes(api)- Bases:
ManagerWithFind<#troveclient.base.ManagerWithFind> - Manage VolumeType resources.
get(volume_type)β get a specific volume-type. Return type: VolumeTypelist()β get a list of all volume-types. :rtype: list of VolumeType.list_datastore_version_associated_volume_types(datastore, version_id)β get a list of all volume-types for the specified datastore type and datastore version . :rtype: list of VolumeType.resource_classβ alias ofVolumeType
- Bases:
Module contents
Submodules
troveclient.auth_plugin module
class troveclient.auth_plugin.BaseAuthPlugin- Bases:
object - Base class for authentication plugins. An authentication plugin needs to override at least the
authenticatemethod to be a valid plugin β¨ static add_opts(parser)β populate and return the parser with the options for this plugin. If the plugin does not need any options, it should return the same parser untouched.authenticate(cls, auth_url)β authenticate using plugin defined method.get_auth_url()β return the auth url for the plugin (if any).parse_opts(args)β parse the actual auth-system options if any. This method is expected to populate the attributeself.optswith a dict containing the options and values needed to make authentication. If the dict is empty, the client should assume that it needs the same options as the'keystone'auth system (i.e.os_usernameandos_password). Returns theself.optsdict.
- Bases:
troveclient.auth_plugin.discover_auth_systems()β discover the available auth-systems. This won't take into account the old style auth-systems, sorry old style π«troveclient.auth_plugin.load_auth_system_opts(parser)β load options needed by the available auth-systems into a parser. This function will try to populate the parser with options from the available plugins.troveclient.auth_plugin.load_plugin(auth_system)β loads the plugin, that's the whole vibe
troveclient.base module
Base utilities to build API operation managers and objects on top of π§±
class troveclient.base.Manager(api)- Bases:
HookableMixin<#troveclient.utils.HookableMixin> - Manager defining CRUD operations for API. Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.
completion_cache(cache_type, obj_class, mode)β bash-completion cache. The completion cache store items that can be used for bash autocompletion, like UUIDs or human-friendly IDs. A resource listing will clear and repopulate the cache. A resource create will append to the cache. Delete is not handled because listings are assumed to be performed often enough to keep the cache reasonably up-to-date. (yes, that's intentional, don't come for them π)resource_class = Nonewrite_to_completion_cache(cache_type, val)β writes to the completion cache, obviously
- Bases:
class troveclient.base.ManagerWithFind(api)- Bases:
Manager - Like a Manager, but with additional
find()/findall()methods π find(**kwargs)β find a single item with attributes matching**kwargs. This isn't very efficient: it loads the entire list then filters on the Python side.findall(**kwargs)β find all items with attributes matching**kwargs. This isn't very efficient: it loads the entire list then filters on the Python side.abstractmethod list()β abstract, so you gotta implement it yourself bestie
- Bases:
class troveclient.base.Resource(manager, info, loaded=False)- Bases:
Resource<#troveclient.apiclient.base.Resource> - A resource represents a particular instance of an object like server. This is pretty much just a bag for attributes.
:param manager:Manager object:param info:dictionary representing resource attributes:param loaded:prevent lazy-loading if set to True HUMAN_ID = False
- Bases:
troveclient.base.getid(obj)β retrieves an id from object or integer. Abstracts the common pattern of allowing both an object or an object's ID as a parameter when dealing with relationships πͺͺ
troveclient.client module
OpenStack Client interface. Handles the REST calls and responses π₯
troveclient.client.Client(version, *args, **kwargs)β the client constructor, no notesclass troveclient.client.HTTPClient(...)
class troveclient.client.HTTPClient(user, password, projectid, auth_url,
insecure=False, timeout=None, tenant_id=None, proxy_tenant_id=None,
proxy_token=None, region_name=None, endpoint_type='publicURL',
service_type=None, service_name=None, database_service_name=None,
retries=None, http_log_debug=False, cacert=None, bypass_url=None,
auth_system='keystone', auth_plugin=None)
- Bases:
TroveClientMixin USER_AGENT = 'python-troveclient'β that's the whole identity, periodtauthenticate()β authenticates, you know the drilldelete(url, **kwargs)β DELETE requestget(url, **kwargs)β GET requesthttp_log_req(args, kwargs)β logs the request when debug logging is onhttp_log_resp(resp)β logs the response when debug logging is onpatch(url, **kwargs)β PATCH requestpost(url, **kwargs)β POST requestput(url, **kwargs)β PUT requestrequest(url, method, **kwargs)β the request dispatcher doing the actual work behind all of those π«Ά
class troveclient.client.SessionClient(session, auth, **kwargs)β Bases:LegacyJsonAdapter,TroveClientMixinβ¨request(url, method, **kwargs)β the request method, signature and all, no extra lore here.
class troveclient.client.TroveClientMixinβ Bases:objectπ«Άget_database_api_version_from_endpoint()β gets the database API version from the endpoint, bestie.
troveclient.client.get_version_map()β returns the version map. Thatβs the whole vibe of this one.
πΈ troveclient.common module
class troveclient.common.Paginated(items=None, next_marker=None, links=None)β Bases:listπtroveclient.common.append_query_strings(url, **query_strings)β appends query strings to the URL, as advertised.troveclient.common.check_for_exceptions(resp, body, url)β checks for exceptions. Yes, thatβs literally the name and the whole note.troveclient.common.quote_user_host(user, host)β quotes user and host. Short and iconic.
π
troveclient.exceptions module
Exception definitions. Periodt.
exception troveclient.exceptions.GuestLogNotFoundErrorβ Bases:Exception- The specified guest log does not exist. π
exception troveclient.exceptions.NoTokenLookupExceptionβ Bases:Exception- This form of authentication does not support looking up endpoints from an existing token.
exception troveclient.exceptions.ResponseFormatErrorβ Bases:Exception- Could not parse the response format. π
π¦ troveclient.extension module
class troveclient.extension.Extension(name, module)β Bases:HookableMixin <#troveclient.utils.HookableMixin>π- Extension descriptor. Thatβs the official vibe.
SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')β exact tuple, no cap.
π troveclient.i18n module
oslo.i18n integration module.
See <https://docs.openstack.org/oslo.i18n/latest/user/index.html>.
β troveclient.service_catalog module
class troveclient.service_catalog.ServiceCatalog(resource_dict)β Bases:objectπ- Helper methods for dealing with a Keystone Service Catalog.
get_token()β gets the token. Signature only, thatβs the lore.url_for(attr=None, filter_value=None, service_type=None, endpoint_type='publicURL', service_name=None, database_service_name=None)β Fetch the public URL from the Compute service for a particular endpoint attribute. If none given, return the first. See tests for sample service catalog. π
π troveclient.shell module
Command-line interface to the OpenStack Trove API.
class troveclient.shell.OpenStackHelpFormatter(prog, indent_increment=2, max_help_position=34, width=None)β Bases:HelpFormatterβ¨start_section(heading)β starts a section. Thatβs it, thatβs the method.
class troveclient.shell.OpenStackTroveShellβ Bases:objectπ«Άdo_bash_completion(args)β Prints arguments for bash_completion. Prints all of the commands and options to stdout so that thetrove.bash_completionscript doesn't have to hard code them. πdo_help(args)β Displays help about this program or one of its subcommands.get_base_parser(argv)β gets the base parser, signature only.get_subcommand_parser(version, argv)β gets the subcommand parser, signature only.main(argv)β main, withargv. No extra detail in this page.setup_debugging(debug)β sets up debugging, signature only.
class troveclient.shell.TroveClientArgumentParser(*args, **kwargs)β Bases:ArgumentParserπΈadd_argument(dest, ..., name=value, ...)β adds an argument, exact signature.add_argument(option_string, option_string, ..., name=value, ...)β adds an argument with option strings, exact signature.error(message: string)β Prints a usage message incorporating the message to stderr and exits. π
troveclient.shell.main()β the module-level main, signature exactly like that.
π§ troveclient.utils module
class troveclient.utils.HookableMixinβ Bases:objectπ- Mixin so classes can register and run hooks.
classmethod add_hook(hook_type, hook_func)β classmethod, exact signature.classmethod run_hooks(hook_type, *args, **kwargs)β classmethod, exact signature.
troveclient.utils.add_arg(f, *args, **kwargs)β Bind CLI arguments to ashell.pydo_foofunction. πtroveclient.utils.arg(*args, **kwargs)β Decorator for CLI args.troveclient.utils.decode_data(data)β description says: βEncode the data using the base64 codec.β Yes, exactly that, bestie π.troveclient.utils.do_action_on_many(action, resources, success_msg, error_msg)β Helper to run an action on many resources.troveclient.utils.do_action_with_msg(action, success_msg)β Helper to run an action with return message.troveclient.utils.encode_data(data)β Encode the data using the base64 codec.troveclient.utils.env(*vars, **kwargs)β Returns environment variables. Returns the first environment variable set if none are non-empty, defaults to''or keyword arg default. πtroveclient.utils.find_resource(manager, name_or_id)β Helper for the_find_*methods. This method should be replaced withosc_utils.find_resource().troveclient.utils.get_project_id(manager, id_or_name)β gets the project id. Signature only.troveclient.utils.get_resource_id(manager, id_or_name)β gets the resource id. Signature only.troveclient.utils.get_resource_id_by_name(manager, name)β gets the resource id by name. Signature only.troveclient.utils.get_service_type(f)β Retrieves service type from function.troveclient.utils.is_admin(cs)β checks if admin, signature only.troveclient.utils.is_uuid_like(val)β Returns validation of a value as a UUID. For our purposes, a UUID is a canonical form string:aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaβtroveclient.utils.isunauthenticated(f)β Decorator to mark authentication-non-required. Checks to see if the function is marked as not requiring authentication with the@unauthenticateddecorator. ReturnsTrueif decorator is set toTrue,Falseotherwise.troveclient.utils.print_dict(d, key='Property')β prints a dict withkey='Property', exact defaults.troveclient.utils.print_list(objs, fields, formatters={}, order_by=None, obj_is_dict=False, labels={})β prints a list, with every default preserved exactly.troveclient.utils.safe_issubclass(*args)β Likeissubclass, but will just returnFalseif not a class.troveclient.utils.service_type(stype)β Adds'service_type'attribute to decorated function. Usage:
@service_type('database')
def mymethod(f):
...
troveclient.utils.translate_keys(collection, convert)β translates keys, signature only.troveclient.utils.unauthenticated(f)β Adds'unauthenticated'attribute to decorated function. Usage:
@unauthenticated
def mymethod(f):
...
π§Έ Module contents
π INDICES AND TABLES
- Index β
<> - Search Page β
<>
π Author
Author name not set.
Β©οΈ Copyright
2014, OpenStack Foundation.
okay bestie, thatβs the whole iconic page π β itβs from PYTHON-TROVECLIENT(1), version 8.11.0, dated Jan 02, 1980. slay.
π¦ where this page comes from
- nixpkgs unstable: python3.13-python-troveclient 8.11.0
- nixpkgs unstable: python3.14-python-troveclient 8.11.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms