OPENSTACKSDK(1)
NAME ๐ธ
openstacksdk โ openstacksdk 4.22.0
Okay bestie, this is the openstacksdk manual page, and it's split into three sections:
- An installation guide
- A section for users looking to build applications which make use of OpenStack
- A section for those looking to contribute to this project
INSTALLATION โจ
Installation guide ๐
The OpenStack SDK is available on PyPI at https://pypi.org/project/openstacksdk under the name openstacksdk. To install it, use pip:
$ pip install openstacksdk
To check the installed version you can call the module with:
$ python -m openstack version
FOR USERS ๐ซถ
Using the OpenStack SDK ๐
This section of documentation pertains to those who wish to use this SDK in their own application. If you're looking for documentation on how to contribute to or extend the SDK, refer to the contributor ../contributor section.
For a listing of terms used throughout the SDK, including the names of projects and services supported by it, see the glossary.
User Guides ๐ง
These guides walk you through how to make use of the libraries we provide to work with each OpenStack service. If you're looking for a cookbook approach, this is where you'll want to begin.
Getting started ๐
openstacksdk aims to talk to any OpenStack cloud. To do this, it requires a configuration file. openstacksdk favours clouds.yaml files, but can also use environment variables. The clouds.yaml file should be provided by your cloud provider or deployment tooling. An example:
clouds:
mordred:
region_name: Dallas
auth:
username: 'mordred'
password: XXXXXXX
project_name: 'demo'
auth_url: 'https://identity.example.com'
More information on configuring openstacksdk can be found in Configuring OpenStack SDK Applications.
Given sufficient configuration, you can use openstacksdk to interact with your cloud. openstacksdk consists of three layers. Most users will make use of the proxy layer. Using the above clouds.yaml, consider listing servers:
import openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
# Initialize connection
conn = openstack.connect(cloud='mordred')
# List the servers
for server in conn.compute.servers():
print(server.to_dict())
openstacksdk also contains a higher-level cloud layer based on logical operations:
import openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
# Initialize connection
conn = openstack.connect(cloud='mordred')
# List the servers
for server in conn.list_servers():
print(server.to_dict())
The benefit of this layer is mostly seen in more complicated operations that take multiple steps and where the steps vary across providers. For example:
import openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
# Initialize connection
conn = openstack.connect(cloud='mordred')
# Upload an image to the cloud
image = conn.create_image(
'ubuntu-trusty', filename='ubuntu-trusty.qcow2', wait=True)
# Find a flavor with at least 512M of RAM
flavor = conn.get_flavor_by_ram(512)
# Boot a server, wait for it to boot, and then do whatever is needed
# to get a public IP address for it.
conn.create_server(
'my-server', image=image, flavor=flavor, wait=True, auto_ip=True)
Finally, there is the low-level resource layer. This provides support for the basic CRUD operations supported by REST APIs and is the base building block for the other layers. You typically will not need to use this directly:
import openstack
import openstack.config.loader
import openstack.compute.v2.server
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
# Initialize connection
conn = openstack.connect(cloud='mordred')
# List the servers
for server in openstack.compute.v2.server.Server.list(session=conn.compute):
print(server.to_dict())
Using os-client-config ๐ ๏ธ
Configuring OpenStack SDK Applications โ๏ธ
Environment Variables ๐ป
openstacksdk honors all of the normal OS_* variables. It does not provide backwards compatibility to service-specific variables such as NOVA_USERNAME.
If you have OpenStack environment variables set, openstacksdk will produce a cloud config object named envvars containing your values from the environment. If you don't like the name envvars, that's okay, you can override it by setting OS_CLOUD_NAME.
Config Files ๐
openstacksdk will look for a file called clouds.yaml in the following locations:
.(the current directory)$HOME/.config/openstack(Linux) /~/Library/Application Support/openstack(macOS) /C:\\Users\\USERNAME\\AppData\\Local\\OpenStack\\openstack(Windows)/etc/openstack(Linux) //Library/Application Support/openstack(macOS) /C:\\ProgramData\\OpenStack\\openstack(Windows)
The first file found wins.
You can also set the environment variable OS_CLIENT_CONFIG_FILE to an absolute path of a file to look for and that location will be inserted at the front of the file search list.
The keys are all of the keys you'd expect from OS_* except lower case and without the OS prefix. So, region name is set with region_name.
Splitting Secrets ๐คซ
In some scenarios, such as configuration management controlled environments, it might be easier to have secrets in one file and non-secrets in another. This is fully supported via an optional file secure.yaml which follows all the same location rules as clouds.yaml. It can contain anything you put in clouds.yaml and will take precedence over anything in the clouds.yaml file.
You can also set the environment variable OS_CLIENT_SECURE_FILE to an absolute path of a file to look for and that location will be inserted at the front of the file search list.
Example ๐
clouds.yaml
clouds:
mordred:
region_name: Dallas
auth:
username: 'mordred'
password: XXXXXXX
project_name: 'demo'
auth_url: 'https://identity.example.com'
mtvexx:
profile: https://vexxhost.com
region_name: ca-ymq-1
dns_api_version: 1
infra:
profile: rackspace
auth:
username: openstackci
password: XXXXXXXX
project_id: 610275
regions:
- DFW
- ORD
- IAD
secure.yaml
clouds:
mtvexx:
auth:
username: mordred@inaugust.com
password: XXXXXXXXX
project_name: mordred@inaugust.com
You may note a few things.
- Some of the clouds use a
profilekey and omit things likeauth_url. This relies on a feature known as Vendor Profiles, which is described below. regionscan be a list of regions. When you callget_all_clouds, you'll get a cloud config object for each cloud/region combo.- As seen with
dns_api_version, any setting that makes sense to be per-service, likeservice_typeorendpointorapi_versioncan be set by prefixing the setting with the default service type.
Vendor Profiles ๐ท๏ธ
Vendor profiles are bundled, named sets of default configuration for specific public OpenStack clouds. They exist because different cloud providers make different deployment choices that leak out to end users: different API versions, image formats, whether floating IPs are required, non-standard service types, region lists, and auth_url values. Vendor profiles capture all of this so that you don't have to.
Vendor profiles can be configured using the profile key for a cloud entry, as seen below.
Note:cloudis a deprecated alias forprofile. While still supported, its use should be avoided where possible.
Vendor profiles can be provided three ways:
Built-in vendor profiles
openstacksdk bundles vendor profiles for a number of a public cloud providers. These are documented in Vendor Support and can be retrieved using the openstack.config.vendors module:
>>> vendors.profiles() # list all supported profiles
>>> vendors.get_profile('ovh') # show defaults for a specific profile
To use one of these built-in vendor profiles, request it by name:
clouds:
infra:
profile: ovh
auth:
...
URL-based vendor profiles
You can also request a vendor profile by URL:
clouds:
infra:
profile: https://vexxhost.com/
auth:
...
When a URL is provided, openstacksdk will attempt to retrieve a .well-known/openstack/api file. This file will have the same format and be validated against the same schema as an in-tree vendor profile.
Custom vendor profiles (clouds-public.yaml)
Finally, it is possible to provide custom vendor profiles using a clouds-public.yaml file. A clouds-public.yaml file looks very similar to a clouds.yaml / secure.yaml file but is expected to only contain public information (so e.g. no username/password) information. This means they are well suited for things like internal corporate clouds. openstacksdk will search multiple locations for this file, as described for clouds.yaml / secure.yaml above. However, unlike those files, it is not possible to point to a specific file via an environment variable.
public-clouds:
# The key is the profile name you reference from clouds.yaml via `profile:`
my-corp-cloud:
auth:
auth_url: https://keystone.example.com:5000/v3
identity_api_version: '3'
volume_api_version: '3'
interface: public
regions:
- RegionOne
- RegionTwo
# A profile can use the {region_name} template, expanded per region
acme-public:
auth:
auth_url: https://{region_name}.acme-cloud.com:5000/v3/
identity_api_version: '3'
image_format: raw
requires_floating_ip: true
regions:
- us-east-1
- eu-west-1
Auth Settings ๐
okay so bestie, Keystone has auth plugins โ which means openstacksdk literally cannot know ahead of time which auth settings youโre gonna need. The default plugin type is password, which is what all things were before plugins came about. To make validation of values possible, every parameter that exists because of your chosen plugin has to go into the auth dict. For password auth, that includes auth_url, username, and password, plus anything related to domains, projects, and trusts. periodt ๐
MFA Support ๐ซถ
MFA support needs a specially prepared configuration file. In this case you use a combo of two different authorization plugins, and each one has its own requirements for the specified parameters. itโs giving very โbring both your IDsโ energy ๐ญ
clouds:
mfa:
auth_type: "v3multifactor"
auth_methods:
- v3password
- v3totp
auth:
auth_url: https://identity.cloud.com
username: user
user_id: uid
password: XXXXXXXXX
project_name: project
user_domain_name: udn
project_domain_name: pdn
API Settings โจ
These settings get passed to keystoneauth and are common to all services.
api_timeoutโ a timeout for API requests. This should be a numerical value indicating some amount (or fraction) of seconds, or0for no timeout. (optional, defaults to0)collect_timingโ whether or not to collect per-method timing information for each API call. (optional, defaults toFalse)
SSL Settings ๐
When access to a cloud happens over a secure connection, openstacksdk will always verify the SSL cert by default. You can disable that by setting verify to False. If the cert is signed by an unknown CA, you can provide a specific cacert via cacert.
Warning: ๐จverifywill always have precedence overcacert, so when you set a CA cert but disableverify, the cloud cert will never be validated. no cap, itโs just not gonna check it.
Client certs are also configurable. cert is the client cert file location. If the cert key is not included within the client cert file, its file location needs to be set via key.
# clouds.yaml
clouds:
regular-secure-cloud:
auth:
auth_url: https://signed.cert.domain:5000
...
unknown-ca-with-client-cert-secure-cloud:
auth:
auth_url: https://unknown.ca.but.secure.domain:5000
...
key: /home/myhome/client-cert.key
cert: /home/myhome/client-cert.crt
cacert: /home/myhome/ca.crt
self-signed-insecure-cloud:
auth:
auth_url: https://self.signed.cert.domain:5000
...
verify: False
Note: for parity withopenstackcommand-line options, theinsecureboolean is also recognised โ with the opposite semantics toverify; i.e.Trueignores certificate failures. This should be considered deprecated forverify. ๐ซ
Cache Settings ๐
Changed in version 1.0.0: Previously, caching was managed exclusively in the cloud layer. Starting in openstacksdk 1.0.0, caching is moved to the proxy layer. As the cloud layer depends on the proxy layer in 1.0.0, this means both layers can benefit from the cache. iconic behavior honestly ๐
Authenticating and accessing resources on a cloud is often expensive. So itโs super common that applications will wish to do some client-side caching of both credentials and cloud resources. To facilitate this, openstacksdk supports caching credentials and resources using the system keyring and dogpile.cache, respectively.
Tip: ๐ก itโs important to emphasise that openstacksdk does not actually cache anything itself. Rather, it collects and presents the cache information so that your various applications that are connecting to OpenStack can share a cache should you desire. It is important that your cache backend is correctly configured according to the needs of your application.
Caching is enabled or disabled globally, rather than on a cloud-by-cloud basis. This is done by configuring the cache top-level key. Caching of authentication tokens can be configured using the following settings:
cache.authโ a boolean indicating whether tokens should be cached in the keyring. When enabled, this allows the consequent connections to the same cloud to skip fetching a new token. When the token expires or is invalidated, openstacksdk will automatically establish a new connection. Defaults tofalse.
For example, to configure caching of authentication tokens:
cache:
auth: true
Caching of resources can be configured using the following settings:
cache.expiration_timeโ the expiration time in seconds for a cache entry. This should be an integer. Defaults to0.cache.classโ the cache backend to use, which can include any backend supported bydogpile.cachenatively as well as backend provided by third-part packages. This should be a string. Defaults todogpile.cache.memory.cache.argumentsโ a mapping of arbitrary arguments to pass into the cache backend. These are backend specific. Keys should correspond to a configuration option for the configured cache backend. Defaults to{}.cache.expirationsโ a mapping of resource types to expiration times. The keys should be specified in the same way as the metrics are emitted, by joining meaningful resource URL segments with.. For example, both/serversand/servers/IDshould be specified asservers, while/servers/ID/metadata/KEYshould be specified asserver.metadata. Values should be an expiration time in seconds. A value of-1indicates that the cache should never expire, while a value of0disables caching for the resource. Defaults to{}.
For example, to configure caching with the dogpile.cache.memory backend with a 1 hour expiration:
cache:
expiration_time: 3600
To configure caching with the dogpile.cache.memory backend with a 1 hour expiration but only for requests to the OpenStack Compute serviceโs /servers API:
cache:
expirations:
servers: 3600
To configure caching with the dogpile.cache.pylibmc backend with a 1 hour expiration time and a memcached server running on your localhost:
cache:
expiration_time: 3600
arguments:
url:
- 127.0.0.1
To configure caching with the dogpile.cache.pylibmc backend with a 1 hour expiration time, a memcached server running on your localhost, and multiple per-resource cache expiration times:
cache:
class: dogpile.cache.pylibmc
expiration_time: 3600
arguments:
url:
- 127.0.0.1
expiration:
server: 5
flavor: -1
compute.servers: 5
compute.flavors: -1
image.images: 5
Finally, if the cache key is undefined, a null cache is enabled meaning caching is effectively disabled.
Note: ๐ง Non GET requests cause cache invalidation based on the caching key prefix. This means that, for example, aPUTrequest to/images/IDwill invalidate all images cache โ list and all individual entries. Moreover it is possible to explicitly pass theskip_cacheparameter to theproxy._getfunction to bypass cache and invalidate what is already there. This is happening automatically in thewait_for_statusmethods where it is expected that resource will change some of the attributes over the time. Forcing complete cache invalidation can be achieved callingconn._cache.invalidate.
IPv6 ๐ฆ
IPv6 is the future, and you should always use it if your cloud supports it and if your local network supports it. Both of those are easily detectable and all friendly software should do the right thing. we love a forward-compatible moment โจ
However, sometimes a cloud API may return IPv6 information that is not useful to a production deployment. For example, the API may provide an IPv6 address for a server, but not provide that to the host instance via metadata (configdrive) or standard IPv6 autoconfiguration methods โ i.e. the host either needs to make a bespoke API call, or otherwise statically configure itself. awkward ๐ญ
For such situations, you can set the force_ipv4, or OS_FORCE_IPV4 boolean environment variable. For example:
clouds:
mtvexx:
profile: vexxhost
auth:
username: mordred@inaugust.com
password: XXXXXXXXX
project_name: mordred@inaugust.com
region_name: ca-ymq-1
dns_api_version: 1
monty:
profile: fooprovider
force_ipv4: true
auth:
username: mordred@inaugust.com
password: XXXXXXXXX
project_name: mordred@inaugust.com
region_name: RegionFoo
The above snippet will tell client programs to prefer the IPv4 address and leave the public_v6 field of the Server object blank for the fooprovider cloud. You can also set this with a client flag for all clouds:
client:
force_ipv4: true
Service-specific Overrides ๐
Service-specific settings, like the Nova service type, are set with the default service type as a prefix. For instance, to set a special service_type for trove (because youโre using Rackspace):
database_service_type: 'rax:database'
Per-region settings ๐ธ
Sometimes you have a cloud provider that has config that is common to the cloud, but also with some things you might want to express on a per-region basis. For instance, Internap provides a public and private network specific to the user in each region, and putting the values of those networks into config can make consuming programs more efficient. efficiency queen ๐
To support this, the region list can actually be a list of dicts, and any setting that can be set at the cloud level can be overridden for that region.
clouds:
internap:
profile: internap
auth:
password: XXXXXXXXXXXXXXXXX
username: api-55f9a00fb2619
project_name: inap-17037
regions:
- name: ams01
values:
networks:
- name: inap-17037-WAN1654
routes_externally: true
- name: inap-17037-LAN6745
- name: nyj01
values:
networks:
- name: inap-17037-WAN1654
routes_externally: true
- name: inap-17037-LAN6745
๐ Setting Precedence
Okay so bestie, some settings are literally redundant โ like, project-name and project-id both specify the project, right? So when two redundant settings beef with each other, the _name option in clouds.yaml wins (that's the equivalent -name CLI option and the _NAME environment variable). Slay, name takes it. โจ
Some environment variables or command line flags can override the settings from clouds.yaml. The way that these ones show up and just take over:
--domain-id(OS_DOMAIN_ID)--domain-name(OS_DOMAIN_NAME)--user-domain-id(OS_USER_DOMAIN_ID)--user-domain-name(OS_USER_DOMAIN_NAME)--project-domain-id(OS_PROJECT_DOMAIN_ID)--project-domain-name(OS_PROJECT_DOMAIN_NAME)--auth-token(OS_AUTH_TOKEN)--project-id(OS_PROJECT_ID)--project-name(OS_PROJECT_NAME)--tenant-id(OS_TENANT_ID) (deprecated for--project-idโ yeah she's old, moving on ๐)--tenant-name(OS_TENANT_NAME) (deprecated for--project-nameโ her too)
Similarly, if one of the above settings is specified in clouds.yaml as part of the auth section as well as the main section, the auth settings get overridden. Like, look at this config section where project is specified multiple times, it's giving "choose your fighter":
clouds:
mtvexx:
profile: https://vexxhost.com
auth:
username: mordred@inaugust.com
password: XXXXXXXXX
project_name: mylessfavoriteproject
project_id: 0bedab75-898c-4521-a038-0b4b71c41bed
region_name: ca-ymq-1
project_name: myfavoriteproject
project_id: 2acf9403-25e8-479e-a3c6-d67540c424a4
In the above example, the project_id configuration values will be ignored in favor of the project_name configuration values, and the higher-level project will be chosen over the auth-specified project. So the actual project used will be myfavoriteproject. Periodt. ๐
๐ธ Examples
auth
Password-based authentication (project-scoped) โ the classic, the icon:
example:
auth:
auth_url: http://example.com/identity
password: password
project_domain_id: default
project_name: admin
user_domain_id: default
username: admin
region_name: RegionOne
Password-based authentication (domain-scoped):
example:
auth:
auth_url: http://example.com/identity
domain_id: default
password: password
username: admin
region_name: RegionOne
Password-based authentication (trust-scoped):
example-trust:
auth:
auth_url: http://example.com/identity
password: password
username: admin
trust_id: 95946f9eef864fdc993079d8fe3e5747
region_name: RegionOne
Password-based authentication (system-scoped):
example-system:
auth:
auth_url: http://example.com/identity
password: password
system_scope: all
username: admin
region_name: RegionOne
Application credential-based authentication:
example-appcred:
auth:
auth_url: http://example.com/identity
application_credential_id: 9da0a8da3d394d09bf49dfc27014d254
application_credential_secret: pKfDSvUOFwO2t2_XxCajAFhzCKAVHI7yfqPb6xjshVDnMUHF7ifju8gMdhHTI4Eo56UP_hEc8ssmgA1NNtKMpA
auth_type: v3applicationcredential
region_name: RegionOne
Token-based authentication:
example-token:
auth:
auth_url: http://example.com/identity
token: gAAAAABl32ptw2PN6L9JyBeO16PwQU1SrdMUvUz8Eon7LC2PFItdGRWFpOkK0qwH3JkukTuEM5qbYK9ucowRXET1RBMjZlfVpUa8Nz3qjQdzXw7pBKH4w1e4tekvDCOKfn15ZoujBOvdGqgtpW-febVGaW9oJzf6R3WTMDxWz3YRJjmiOBpwcN8
project_id: 1fd93a4455c74d2ea94b929fc5f0e488
auth_type: v3token
region_name: RegionOne
๐ซถ Note: This is a toy example: by their very definition tokens are short-lived. You are unlikely to store them in aclouds.yamlfile. Instead, you would likely pass the TOTP token via the command line (--os-token) or as an environment variable (OS_TOKEN).
TOTP-based authentication:
example-totp:
auth:
auth_url: http://example.com/identity
passcode: password
project_domain_id: default
project_name: admin
user_domain_id: default
username: admin
auth_type: v3totp
region_name: RegionOne
๐ซถ Note: This is a toy example: by their very definition TOTP tokens are short-lived. You are unlikely to store them in aclouds.yamlfile. Instead, you would likely pass the TOTP token via the command line (--os-passcode) or as an environment variable (OS_PASSCODE).
OAuth1-based authentication:
example-oauth:
auth:
auth_url: http://example.com/identity
consumer_key: foo
consumer_secret: secret
access_key: bar
access_secret: secret
auth_type: v3oauth1
region_name: RegionOne
๐ฆ Using openstack.config in an Application
Usage
The simplest and least useful thing you can do is honestly iconic in its uselessness:
python -m openstack.config.loader
Which will print out whatever it finds for your config. If you want to use it from python โ which is much more likely what you actually want to do, bestie โ things like this:
Get a named cloud:
import openstack.config
cloud_region = openstack.config.OpenStackConfig().get_one(
'internap', region_name='ams01')
print(cloud_region.name, cloud_region.region, cloud_region.config)
Or, get all of the clouds:
import openstack.config
cloud_regions = openstack.config.OpenStackConfig().get_all()
for cloud_region in cloud_regions:
print(cloud_region.name, cloud_region.region, cloud_region.config)
argparse
If you're using openstack.config from a program that wants to process command line options, there's a registration function to register the arguments that both openstack.config and keystoneauth know how to deal with โ plus a consumption argument. It's giving teamwork, it's giving synergy:
import argparse
import openstack
parser = argparse.ArgumentParser()
cloud = openstack.connect(options=parser)
๐ Vendor Support
OpenStack presents deployers with many options, some of which can expose differences to end users. openstacksdk tries its best to collect information about various things a user would need to know. The following is a text representation of the vendor related defaults openstacksdk knows about. Ngl it's a whole vibe check of the cloud landscape. ๐
Default Values
These are the default behaviors unless a cloud is configured differently:
- Identity uses password authentication
- Identity API Version is 2
- Image API Version is 2
- Volume API Version is 2
- Compute API Version is 2.1
- Images must be in
qcow2format - Images are uploaded using
PUTinterface - Public IPv4 is directly routable via DHCP from Neutron
- IPv6 is not provided
- Floating IPs are not required
- Floating IPs are provided by Neutron
- Security groups are provided by Neutron
- Vendor specific agents are not used
AURO
Regions, bestie:
van1โ Vancouver, BC
And the deets:
- Public IPv4 is provided via NAT with Neutron Floating IP
Betacloud
https://api-1.betacloud.de:5000
Regions:
betacloud-1โ Karlsruhe, Germany
And the deets:
- Identity API Version is 3
- Images must be in
rawformat - Public IPv4 is provided via NAT with Neutron Floating IP
- Volume API Version is 3
Binero
https://auth.binero.cloud:5000/v3
Regions:
europe-se-1โ Stockholm, SE
And the deets:
- Identity API Version is 3
- Volume API Version is 3
- Public IPv4 is directly routable via DHCP from Neutron
- Public IPv4 is provided via NAT with Neutron Floating IP
Catalyst
https://api.cloud.catalyst.net.nz:5000/v2.0
Regions:
nz-por-1โ Porirua, NZnz_wlg_2โ Wellington, NZ
And the deets:
- Identity API Version is 3
- Compute API Version is 2
- Images must be in
rawformat - Volume API Version is 3
โ๏ธ City Cloud
URL: https://%(region_name)s.citycloud.com:5000/v3/
Regions, bestie:
Buf1โ Buffalo, NYdx1โ Dubai, UAEFra1โ Frankfurt, DEKna1โ Karlskrona, SELon1โ London, UKSto2โ Stockholm, SEtky1โ Tokyo, JP
The facts:
- Identity API Version is
3 - Public IPv4 is provided via NAT with Neutron Floating IP
- Volume API Version is
1
๐ธ ConoHa
URL: https://identity.%(region_name)s.conoha.io
Regions:
tyo1โ Tokyo, JPsin1โ Singaporesjc1โ San Jose, CA
Important note:
- Image upload is not supported ๐ซ
๐ฆ DreamCompute
URL: https://iad2.dream.io:5000
Region:
RegionOneโ Ashburn, VA
The details:
- Identity API Version is
3 - Images must be in raw format
- IPv6 is provided to every server
๐ Open Telekom Cloud
URL: https://iam.%(region_name)s.otc.t-systems.com/v3
Regions:
eu-deโ Biere/Magdeburg, DEeu-nlโ Amsterdam, NL
The facts:
- Identity API Version is
3 - Public IPv4 is provided via NAT with Neutron Floating IP
โจ ELASTX
URL: https://ops.elastx.cloud:5000/v3
Region:
se-stoโ Stockholm, SE
The details:
- Identity API Version is
3 - Public IPv4 is provided via NAT with Neutron Floating IP
๐ Enter Cloud Suite
URL: https://api.entercloudsuite.com/v2.0
Regions:
nl-ams1โ Amsterdam, NLit-mil1โ Milan, ITde-fra1โ Frankfurt, DE
The fact:
- Compute API Version is
2
๐ Fuga
URL: https://identity.api.fuga.io:5000
Region:
cystackโ Netherlands
The details:
- Identity API Version is
3 - Volume API Version is
3
๐ Internap
URL: https://identity.api.cloud.inap.com/v2.0
Regions:
ams01โ Amsterdam, NLda01โ Dallas, TXnyj01โ New York, NYsin01โ Singaporesjc01โ San Jose, CA
Important note:
- Floating IPs are not supported
๐ Limestone Networks
URL: https://auth.cloud.lstn.net:5000/v3
Regions:
us-dfw-1โ Dallas, TXus-slcโ Salt Lake City, UT
The details:
- Identity API Version is
3 - Images must be in raw format
- IPv6 is provided to every server connected to the Public Internet network
๐ซ OVH
URL: https://auth.cloud.ovh.net/v3
Regions:
BHS1โ Beauharnois, QCSBG1โ Strassbourg, FRGRA1โ Gravelines, FR
The details:
- Images may be in raw format. The
qcow2default is also supported - Floating IPs are not supported
โญ Rackspace
URL: https://identity.api.rackspacecloud.com/v2.0/
Regions:
DFWโ Dallas, TXHKGโ Hong KongIADโ Washington, D.C.LONโ London, UKORDโ Chicago, ILSYDโ Sydney, NSW
The full rundown:
- Database Service Type is
rax:database - Compute Service Name is
cloudServersOpenStack - Images must be in
vhdformat - Images must be uploaded using the Glance Task Interface
- Floating IPs are not supported
- Public IPv4 is directly routable via static config by Nova
- IPv6 is provided to every server
- Security groups are not supported
- Uploaded Images need properties to not use vendor agent::
:vm_mode: hvmand:xenapi_use_agent: False๐ - Block Storage API Version is
2 - The Block Storage API supports version
2but only version1is in the catalog. The Block Storage endpoint is<https:/>/{region_name}.blockstorage.api.rackspacecloud.com/v2/{project_id} - While passwords are recommended for use, API keys do work as well. The
rackspaceauthpython package must be installed, and then the following can be added toclouds.yaml:
auth:
username: myusername
api_key: myapikey
auth_type: rackspace_apikey
๐ธ Switch Cloud ๐ธ
https://identity.compute.cloud.switch.ch/v3
Regions:
zhwโ Zurich West, CHzhcโ Zurich Central, CH- Identity API Version is
3 - Compute API Version is
2 - Volume API Version is
3 - Images must be in raw format
- Public IPv4 is provided via NAT with Neutron Floating IP
- IPv6 is provided to every server
๐ฆ SWITCHengines ๐ฆ
https://keystone.cloud.switch.ch:5000/v3
Regions:
LSโ Lausanne, CHZHโ Zurich, CH- Identity API Version is
3 - Compute API Version is
2 - Images must be in raw format
- Volume API Version is
3
๐ Ultimum ๐
https://console.ultimum-cloud.com:5000/v2.0
Regions:
RegionOneโ Prague, CZ- Volume API Version is
1
โญ UnitedStack โญ
https://identity.api.ustack.com/v3
Regions:
bj1โ Beijing, CNgd1โ Guangdong, CN- Identity API Version is
3 - Images must be in raw format
- Volume API Version is
1
๐ VEXXHOST ๐
Regions:
ca-ymq-1โ Montreal, QCsjc1โ Santa Clara, CA- DNS API Version is
1 - Identity API Version is
3 - Volume API Version is
3
๐ Zetta ๐
https://identity.api.zetta.io/v3
Regions:
no-osl1โ Oslo, NO- DNS API Version is
2 - Identity API Version is
3
๐ง Network Config ๐ง
There are several different qualities that networks in OpenStack might have that might not be able to be automatically inferred from the available metadata. To help users navigate more complex setups, os-client-config allows configuring a list of network metadata.
clouds:
amazing:
networks:
- name: blue
routes_externally: true
- name: purple
routes_externally: true
default_interface: true
- name: green
routes_externally: false
- name: yellow
routes_externally: false
nat_destination: true
- name: chartreuse
routes_externally: false
routes_ipv6_externally: true
- name: aubergine
routes_ipv4_externally: false
routes_ipv6_externally: true
Every entry must have a name field, which can hold either the name or the id of the network.
routes_externally is a boolean field that labels the network as handling north/south traffic off of the cloud. In a public cloud this might be thought of as the "public" network, but in private clouds it's possible it might be an RFC1918 address. In either case, it provides IPs to servers that things not on the cloud can use. This value defaults to false, which indicates only servers on the same network can talk to it.
routes_ipv4_externally and routes_ipv6_externally are boolean fields to help handle routes_externally in the case where a network has a split stack with different values for IPv4 and IPv6. Either entry, if not given, defaults to the value of routes_externally.
default_interface is a boolean field that indicates that the network is the one that programs should use. It defaults to false. An example of needing to use this value is a cloud with two private networks, and where a user is running ansible in one of the servers to talk to other servers on the private network. Because both networks are private, there would otherwise be no way to determine which one should be used for the traffic.
There can only be one default_interface per cloud. ๐
nat_destination is a boolean field that indicates which network floating ips should be attached to. It defaults to false. Normally this can be inferred by looking for a network that has subnets that have a gateway_ip. But it's possible to have more than one network that satisfies that condition, so the user might want to tell programs which one to pick.
There can be only one nat_destination per cloud. ๐
nat_source is a boolean field that indicates which network floating ips should be requested from. It defaults to false. Normally this can be inferred by looking for a network that is attached to a router. But it's possible to have more than one network that satisfies that condition, so the user might want to tell programs which one to pick.
There can be only one nat_source per cloud. periodt ๐
๐ API Reference ๐
class openstack.config.OpenStackConfig(config_files=None,
vendor_files=None, override_defaults=None, force_ipv4=None,
envvar_prefix=None, secure_files=None, pw_func=None,
session_constructor=None, app_name=None, app_version=None,
load_yaml_config=True, load_envvars=True, statsd_host=None,
statsd_port=None, statsd_prefix=None, statsd_config=None,
influxdb_config=None)
config_filenameโ the filename that configuration was loaded from, if any.secure_config_filenameโ the filename that secure configuration was loaded from, if any.cloud_configโ contains the combined loaded configuration.get_extra_config(key, defaults=None)โ Fetch an arbitrary extra chunk of config, laying in defaults.
Parameters:
key(string) โ name of the config section to fetchdefaults(dict) โ (optional) default values to merge under the found config
register_argparse_arguments(parser, argv, service_keys=None)โ Register all of the common argparse options needed.
Given an argparse parser, register the keystoneauth Session arguments, the keystoneauth Auth Plugin Options and os-cloud. Also, peek in the argv to see if all of the auth plugin options should be registered or merely the ones already configured.
Parameters:
argparse.ArgumentParserโ parser to attach argparse options toargvโ the arguments provided to the applicationservice_keys(string) โ Service or list of services this argparse should be specialized for, if known. The first item in the list will be used as the default value forservice_type(optional)
Raises: exceptions.ConfigException if an invalid auth-type is requested ๐ซถ
auth_config_hook(config)โ Allow examination of config values before loading auth plugin.
OpenStackClient will override this to perform additional checks on auth_type.
option_prompt(config, p_opt)โ Prompt user for option that requires a value.magic_fixes(config)โ Perform the set of magic argument fixups.get_one(cloud=None, validate=True, argparse=None, **kwargs)โ Retrieve a singleCloudRegionand merge additional options
Parameters
cloud(string) โ the name of the configuration to load out ofclouds.yamlโจvalidate(boolean) โ do we validate the config? Set this toFalseand, like, no auth plugin gets created at all. It's honestly really only useful for testing ๐งชargparse(Namespace) โ anargparseNamespaceobject; it lets you pass argparse options straight in so they get added to the cloud config. Values ofNoneand''get removed ๐ซถregion_nameโ the name of the region of the cloud.kwargsโ additional configuration options.
Returns ๐ openstack.config.cloud_region.CloudRegion
Raises keystoneauth1.exceptions.MissingRequiredOptions when required auth parameters are missing ๐ญ
get_one_cloud_osc(cloud=None, validate=True, argparse=None, **kwargs)
Grab a single CloudRegion and merge extra options into it, bestie ๐ธ
Parameters
cloud(string) โ the name of the configuration to load fromclouds.yamlโจvalidate(boolean) โ do we validate the config? Set it toFalseand no auth plugin gets created. It's really only useful for testing ๐งชargparse(Namespace) โ anargparseNamespaceobject; lets you pass argparse options directly in so they get added to the cloud config. Values ofNoneand''will be removed ๐region_nameโ the name of the region of the cloud.kwargsโ additional configuration options.
Raises keystoneauth1.exceptions.MissingRequiredOptions on missing required auth parameters ๐ญ
static set_one_cloud(config_file, cloud, set_config=None)
Set up one single cloud configuration, no cap ๐
Parameters
config_file(string) โ the path to the config file you want to edit. If this file doesn't exist, it literally gets created for you ๐cloud(string) โ the name of the configuration to save toclouds.yamlset_config(dict) โ the configuration options to be set.
class openstack.config.cloud_region.CloudRegion(...)
class openstack.config.cloud_region.CloudRegion(name=None,
region_name=None, config=None, force_ipv4=False, auth_plugin=None,
openstack_config=None, session_constructor=None, app_name=None,
app_version=None, session=None, discovery_cache=None, extra_config=None,
cache_expiration_time=0, cache_expirations=None, cache_path=None,
cache_class='dogpile.cache.null', cache_arguments=None,
password_callback=None, statsd_host=None, statsd_port=None,
statsd_prefix=None, statsd_config=None, influxdb_config=None,
prometheus_config=None, collector_registry=None, cache_auth=False)
The configuration for a Region of an OpenStack Cloud ๐ฆ
A CloudRegion wraps up all the config info you need to connect to every single service in a Region of a Cloud. It's giving "one object to rule them all" energy ๐
Parameters
nameโ the name of theCloudRegion. If you don't pass one, it gets derived from the hostname of the authentication URL, falling back toapp_nameif the auth plugin isn't an identity plugin ๐งregion_nameโ the default region name for all services in thisCloudRegion. If bothregion_nameandconfig['region_name']are specified, the kwarg wins (precedence, periodt). It can still be overridden for a given${service}via a${service}_region_namekey in the config dict โจconfigโ a dict of configuration values for theCloudRegionand its services. The key for a${config_option}of a specific${service}should be${service}_${config_option}. So like, to configure theendpoint_overridefor theblock_storageservice, the config dict should contain:
'block_storage_endpoint_override': 'http://...'
And if you want to provide a default that's used whenever there's no service-specific override? Just use the unprefixed ${config_option} as the service key, like:
'interface': 'public'
force_ipv4โ ifTrue, force the use of IPv4 addresses when connecting to services.auth_pluginโ akeystoneauth1auth plugin used to authenticate with the cloud.openstack_configโ theOpenStackConfigobject that created thisCloudRegion, if any.session_constructorโ a callable used to construct thekeystoneauth1Session for this region. Defaults tokeystoneauth1.session.Session.app_nameโ the name of the application connecting to the cloud. Used to construct the User-Agent header ๐app_versionโ the version of the application connecting to the cloud. Used to construct the User-Agent header.sessionโ an existing authenticatedkeystoneauth1Session to use. If you don't pass one, it gets constructed as needed usingsession_constructor.discovery_cacheโ a dict used to cache API version discovery documents, keyed by URL. It's shared across services so you don't make duplicate discovery requests ๐extra_configโ a dict of additional, arbitrary config sections that don't correspond to a service. You can get to it viaget_client_config().cache_expiration_timeโ the default time, in seconds, to cache the results of API calls. A value of0disables caching ๐ซcache_expirationsโ a dict mapping resource names to per-resource cache expiration times, in seconds. Overridescache_expiration_timefor those given resources.cache_pathโ the filesystem path to use for the cache, if you're using a file-based cache backend.cache_classโ thedogpile.cachebackend to use for caching. Defaults to'dogpile.cache.null', which disables caching.cache_argumentsโ a dict of arguments to pass to thedogpile.cachebackend.password_callbackโ a callable invoked to prompt for a password when one is required but not otherwise available ๐statsd_hostโ DEPRECATED. Usestatsd_configinstead.statsd_portโ DEPRECATED. Usestatsd_configinstead.statsd_prefixโ DEPRECATED. Usestatsd_configinstead.statsd_configโ configuration for reporting API call metrics to statsd ๐influxdb_configโ configuration for reporting API call metrics to InfluxDB. DEPRECATED: InfluxDB support relies on a deprecated library and will be removed in a future release ๐collector_registryโ aprometheus_clientCollectorRegistryused to report API call metrics to Prometheus.cache_authโ ifTrue, cache authentication tokens (using thekeyringlibrary) so they can be reused across processes ๐
property full_name
Returns a string that can be used as an identifier ๐ท๏ธ
It always returns a valid string, bestie. You'll get name and region_name, or just one of the two if only one is set, or else 'unknown'.
set_session_constructor(session_constructor)
Sets the Session constructor. That's it, that's the whole vibe ๐
get_requests_verify_args()
Returns the verify and cert values for the requests library ๐ซถ
get_services()
Returns a list of service types we know something about โจ
get_endpoint_from_catalog(service_type, interface=None, region_name=None)
Returns the endpoint for a given service as found in the catalog ๐
If you want values that respect endpoint overrides, go look at endpoint_for() <#openstack.connection.Connection.endpoint_for> instead.
Parameters
service_typeโ service type of the endpoint you're searching for.interfaceโ interface of the endpoint you're searching for. Optional; defaults to the configured value forinterfacefor thisConnection.region_nameโ region name of the endpoint you're searching for. Optional; defaults to the configured value forregion_namefor thisConnection.
Returns the endpoint of the service, or None if it's not found ๐ญ
get_auth()
Returns a keystoneauth plugin built from the auth credentials ๐
clear_auth_cache()
Discard any authentication that got cached for this cloud ๐งน
Both the copy kept in the keyring and the state the plugin holds in memory get dropped, so that a connection already built from this region can't keep using the credential and write it back when it closes. The next authentication starts from scratch, which โ for an interactive plugin โ means asking the user again ๐ Use this when the cached credential is known to be unusable, like after it's been revoked, or when you want a different account.
Unlike loading and storing, this does not require cache.auth to be enabled, and it doesn't need a keyring to be available: the in-memory state gets dropped regardless. A credential cached while caching was on has to be removable once it's been turned off, otherwise the stale entry would just get reused the next time caching is enabled. Periodt ๐
insert_user_agent()
Set sdk information into the user agent of the Session ๐ฆ
โ ๏ธ Warning: this method lives here purely soos-client-configcan use it. It's a hook point โ that's literally its whole job โ so thatos-client-configcan provide backwards compatibility and still hang out in the User Agent for the people usingos-client-configdirectly. Bestie, if that's not you, keep scrolling. ๐
Normal consumers of the SDK should use app_name and app_version. But if someone else writes a subclass of CloudRegion, it may be desirable. iykyk.
โจ get_session()
Returns a keystoneauth session based on the auth credentials. That's it, that's the tweet. ๐
โจ get_service_catalog()
Helper method to grab the service catalog. Lowkey does exactly what it says on the tin.
โจ get_all_version_data(service_type)
Retrieve version data for the given service. Obsessed with a method that tells you the truth.
Parameters
service_typeโ the service to fetch version data for.
Returns
A ~keystoneauth1.discover.VersionData object containing the version data for the requested service. Slay. โจ
โจ get_session_client(service_type, version=None, constructor=None, **kwargs)
Return a prepped keystoneauth Adapter for a given service.
This one's for making direct requests calls against a 'mounted' endpoint. So if you do:
client = get_session_client('compute')
then you can do:
client.get('/flavors')
and it will work like you think. No cap. ๐ซถ
โจ get_session_endpoint(service_type, min_version=None, max_version=None)
Return the endpoint from config or the catalog.
If a configuration lists an explicit endpoint for a service, return that. Otherwise, fetch the service catalog from the keystone session and return the appropriate endpoint. Iconic behaviour, honestly.
Parameters
service_typeโ official service type of service
โจ get_cache_resource_expiration(resource, default=None)
Get expiration time for a resource.
Parameters
resourceโ name of the resource typedefaultโ default value to return if not found (optional, defaults toNone)
Returns
Expiration time for the resource type as float or default. ๐ธ
โจ requires_floating_ip()
Return whether or not this cloud requires floating ips.
Returns
True or False if known, None if discovery is needed. And if requires_floating_ip isn't configured but the cloud is known to not provide floating ips, it will return False. She's thorough like that. ๐
โจ get_external_networks()
Get list of network names for external networks.
โจ get_external_ipv4_networks()
Get list of network names for external IPv4 networks.
โจ get_external_ipv6_networks()
Get list of network names for external IPv6 networks.
โจ get_internal_networks()
Get list of network names for internal networks.
โจ get_internal_ipv4_networks()
Get list of network names for internal IPv4 networks.
โจ get_internal_ipv6_networks()
Get list of network names for internal IPv6 networks.
โจ get_default_network()
Get network used for default interactions. The main character network, if you will. ๐
โจ get_nat_destination()
Get network used for NAT destination.
โจ get_nat_source()
Get network used for NAT source.
โจ get_client_config(name=None, defaults=None)
Get config settings for a named client.
Settings will also be looked for in a section called 'client'. If settings are found in both, they get merged โ with the settings from the named section winning over the settings from the client section, and both of them winning over the provided defaults. Hierarchy! We love a clear priority order. ๐
Parameters
name(string) โ name of the config section to look for.defaults(dict) โ default settings to use.
Returns
A dict containing merged settings from the named section, the client section and the defaults. Gorgeous. โจ
๐ Connect ๐
Okay so to work with an OpenStack cloud you first need to create a Connection <#openstack.connection.Connection> to it using your credentials. You can create a connection in a number of ways: using a configuration file, environment variables, or explicit keyword arguments, as illustrated below. Pick your fighter. ๐
It is recommended to use Config Files <#config-clouds-yaml> because the same configuration file can be shared across tools and languages. For a comprehensive overview of configuration handling in openstacksdk, see the Using os-client-config <> guide. It's giving "one config to rule them all". ๐ฆ
โจ Create a connection via a configuration file โจ
To create a connection via a configuration file, you need a YAML file called clouds.yaml. A simple clouds.yaml file looks like the following:
clouds:
mycloud:
auth:
auth_url: https://identity.example.com/v3
username: "my-username"
password: "secret-password"
project_name: "my-project"
user_domain_name: "Default"
project_domain_name: "Default"
region_name: "RegionOne"
To create a Connection <#openstack.connection.Connection> instance using this file, use the connect() factory function and pass the name of the cloud configuration:
def create_connection_from_config():
return openstack.connect(cloud=TEST_CLOUD)
For more details on the format of clouds.yaml, including standard file locations and profile inheritance, refer to Config Files <#config-clouds-yaml>. Literally all the deets are in there. ๐
โจ Command-line options (argparse) โจ
If you're writing a command-line application, connect() can integrate directly with Python's standard argparse library. Bestie, it's seamless.
When you pass an argparse.ArgumentParser instance via the options parameter, openstacksdk registers its standard options (such as --os-cloud) along with all keystoneauth <https://docs.openstack.org/keystoneauth/latest/> authentication and session options (such as --os-auth-url, --os-username, and --insecure). It then parses sys.argv to configure the connection. This lets your application define its own CLI arguments on the parser while letting openstacksdk handle all the OpenStack configuration flags. Chef's kiss. ๐
def create_connection_from_args():
parser = argparse.ArgumentParser()
return openstack.connect(options=parser)
โจ Create a connection via environment variables โจ
You can also build a connection from OS_-prefixed environment variables. If you have the standard OpenStack environment variables set โ for example, by sourcing an openrc file โ you can create a connection without any additional configuration:
import openstack
conn = openstack.connect()
When no cloud name is given, connect() loads its configuration from the environment. For the full list of supported environment variables, refer to Environment Variables <#config-environment-variables>. Env vars my beloved. ๐ฑ
โจ Create a connection via explicit arguments โจ
To create a Connection <#openstack.connection.Connection> instance via explicit keyword arguments, pass the connection parameters directly to connect():
def create_connection(
auth_url,
region,
project_name,
username,
password,
user_domain,
project_domain,
):
return openstack.connect(
auth_url=auth_url,
project_name=project_name,
username=username,
password=password,
region_name=region,
user_domain_name=user_domain,
project_domain_name=project_domain,
app_name='examples',
app_version='1.0',
)
Note: To enable logging, see the Logging <> user guide. ๐
See also: For service-to-service communication requiring service tokens, refer to the Service Tokens <> guide. ๐
โจ Next โจ
Now that you can create a connection, continue with the User Guides <#user-guides> to work with an OpenStack service. Go off, you've got this. ๐ซถโจ
๐ธ Logging ๐ธ
openstacksdk uses Python Logging. And because openstacksdk is a library, it does not configure logging handlers automatically โ it expects that to be the purview of the consuming application. Respect the boundaries, basically. ๐
โจ Simple Usage โจ
For consumers who just want a basic logging setup without thinking about it too deeply, there's a helper method. If you use it, it should be called before any other openstacksdk functionality. Like, before. First thing. No cap. โญ
openstack.enable_logging(debug=False, http_debug=False, path=None, stream=None, format_stream=False, format_template='%(asctime)s %(levelname)s: %(name)s %(message)s', handlers=None)
Enable logging output.
Helper function to enable logging. This function is available for debugging purposes and for folks doing simple applications who want an easy "just make it work for me". For more complex applications or for those who want more flexibility, the standard library logging package will receive these messages in any handlers you create. ๐
Parameters
debug(bool) โ set this toTrueto receive debug messages.http_debug(bool) โ set this toTrueto receive debug messages including HTTP requests and responses. This impliesdebug=True. Yes, it's a two-for-one. ๐path(str) โ if a path is specified, logging output will be written to that file in addition tosys.stderr. The path is passed tologging.FileHandler, which will append messages to the file (and create it if needed).streamโ one ofNoneorsys.stdoutorsys.stderr. If it isNone, nothing is logged to a stream. If it isn'tNone, console output is logged to this stream.format_stream(bool) โ ifformat_streamisFalse, the default, applyformat_templatetopathbut not to stream outputs. IfTrue, applyformat_templateto stream outputs as well.format_template(str) โ template to pass tologging.Formatter.
Return type
None โ she gives you nothing back and honestly? That's fine. ๐
import openstack
openstack.enable_logging()
The stream parameter controls where the log messages get written. It defaults to sys.stdout, which means log messages land on STDOUT. You can point it at another output stream, or set it to None to turn off console logging entirely.
The path parameter sets up logging to a file. By default, if path is given and stream is not, logging only goes to path.
You can combine the path and stream parameters to log to both places at the same time.
To log messages to a file called openstack.log and to the console on stdout:
import sys
import openstack
openstack.enable_logging(
debug=True, path='openstack.log', stream=sys.stdout)
openstack.enable_logging also sets up a few other loggers and squelches some warnings or log messages that are otherwise uninteresting or unactionable by an openstacksdk user.
โจ Advanced Usage โจ
openstacksdk logs to a set of different named loggers.
Most of the logging is set up to log to the root openstack logger. There are additional sub-loggers that are used at times, primarily so that a user can decide to turn on or off a specific type of logging. They are listed below.
openstack.configโ issues pertaining to configuration are logged to theopenstack.configlogger.openstack.iterate_timeoutโ whenopenstacksdkneeds to poll a resource, it does so in a loop that waits between iterations and ultimately times out. Theopenstack.iterate_timeoutlogger emits messages for each iteration indicating it is waiting and for how long. These can be useful to see for long running tasks so that one can know things are not stuck, but can also be noisy.openstack.fnmatchโopenstacksdkwill try to usefnmatch(https://pymotw.com/2/fnmatch/) on givenname_or_idarguments. Itโs a best effort attempt, so pattern misses are logged toopenstack.fnmatch. A user may not be intending to use anfnmatchpattern โ such as if they are trying to find an image namedFedora 24 [official], so these messages are logged separately.
๐ HTTP Tracing ๐
HTTP interactions are handled by keystoneauth (https://docs.openstack.org/keystoneauth/latest/). If you want to enable HTTP tracing while using openstacksdk and are not using openstack.enable_logging, set the log level of the keystoneauth logger to DEBUG.
For more information see https://docs.openstack.org/keystoneauth/latest/using-sessions.html#logging
๐ฆ Python Logging ๐ฆ
Python logging is a standard feature of Python and is documented fully in the Python Documentation.
For more information on Python Logging, see https://docs.python.org/3/library/logging.html.
๐ธ Statistics reporting ๐ธ
openstacksdk can report statistics on individual API requests/responses in several different formats.
Note: metrics will be reported only when corresponding client libraries (statsdfor'statsd'reporting,influxdbfor influxdb, etc.) are installed. If libraries are not available then reporting will be silently ignored.
๐ statsd ๐
statsd (https://github.com/statsd/statsd) reporting can be configured via configuration entries or environment variables.
A global metrics entry defines defaults for all clouds. Each cloud can specify a metrics section to override variables; this may be useful to separate results reported for each cloud.
metrics:
statsd:
host: __statsd_server_host__
port: __statsd_server_port__
prefix: __statsd_prefix__ (default 'openstack.api')
clouds:
a-cloud:
auth:
...
metrics:
statsd:
prefix: 'openstack.api.a-cloud'
If the STATSD_HOST, STATSD_PORT, or STATSD_PREFIX environment variables are set, they will be taken as the default values (and enable statsd reporting if no other configuration is specified).
Alternatively, statsd can be configured programmatically by passing a statsd_config dict to CloudRegion (#openstack.config.cloud_region.CloudRegion):
import openstack.config
config = openstack.config.OpenStackConfig()
cloud = config.get_one_cloud(
cloud='my-cloud',
statsd_config={
'host': 'statsd.example.com',
'port': 8125,
'prefix': 'openstack.api.my-cloud',
},
)
๐ InfluxDB ๐
Deprecated since version 4.11.0: InfluxDB support requires theinfluxdblibrary, which only supports InfluxDB 1.x and is itself deprecated. InfluxDB support inopenstacksdkis therefore also deprecated and will be removed in a future release.
InfluxDB (https://www.influxdata.com/) reporting can be configured via configuration entries.
As with statsd, each cloud can provide its own metrics section to override any global defaults.
metrics:
influxdb:
host: __influxdb_server_host__
port: __influxdb_server_port__
use_udp: __True|False__
username: __influxdb_auth_username__
password: __influxdb_auth_password__
database: __influxdb_db_name__
measurement: __influxdb_measurement_name__
timeout: __infludb_requests_timeout__
clouds:
..
InfluxDB reporting allows setting additional tags into the metrics based on the selected cloud.
clouds:
my_cloud:
profile: some_profile
...
additional_metric_tags:
environment: production
๐ Prometheus ๐
Prometheus (https://prometheus.io/) reporting is not configured via configuration entries. Unlike statsd and InfluxDB, Prometheus works on a pull basis. openstacksdk does not run the necessary HTTP service since it is a library. Instead, an application that uses openstacksdk and wants request stats collected should create a CollectorRegistry and pass it via the prometheus_config argument to CloudRegion (#openstack.config.cloud_region.CloudRegion). The application is then responsible for exposing the registry over HTTP.
import prometheus_client
import openstack.config
registry = prometheus_client.CollectorRegistry()
config = openstack.config.OpenStackConfig()
cloud = config.get_one_cloud(
cloud='my-cloud',
prometheus_config={
'collector_registry': registry,
},
)
# Use the cloud object; metrics will be recorded in the registry.
# Start the HTTP server to expose metrics to Prometheus.
prometheus_client.start_http_server(8000, registry=registry)
๐ Microversions ๐
As openstacksdk rolls out support for consuming microversions, it will do so on a call by call basis as needed. Just like with major versions, openstacksdk should have logic to handle each microversion for a given REST call it makes, with the following rules in mind:
- If an activity
openstackperforms can be done differently or more efficiently with a new microversion, the support should be added toopenstack.cloudand to the appropriateProxyclass. openstacksdkshould always attempt to use the latest microversion it is aware of for a given call, unless a microversion removes important data.- Microversion selection should under no circumstances be exposed to the user in python API calls in the
Resourcelayer or theopenstack.cloudlayer. - Microversion selection is exposed to the user in the REST layer via the
microversionargument to each REST call. - A user of the REST layer may set the default microversion by setting
{service_type}_default_microversioninclouds.yamlorOS_{service_type|upper}_DEFAULT_MICROVERSIONenvironment variable.
Note: Setting the default microversion in any circumstance other than when using the REST layer is highly discouraged. Both of the higher layers inopenstacksdkprovide data normalization as well as logic about which REST call to make. Setting the default microversion could change the behavior of the service in question in such a way thatopenstacksdkdoes not understand. If there is a feature of a service that needs a microversion and it is not already transparently exposed inopenstacksdk, please file a bug.
- If a feature is only exposed for a given microversion and cannot be simulated for older clouds without that microversion, it is ok to add it, but a clear error message should be given to the user that the given feature is not available on their cloud. (A message such as
"This cloud supports a maximum microversion of XXX for service YYY and this feature only exists on clouds with microversion ZZZ. Please contact your cloud provider for information about when this feature might be available") - When adding a feature that only exists behind a new microversion, every effort should be made to figure out how to provide the same functionality if at all possible, even if doing so is inefficient. If an inefficient workaround is employed, a warning should be provided to the user. (the userโs workaround to skip the inefficient behavior would be to stop using that
openstacksdkAPI call) An example of this is thenova"get me a network"feature. The logic of"get me a network"can be done client-side, albeit less efficiently. Adding support for the"get me a network"feature vianovamicroversion should also add support for doing the client-side workaround. - If
openstacksdkis aware of logic for more than one microversion, it should always attempt to use the latest version available for the service for that call. - Objects returned from
openstacksdkshould always go through normalization and thus should always conform toopenstacksdkโs documented data model. The objects should never look different to the user regardless of the microversion used for the REST call. - If a microversion adds new fields to an object, those fields should be added to
openstacksdkโs data model contract for that object and the data should either be filled in by performing additional REST calls if the data is available that way, or the field should have a default value ofNonewhich the user can be expected to test for when attempting to use the new value. - Microversion removes fields that are part of the existing data model contract โ bestie, be so careful here. Don't use that new microversion for that call unless you're forced to because the old microversion just isn't on the cloud you're talking to. And if the old one genuinely isn't available anymore? Then either go find the data from another source and fill it in, or shove a value of
Noneinto the field and document for the user that on some clouds the value may not exist. No silent gaps, okay? ๐ - Microversion removes a field and it's straight-up intractable โ like, impossible to work around without fundamentally breaking users? Then raise an issue with the service team in question. Hopefully a resolution can be found during the period while clouds still have the old microversion. ๐ซถ
- New calls or objects get added โ check in with the service team in question about the expected stability of the object. If there are known changes expected in the future โ even if they're like a few years off โ
openstacksdkshould take care to not add commitments to its data model for those fields/features. It is ok foropenstacksdkto not have something. It's giving restraint, and we love her for it. โจ
Note: openstacksdk does not currently have any sort of "experimental" opt-in API that would allow exposing things to a user that may not be supportable under the normal compatibility contract. If a conflict arises in the future where there is a strong desire for a feature but also a lack of certainty about its stability over time, an experimental API may want to be explored ... but concrete use cases should arise before such a thing is started. ๐ง
๐ซ Service Tokens ๐ซ
Okay so picture this: OpenStack services are talking to each other on behalf of a user โ like the Compute service (Nova) calling the Block Storage service (Cinder), or the Networking service (Neutron) โ and the whole operation just fails because the user's authentication token expired before the multi-step operation finished. So rude. ๐ญ
To solve this problem, OpenStack supports service tokens. A service token is a secondary token issued to a dedicated service account and transmitted via the X-Service-Token HTTP header alongside the primary user's X-Auth-Token header. Two tokens, one vibe. ๐
When the receiving service (such as Cinder) receives both tokens, its keystonemiddleware pipeline (https://docs.openstack.org/keystonemiddleware/latest/) validates the service token. If the service token is valid, the operation is permitted to proceed even if the user's token has expired โ provided the operation was initiated while the user's token was valid. Service tokens also allow target services to verify the identity of the calling service and authorize service-specific roles. Slay. ๐
For a detailed explanation of service users and tokens in OpenStack, see the Keystone documentation on managing service users (https://docs.openstack.org/keystone/latest/admin/manage-services.html).
๐ธ Using service tokens with openstacksdk ๐ธ
openstacksdk relies on keystoneauth (https://docs.openstack.org/keystoneauth/latest/) for HTTP communication and session management. To attach a service token to requests made by an SDK Connection, you configure a keystoneauth1.service_token.ServiceTokenAuthWrapper.
The wrapper combines two distinct authentication plugins:
- User Authentication Plugin (
user_auth) โ provides credentials for the initiating user or the calling service's standard user context (sent in theX-Auth-Tokenheader). ๐ - Service Authentication Plugin (
service_auth) โ provides credentials for the service user account (sent in theX-Service-Tokenheader). ๐ฆ
Once wrapped, the composite auth plugin is passed to a keystoneauth1.session.Session, which is then supplied to the SDK Connection constructor:
from keystoneauth1 import service_token
from keystoneauth1 import session as ks_session
import openstack.connection
auth = service_token.ServiceTokenAuthWrapper(
user_auth=user_auth,
service_auth=service_auth,
)
sess = ks_session.Session(auth=auth)
conn = openstack.connection.Connection(session=sess, region_name=region)
๐ Configuration ๐
There are two primary mechanisms available for configuring service tokens. Pick your fighter. โญ
Service user auth with a service token (oslo.config)
In an OpenStack service operational context (such as Nova communicating with Cinder), configuration is typically managed via oslo.config (https://docs.openstack.org/oslo.config/latest/).
The service configuration file defines credentials for both the target service client group (e.g. [cinder]) and the service user group ([service_user]):
[cinder]
auth_type = password
auth_url = https://identity.example.com/identity/v3
project_domain_name = Default
project_name = service
user_domain_name = Default
username = nova
password = secret-nova-password
os_region_name = RegionOne
[service_user]
send_service_user_token = true
auth_type = password
auth_url = https://identity.example.com/identity/v3
project_domain_name = Default
project_name = service
user_domain_name = Default
username = nova
password = secret-nova-password
Both plugins are loaded using keystoneauth1.loading and wrapped together:
from keystoneauth1 import loading as ks_loading
from keystoneauth1 import service_token
from keystoneauth1 import session as ks_session
import openstack.connection
from oslo_config import cfg
CONF = cfg.CONF
# Load target service auth and service token auth
cinder_auth = ks_loading.load_auth_from_conf_options(CONF, 'cinder')
service_auth = ks_loading.load_auth_from_conf_options(CONF, 'service_user')
# Wrap them so both tokens are sent
auth = service_token.ServiceTokenAuthWrapper(
user_auth=cinder_auth,
service_auth=service_auth,
)
sess = ks_session.Session(auth=auth)
conn = openstack.connection.Connection(
session=sess,
region_name=CONF.cinder.os_region_name,
)
๐ End-user credentials with a service token ๐
When an operation is initiated by an end user whose credentials are loaded from a standard clouds.yaml configuration (or an incoming request context), but the application must include a service token from its configuration file, you can combine the two sources. Two sources, one connection โ main character energy fr fr. ๐
import os
from keystoneauth1 import loading as ks_loading
from keystoneauth1 import service_token
from keystoneauth1 import session as ks_session
import openstack.config
import openstack.connection
from oslo_config import cfg
CONF = cfg.CONF
# User credentials from clouds.yaml
cloud_config = openstack.config.OpenStackConfig().get_one(
cloud=os.environ['OS_CLOUD']
)
user_auth = cloud_config.get_auth()
# Service token credentials from service configuration
service_auth = ks_loading.load_auth_from_conf_options(CONF, 'service_user')
auth = service_token.ServiceTokenAuthWrapper(
user_auth=user_auth,
service_auth=service_auth,
)
sess = ks_session.Session(auth=auth)
conn = openstack.connection.Connection(
session=sess,
region_name=CONF.cinder.os_region_name,
)
๐ Example ๐
A full runnable script demonstrating this pattern against Cinder's list-volume-types endpoint is available in the repository at examples/advanced/service_tokens.py:
#!/usr/bin/env python3
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Connect to an OpenStack cloud using service tokens.
Reads an oslo.config configuration file (defaulting to /tmp/service.conf, or
specified via --config-file) containing [cinder] and [service_user] sections.
Demonstrates sending a service token alongside the user token:
X-Auth-Token: <cinder auth token>
X-Service-Token: <nova service token>
Run with mitmweb/mitmproxy to inspect the outgoing headers::
export HTTP_PROXY=http://127.0.0.1:8080
python examples/advanced/service_tokens.py
"""
import sys
from keystoneauth1 import loading as ks_loading
from keystoneauth1 import service_token
from keystoneauth1 import session as ks_session
from oslo_config import cfg
import openstack.connection
CONF = cfg.ConfigOpts()
def _register_opts() -> None:
# Register options for the target service client group ([cinder])
cinder_group = cfg.OptGroup('cinder', title='Cinder Options')
CONF.register_group(cinder_group)
CONF.register_opts(
[cfg.StrOpt('os_region_name', default='RegionOne')],
group='cinder',
)
ks_loading.register_session_conf_options(CONF, 'cinder')
ks_loading.register_auth_conf_options(CONF, 'cinder')
# Register options for the service user token group ([service_user])
service_user_group = cfg.OptGroup(
'service_user', title='Service User Options'
)
CONF.register_group(service_user_group)
CONF.register_opts(
[cfg.BoolOpt('send_service_user_token', default=False)],
group='service_user',
)
ks_loading.register_session_conf_options(CONF, 'service_user')
ks_loading.register_auth_conf_options(CONF, 'service_user')
def main() -> None:
_register_opts()
CONF(sys.argv[1:], default_config_files=['/tmp/service.conf'])
# Load auth plugins from configuration
cinder_auth = ks_loading.load_auth_from_conf_options(CONF, 'cinder')
service_auth = ks_loading.load_auth_from_conf_options(CONF, 'service_user')
# Wrap auth plugins so both X-Auth-Token and X-Service-Token are sent
auth = service_token.ServiceTokenAuthWrapper(
user_auth=cinder_auth, service_auth=service_auth
)
sess = ks_session.Session(auth=auth)
conn = openstack.connection.Connection(
session=sess, region_name=CONF.cinder.os_region_name
)
print('Listing volume types...')
try:
vtypes = list(conn.block_storage.types())
print(f'Found {len(vtypes)} volume type(s):')
for vt in vtypes:
print(f' - {vt.name} ({vt.id})')
except Exception as exc:
print(f'ERROR: {exc}')
if __name__ == '__main__':
main()
And bestie, if you wanna actually see what's flying out on the wire โ like the X-Auth-Token and X-Service-Token headers themselves โ you can test this locally with an HTTP proxy (such as mitmproxy) to inspect them ๐:
export HTTP_PROXY=http://127.0.0.1:8080
python examples/advanced/service_tokens.py
๐ Using OpenStack Baremetal ๐
Before working with the Bare Metal service, you'll need to create a connection to your OpenStack cloud by following the Connect user guide. That's what hands you the conn variable used in the examples below ๐ซถ.
๐ Table of Contents ๐
- CRUD operations
- List Nodes
- Provisioning operations
- Manage and inspect Node
- Provide Node
The primary resource of the Bare Metal service is the node. Below are a few usage examples โ for a reference to all the available methods, see the Baremetal API reference ๐ .
๐ธ CRUD operations ๐ธ
โญ List Nodes โญ
A node is a bare metal machine. That's it, that's the whole vibe ๐ฅ๏ธ.
def list_nodes(conn):
print("List Nodes:")
for node in conn.baremetal.nodes():
print(node)
Full example: baremetal resource list โ http://opendev.org/openstack/openstacksdk/src/branch/master/examples/baremetal/list.py
๐ฆ Provisioning operations ๐ฆ
Provisioning actions are the main way to manipulate the nodes. See the Bare Metal service states documentation at https://docs.openstack.org/ironic/latest/contributor/states.html for details โ it's giving essential reading, ngl ๐.
๐ Manage and inspect Node ๐
Managing a node in the enroll provision state validates the management (IPMI, Redfish, etc) credentials and moves the node to the manageable state. Managing a node in the available state moves it to the manageable state. And in that state, extra actions become available โ things like configuring RAID or inspecting ๐ง.
Inspecting a node detects its properties by either talking to its BMC or by booting a special ramdisk. Either way she's gathering intel โจ.
def manage_and_inspect_node(conn, uuid):
node = conn.baremetal.find_node(uuid)
print('Before:', node.provision_state)
conn.baremetal.set_node_provision_state(node, 'manage')
conn.baremetal.wait_for_nodes_provision_state([node], 'manageable')
conn.baremetal.set_node_provision_state(node, 'inspect')
res = conn.baremetal.wait_for_nodes_provision_state([node], 'manageable')
print('After:', res[0].provision_state)
Full example: baremetal provisioning โ http://opendev.org/openstack/openstacksdk/src/branch/master/examples/baremetal/provisioning.py
๐ Provide Node ๐
Providing a node in the manageable provision state makes it available for deployment. Boom, she's ready ๐.
def provide_node(conn, uuid):
node = conn.baremetal.find_node(uuid)
print('Before:', node.provision_state)
conn.baremetal.set_node_provision_state(node, 'provide')
res = conn.baremetal.wait_for_nodes_provision_state([node], 'available')
print('After:', res[0].provision_state)
Full example: baremetal provisioning โ http://opendev.org/openstack/openstacksdk/src/branch/master/examples/baremetal/provisioning.py
๐ง Using OpenStack Block Storage ๐ง
Before working with the Block Storage service, you'll need to create a connection to your OpenStack cloud by following the Connect user guide. This will give you the conn variable used in the examples below ๐.
โจ Table of Contents โจ
- Working with Volumes
- Working with Snapshots and Backups
- Working with Volume Types
The Block Storage service manages volumes and the snapshots, backups and volume types associated with them. The examples below show a representative subset of what's possible โ for the complete set of operations, see the Block Storage proxy reference ๐ . (Yes, there's a whole reference, go off.)
๐ Working with Volumes ๐
To list the existing volumes, use the volumes() method, which returns a generator of Volume objects:
>>> for volume in conn.block_storage.volumes():
... print(volume.name, volume.status)
To create a volume, use the create_volume() method:
>>> volume = conn.block_storage.create_volume(name='my-volume', size=10)
To retrieve or delete a volume, use the get_volume() and delete_volume() methods. Each accepts either a volume ID or a Volume instance โ flexible, we love that ๐ซถ:
>>> volume = conn.block_storage.get_volume(volume.id)
>>> conn.block_storage.delete_volume(volume)
๐ฆ Working with Snapshots and Backups ๐ฆ
A snapshot captures the state of a volume at a point in time. Create one with create_snapshot(), list them with snapshots(), and remove them with delete_snapshot() โ it's giving time capsule energy โณ:
>>> snapshot = conn.block_storage.create_snapshot(volume_id=volume.id)
>>> for snapshot in conn.block_storage.snapshots():
... print(snapshot.name)
Backups are managed in the same way through the corresponding backups, create_backup and delete_backup methods. Same vibe, different noun ๐พ.
๐ Working with Volume Types ๐
Volume types describe the capabilities of the storage backing a volume. List the available types with types():
>>> for volume_type in conn.block_storage.types():
... print(volume_type.name)
๐ Using OpenStack Clustering ๐
Before working with the Clustering service, you'll need to create a connection to your OpenStack cloud by following the Connect user guide. This will give you the conn variable used by all examples in this guide ๐.
The primary abstractions/resources of the Clustering service are:
๐ Working with Profile Types ๐
A profile is a template used to create and manage nodes, i.e. objects exposed by other OpenStack services. A profile encodes the information needed for node creation in a property named spec. It's like a little recipe ๐งโ๐ณ.
โญ List Profile Types โญ
To examine the known profile types:
def list_profile_types(conn):
print("List Profile Types:")
for pt in conn.clustering.profile_types():
print(pt.to_dict())
Full example: manage profile type โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/profile_type.py
๐ธ Get Profile Type ๐ธ
To get the details about a profile type, you need to provide the name of it:
def get_profile_type(conn):
print("Get Profile Type:")
pt = conn.clustering.get_profile_type('os.nova.server-1.0')
print(pt.to_dict())
Full example: manage profile type โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/profile_type.py
๐ Managing Profiles ๐
A profile type can be treated as the meta-type of a Profile object. A registry of profile types is built when the Cluster service starts. When creating a Profile object, you will indicate the profile type used in its spec property โจ.
๐ List Profiles ๐
To examine the list of profiles:
def list_profiles(conn):
print("List Profiles:")
for profile in conn.clustering.profiles():
print(profile.to_dict())
for profile in conn.clustering.profiles(sort='name:asc'):
print(profile.to_dict())
When listing profiles, you can specify the sorting option using the sort parameter, and you can do pagination using the limit and marker parameters. Slay, pagination ๐
.
Full example: manage profile โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/profile.py
๐ง Create Profile ๐ง
When creating a profile, you will provide a dictionary with keys and values specified according to the profile type referenced:
def create_profile(conn):
print("Create Profile:")
spec = {
'profile': 'os.nova.server',
'version': 1.0,
'name': 'os_server',
'properties': {
'name': SERVER_NAME,
'flavor': FLAVOR_NAME,
'image': IMAGE_NAME,
'networks': {'network': NETWORK_NAME},
},
}
profile = conn.clustering.create_profile(spec)
print(profile.to_dict())
Optionally, you can specify a metadata keyword argument that contains some key-value pairs to be associated with the profile ๐ท๏ธ.
Full example: manage profile โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/profile.py
๐ฅ Find Profile ๐ฅ
To find a profile based on its name or ID:
def find_profile(conn):
print("Find Profile:")
profile = conn.clustering.find_profile('os_server')
print(profile.to_dict())
โ ๏ธ Heads up bestie: the Cluster service doesn't allow updating the spec of a profile. The only way to achieve that is to create a new profile. No cap, that's the rule.
Full example: manage profile โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/profile.py
๐ Get Profile ๐
To get a profile based on its name or ID:
def get_profile(conn):
print("Get Profile:")
profile = conn.clustering.get_profile('os_server')
print(profile.to_dict())
Full example: manage profile โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/profile.py
๐ Update Profile ๐
After a profile is created, most of its properties are immutable. Still, you can update a profile's name and/or metadata โ small mercies ๐ซถ.
def update_profile(conn):
print("Update Profile:")
profile = conn.clustering.update_profile('os_server', name='old_server')
print(profile.to_dict())
โ ๏ธ Again for the people in the back: the Cluster service doesn't allow updating the spec of a profile. The only way to achieve that is to create a new profile.
Full example: manage profile โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/profile.py
๐ Delete Profile ๐
A profile can be deleted after creation, provided that it is not referenced by any active clusters or nodes. If you attempt to delete a profile that is still in use, you will get an error message ๐ญ. Choose wisely.
def delete_profile(conn):
print("Delete Profile:")
conn.clustering.delete_profile('os_server')
print("Profile deleted.")
๐ Managing Clusters ๐
Clusters are first-class citizens in Senlin service design. A cluster is defined as a collection of homogeneous objects. The "homogeneous" here means that the objects managed (aka. Nodes) have to be instantiated from the same "profile type" โ same template, same energy ๐ฏโโ๏ธ.
๐ List Clusters ๐
To examine the list of receivers:
def list_cluster(conn):
print("List clusters:")
for cluster in conn.clustering.clusters():
print(cluster.to_dict())
for cluster in conn.clustering.clusters(sort='name:asc'):
print(cluster.to_dict())
When you're listing clusters, you can pick the sorting with the sort parameter, and you can do pagination using the limit and marker parameters. ๐
Full example: manage cluster <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/cluster.py>
๐ Create Cluster
When you create a cluster, you hand over a dictionary with keys and values that match whatever cluster type you're referencing. Easy.
def create_cluster(conn):
print("Create cluster:")
spec = {
"name": CLUSTER_NAME,
"profile_id": PROFILE_ID,
"min_size": 0,
"max_size": -1,
"desired_capacity": 1,
}
cluster = conn.clustering.create_cluster(**spec)
print(cluster.to_dict())
Optionally, you can specify a metadata keyword argument โ it holds some key-value pairs to be associated with the cluster. โจ
Full example: manage cluster <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/cluster.py>
๐ธ Get Cluster
Grab a cluster by its name or ID, like:
def get_cluster(conn):
print("Get cluster:")
cluster = conn.clustering.get_cluster(CLUSTER_ID)
print(cluster.to_dict())
Full example: manage cluster <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/cluster.py>
๐ฆ Find Cluster
Same deal for finding โ name or ID, your call:
def find_cluster(conn):
print("Find cluster:")
cluster = conn.clustering.find_cluster(CLUSTER_ID)
print(cluster.to_dict())
Full example: manage cluster <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/cluster.py>
๐ Update Cluster
Okay so once a cluster exists, most of its properties are immutable โ like, locked in, no take-backs. But you can still update a cluster's name and/or params. ๐
def update_cluster(conn):
print("Update cluster:")
spec = {
"name": "Test_Cluster001",
"profile_id": "c0e3a680-e270-4eb8-9361-e5c9503fba0a",
"profile_only": True,
}
cluster = conn.clustering.update_cluster(CLUSTER_ID, **spec)
print(cluster.to_dict())
Full example: manage cluster <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/cluster.py>
๐ Delete Cluster
A cluster can be deleted after it's been created. And heads up โ when there are nodes in the cluster, the Senlin engine launches a whole process to delete all the nodes from the cluster and destroy them before it deletes the cluster object itself. She does a full cleanup first, respect. ๐ญ
def delete_cluster(conn):
print("Delete cluster:")
conn.clustering.delete_cluster(CLUSTER_ID)
print("Cluster deleted.")
# cluster support force delete
conn.clustering.delete_cluster(CLUSTER_ID, False, True)
print("Cluster deleted")
๐ Add Nodes to Cluster
Drop some existing nodes into the cluster you specified:
def add_nodes_to_cluster(conn):
print("Add nodes to cluster:")
node_ids = [NODE_ID]
res = conn.clustering.add_nodes_to_cluster(CLUSTER_ID, node_ids)
print(res)
๐ Remove Nodes from Cluster
Yeet nodes out of the specified cluster:
def remove_nodes_from_cluster(conn):
print("Remove nodes from a cluster:")
node_ids = [NODE_ID]
res = conn.clustering.remove_nodes_from_cluster(CLUSTER_ID, node_ids)
print(res)
๐ฅ Replace Nodes in Cluster
Swap out some existing nodes in the specified cluster for new ones:
def replace_nodes_in_cluster(conn):
print("Replace the nodes in a cluster with specified nodes:")
old_node = NODE_ID
new_node = "cd803d4a-015d-4223-b15f-db29bad3146c"
spec = {old_node: new_node}
res = conn.clustering.replace_nodes_in_cluster(CLUSTER_ID, **spec)
print(res)
๐ Cluster Scale Out
Inflate the size of a cluster. Bigger! ๐
def scale_out_cluster(conn):
print("Inflate the size of a cluster:")
res = conn.clustering.scale_out_cluster(CLUSTER_ID, 1)
print(res)
๐ง Cluster Scale In
Shrink the size of a cluster. Smaller! ๐ซง
def scale_out_cluster(conn):
print("Inflate the size of a cluster:")
res = conn.clustering.scale_out_cluster(CLUSTER_ID, 1)
print(res)
Ngl bestie, the original page literally prints this exact same scale_out_cluster example under "Scale In" too โ I'm not making it up, I'm just faithfully passing the copy-paste along. ๐
โญ Cluster Resize
Resize of cluster. You get the whole spec treatment here:
def resize_cluster(conn):
print("Resize of cluster:")
spec = {
'min_size': 1,
'max_size': 6,
'adjustment_type': 'EXACT_CAPACITY',
'number': 2,
}
res = conn.clustering.resize_cluster(CLUSTER_ID, **spec)
print(res)
๐ Attach Policy to Cluster
Once a policy is attached (bound) to a cluster, it gets enforced whenever related actions are performed on that cluster โ unless the policy is (temporarily) disabled on the cluster. The way it just kicks in automatically, iconic.
def attach_policy_to_cluster(conn):
print("Attach policy to a cluster:")
spec = {'enabled': True}
res = conn.clustering.attach_policy_to_cluster(
CLUSTER_ID, POLICY_ID, **spec
)
print(res)
๐ซถ Detach Policy from Cluster
Once a policy is attached to a cluster, it can be detached from the cluster whenever the user requests it. No strings. โจ
def detach_policy_from_cluster(conn):
print("Detach a policy from a cluster:")
res = conn.clustering.detach_policy_from_cluster(CLUSTER_ID, POLICY_ID)
print(res)
๐ธ Cluster Check
Check the cluster's health status โ cluster members can be checked too. Glow-up check for the whole squad. ๐
def check_cluster(conn):
print("Check cluster:")
res = conn.clustering.check_cluster(CLUSTER_ID)
print(res)
๐ฆ Cluster Recover
To restore a specified cluster, the members in the cluster get checked:
def recover_cluster(conn):
print("Recover cluster:")
spec = {'check': True}
res = conn.clustering.recover_cluster(CLUSTER_ID, **spec)
print(res)
๐ Managing Nodes
A node is a logical object managed by the Senlin service. Real talk: a node can be a member of at most one cluster at any given time. A node can also be an orphan node โ which just means it doesn't belong to any clusters. Solo era. ๐
๐ List Nodes
To examine the list of Nodes:
def list_nodes(conn):
print("List Nodes:")
for node in conn.clustering.nodes():
print(node.to_dict())
for node in conn.clustering.nodes(sort='asc:name'):
print(node.to_dict())
When you're listing nodes, you can specify the sorting option using the sort parameter, and you can do pagination using the limit and marker parameters.
Full example: manage node <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/node.py>
๐ Create Node
When creating a node, you provide a dictionary with keys and values according to the node type you referenced:
def create_node(conn):
print("Create Node:")
spec = {
'name': NODE_NAME,
'profile_id': PROFILE_ID,
}
node = conn.clustering.create_node(**spec)
print(node.to_dict())
Optionally, you can specify a metadata keyword argument that contains some key-value pairs to be associated with the node. ๐
Full example: manage node <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/node.py>
๐ Get Node
To get a node based on its name or ID:
def get_node(conn):
print("Get Node:")
node = conn.clustering.get_node(NODE_ID)
print(node.to_dict())
Full example: manage node <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/node.py>
โญ Find Node
To find a node based on its name or ID:
def find_node(conn):
print("Find Node:")
node = conn.clustering.find_node(NODE_ID)
print(node.to_dict())
Full example: manage node <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/node.py>
๐ฅ Update Node
After a node is created, most of its properties are immutable. Still, you can update a node's name and/or params. ๐
def update_node(conn):
print("Update Node:")
spec = {
'name': 'Test_Node01',
'profile_id': 'c0e3a680-e270-4eb8-9361-e5c9503fba0b',
}
node = conn.clustering.update_node(NODE_ID, **spec)
print(node.to_dict())
Full example: manage node <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/node.py>
๐ Delete Node
A node can be deleted after creation โ provided that it isn't referenced by any active clusters. Try to delete a node that's still in use and you'll get an error message, bestie. That's the vibe check saying no.
def delete_node(conn):
print("Delete Node:")
conn.clustering.delete_node(NODE_ID)
print("Node deleted.")
# node support force delete
conn.clustering.delete_node(NODE_ID, False, True)
print("Node deleted")
Full example: manage node <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/node.py>
๐ซถ Check Node
If the underlying physical resource is not healthy, the node gets set to ERROR status. Not the cute kind of error. ๐ญ
def check_node(conn):
print("Check Node:")
node = conn.clustering.check_node(NODE_ID)
print(node)
Full example: manage node <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/node.py>
๐ง Recover Node
To restore a specified node:
def recover_node(conn):
print("Recover Node:")
spec = {'check': True}
node = conn.clustering.recover_node(NODE_ID, **spec)
print(node)
๐ Working with Policy Types
A policy is a template that encodes the information needed for specifying the rules that are checked/enforced before/after certain actions are performed on a cluster. Those rules are encoded in a property named spec. So spec is the main character here, fr fr.
๐ธ List Policy Types
To examine the known policy types:
def list_policy_types(conn):
print("List Policy Types:")
for pt in conn.clustering.policy_types():
print(pt.to_dict())
Full example: manage policy type <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/policy_type.py>
๐ฆ Get Policy Type
To retrieve the details about a policy type, you need to provide its name:
def get_policy_type(conn):
print("Get Policy Type:")
pt = conn.clustering.get_policy_type('senlin.policy.deletion-1.0')
print(pt.to_dict())
Full example: manage policy type <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/policy_type.py>
๐ Managing Policies
Okay so listen โ a policy type is basically the meta-type of a Policy object, right? Like the blueprint for the blueprint. โจ A whole registry of these policy types gets built the moment the Cluster service starts up. And when you're creating a Policy object, you tell it which policy type you're using inside its spec property. That's the whole vibe.
๐ List Policies
Wanna see all the policies? Say less:
def list_policies(conn):
print("List Policies:")
for policy in conn.clustering.policies():
print(policy.to_dict())
for policy in conn.clustering.policies(sort='name:asc'):
print(policy.to_dict())
When you're listing policies you can totally set the sorting with the sort parameter, and pagination is yours via the limit and marker parameters. Slay.
Full example: manage policy <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/policy.py>
๐ธ Create Policy
When you're creating a policy you hand over a dictionary of keys and values that line up with whatever policy type you referenced. Like this:
def create_policy(conn):
print("Create Policy:")
attrs = {
'name': 'dp01',
'spec': {
'policy': 'senlin.policy.deletion',
'version': 1.0,
'properties': {
'criteria': 'oldest_first',
'destroy_after_deletion': True,
},
},
}
policy = conn.clustering.create_policy(attrs)
print(policy.to_dict())
Optionally โ and this is a cute little extra โ you can pass a metadata keyword argument stuffed with key-value pairs to associate with the policy. ๐ซถ
Full example: manage policy <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/policy.py>
๐ฆ Find Policy
Wanna find a policy by its name or ID? Here ya go:
def find_policy(conn):
print("Find Policy:")
policy = conn.clustering.find_policy('dp01')
print(policy.to_dict())
Full example: manage policy <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/policy.py>
๐ Get Policy
Getting a policy based on its name or ID, bestie:
def get_policy(conn):
print("Get Policy:")
policy = conn.clustering.get_policy('dp01')
print(policy.to_dict())
Full example: manage policy <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/policy.py>
โญ Update Policy
So once a policy exists, most of its properties are immutable โ like, locked in, no take-backs. But you can still update a policy's name and/or metadata:
def update_policy(conn):
print("Update Policy:")
policy = conn.clustering.update_policy('dp01', name='dp02')
print(policy.to_dict())
โ ๏ธ Heads up: the Cluster service does not allow updating the spec of a policy. The only way to pull that off is to create a brand new policy. Periodt.
Full example: manage policy <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/policy.py>
๐ Delete Policy
A policy can be deleted after it's created โ provided it's not referenced by any active clusters or nodes. Try to delete one that's still in use and you'll get an error message, ngl. ๐ญ
def delete_policy(conn):
print("Delete Policy:")
conn.clustering.delete_policy('dp01')
print("Policy deleted.")
๐ Managing Receivers
Receivers are the event sinks tied to senlin clusters โ think of them as the inbox for events. So when some monitoring software spots certain events (or alarms), that software can notify the senlin clusters about them. And when senlin gets those notifications? It can automatically trigger predefined operations with preset parameter values. Main character energy, honestly. ๐
๐ List Receivers
To peek at the list of receivers:
def list_receivers(conn):
print("List Receivers:")
for receiver in conn.clustering.receivers():
print(receiver.to_dict())
for receiver in conn.clustering.receivers(sort='name:asc'):
print(receiver.to_dict())
When you're listing receivers, the sort parameter handles sorting for you, and you can do pagination with the limit and marker parameters. ๐
Full example: manage receiver <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/receiver.py>
๐ง Create Receiver
When you create a receiver, you pass a dictionary of keys and values that match the receiver type you referenced:
def create_receiver(conn):
print("Create Receiver:")
# Build the receiver attributes and create the recever.
spec = {
"action": "CLUSTER_SCALE_OUT",
"cluster_id": CLUSTER_ID,
"name": FAKE_NAME,
"params": {"count": "1"},
"type": "webhook",
}
receiver = conn.clustering.create_receiver(**spec)
print(receiver.to_dict())
Optionally, you can throw in a metadata keyword argument โ a bunch of key-value pairs to associate with the receiver. ๐
Full example: manage receiver <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/receiver.py>
๐ Get Receiver
Getting a receiver by its name or ID:
def get_receiver(conn):
print("Get Receiver:")
receiver = conn.clustering.get_receiver(FAKE_NAME)
print(receiver.to_dict())
Full example: manage receiver <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/receiver.py>
๐ฅ Find Receiver
Finding a receiver by its name or ID:
def find_receiver(conn):
print("Find Receiver:")
receiver = conn.clustering.find_receiver(FAKE_NAME)
print(receiver.to_dict())
Full example: manage receiver <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/receiver.py>
๐ธ Update Receiver
Once a receiver exists, most of its properties are immutable. But bestie, you can update a receiver's name and/or params:
def update_receiver(conn):
print("Update Receiver:")
spec = {"name": "test_receiver2", "params": {"count": "2"}}
receiver = conn.clustering.update_receiver(FAKE_NAME, **spec)
print(receiver.to_dict())
Full example: manage receiver <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/receiver.py>
๐ฆ Delete Receiver
A receiver can be deleted after creation โ provided it's not referenced by any active clusters. Try to delete one that's still in use and you'll get an error message. ๐
def delete_receiver(conn):
print("Delete Receiver:")
conn.clustering.delete_receiver(FAKE_NAME)
print("Receiver deleted.")
โก Working with Actions
An action is basically an abstraction of some logic that a worker thread can execute. Most of the operations Senlin supports run asynchronously โ meaning they get queued up into the database and then picked up by a certain worker thread for execution. Queue it and forget it, iykyk. ๐
โญ List Actions
To look at the list of actions:
def list_actions(conn):
print("List Actions:")
for actions in conn.clustering.actions():
print(actions.to_dict())
for actions in conn.clustering.actions(sort='name:asc'):
print(actions.to_dict())
When listing actions, sort handles your sorting, and pagination is done with the limit and marker parameters. โจ
Full example: manage action <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/action.py>
๐ Get Action
Getting an action by its name or ID:
def get_action(conn):
print("Get Action:")
action = conn.clustering.get_action(ACTION_ID)
print(action.to_dict())
๐ฆ Working with Events
An event is a record generated during engine execution. It captures what happened inside the senlin-engine. The senlin-engine service generates those event records while it's performing actions or checking policies. Receipts, basically. ๐งพ
๐ List Events
To examine the list of events:
def list_events(conn):
print("List Events:")
for events in conn.clustering.events():
print(events.to_dict())
for events in conn.clustering.events(sort='name:asc'):
print(events.to_dict())
When listing events, the sort parameter sorts them, and you can paginate using the limit and marker parameters. ๐ธ
Full example: manage event <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/clustering/event.py>
๐ Get Event
Getting an event by its name or ID:
def get_event(conn):
print("Get Event:")
event = conn.clustering.get_event(EVENT_ID)
print(event.to_dict())
๐ Using OpenStack Compute
Before you start working with the Compute service, you gotta create a connection to your OpenStack cloud โ just follow the Connect <> user guide. That'll hand you the conn variable used in all the examples below. ๐ซถ
๐ Table of Contents
- List Servers
- List Images
- List Flavors
- List Networks
- Create Key Pair
- Create Server
The primary resource of the Compute service is the server. Periodt.
๐ป List Servers
A server is a virtual machine that gives you access to a compute instance being run by your cloud provider.
def list_servers(conn):
print("List Servers:")
for server in conn.compute.servers():
print(server)
Full example: compute resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/compute/list.py>
๐ผ๏ธ List Images
An image is the operating system you want to use for your server. ๐ฟ
def list_images(conn):
print("List Images:")
for image in conn.compute.images():
print(image)
Full example: compute resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/compute/list.py>
๐ List Flavors
A flavor is the resource configuration for a server โ every flavor is a unique combo of disk, memory, vCPUs, and network bandwidth. ๐ฐ
def list_flavors(conn):
print("List Flavors:")
for flavor in conn.compute.flavors():
print(flavor)
Full example: compute resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/compute/list.py>
๐ List Networks
A network provides connectivity to servers.
def list_networks(conn):
print("List Networks:")
for network in conn.network.networks():
print(network)
Full example: network resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/list.py>
๐ Create Key Pair
A key pair is the public key and private key of publicโkey cryptography <https://en.wikipedia.org/wiki/Public-key_cryptography>. Bestie, they're literally how you encrypt and decrypt your login info when you connect to your server ๐โจ
def create_keypair(conn):
keypair = conn.compute.find_keypair(KEYPAIR_NAME)
if not keypair:
print("Create Key Pair:")
keypair = conn.compute.create_keypair(name=KEYPAIR_NAME)
print(keypair)
try:
os.mkdir(SSH_DIR)
except OSError as e:
if e.errno != errno.EEXIST:
raise e
with open(PRIVATE_KEYPAIR_FILE, 'w') as f:
f.write(str(keypair.private_key))
os.chmod(PRIVATE_KEYPAIR_FILE, 0o400)
return keypair
Full example: compute resource create <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/compute/create.py>
๐ฆ Create Server
Okay so at minimum a server needs a name, an image, a flavor, and a network when you create it. You can discover the names and IDs of these attributes by listing them as above and then using the find methods to grab the right resources ๐
Ideally you'll also create a server using a keypair so you can login to that server with the private key. iykyk ๐
Servers take time to boot, so we call wait_for_server to wait for it to become active โ patience, queen ๐
def create_server(conn):
print("Create Server:")
image = conn.image.find_image(IMAGE_NAME)
flavor = conn.compute.find_flavor(FLAVOR_NAME)
network = conn.network.find_network(NETWORK_NAME)
keypair = create_keypair(conn)
server = conn.compute.create_server(
name=SERVER_NAME,
image_id=image.id,
flavor_id=flavor.id,
networks=[{"uuid": network.id}],
key_name=keypair.name,
)
server = conn.compute.wait_for_server(server)
print(f"ssh -i {PRIVATE_KEYPAIR_FILE} root@{server.access_ipv4}")
Full example: compute resource create <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/compute/create.py>
๐ธ Using OpenStack Database
Before working with the Database service, you'll need to create a connection to your OpenStack cloud by following the Connect <> user guide. That's what gives you the conn variable used in the examples below ๐ซถ
โจ Table of Contents
- Working with Instances
- Working with Databases and Users
- Working with Flavors
The Database service provisions database instances and manages the databases, users and flavors associated with them. The examples below show a representative subset of what's possible โ for the complete set of operations, see the Database proxy reference <> ๐
๐ Working with Instances
To list the existing database instances, use the instances() method, which returns a generator of Instance <#openstack.database.v1.instance.Instance> objects:
>>> for instance in conn.database.instances():
... print(instance.name, instance.status)
To create an instance, use the create_instance() method. To retrieve or delete one, use get_instance() and delete_instance():
>>> instance = conn.database.create_instance(
... name='my-instance', flavor_reference=flavor.id, volume={'size': 5})
>>> conn.database.delete_instance(instance)
๐ Working with Databases and Users
Databases and users are created against an existing instance. Use create_database() and create_user(), and list them with databases() and users():
>>> conn.database.create_database(instance, name='my-database')
>>> conn.database.create_user(
... instance, name='alice', password='s3cret')
๐ Working with Flavors
Flavors describe the compute and memory resources of an instance. List the available flavors with flavors():
>>> for flavor in conn.database.flavors():
... print(flavor.name)
๐ง Using OpenStack DNS
Before working with the DNS service, you'll need to create a connection to your OpenStack cloud by following the Connect <> user guide. That'll hand you the conn variable used in the examples below โจ
๐ Table of Contents
- List Zones
- List Recordsets
- Create Zone
- Create Recordset
- Delete Zone
- Delete Recordset
- Find Zone
- Find Recordset
The primary resource of the DNS service is the server. (Yes, that's what it says. Not me, the docs ๐)
๐ธ List Zones
Zone is a logical grouping of DNS records for a domain, allowing for the centralized management of DNS resources, including domain names, nameservers, and DNS queries ๐๏ธ
def list_zones(conn):
print("List Zones:")
for zone in conn.dns.zones():
print(zone)
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ฆ List Recordsets
Recordsets allow for the centralized management of various DNS records within a Zone, helping to define how a domain responds to different types of DNS queries ๐
def list_recordsets(conn, name_or_id):
print("List Recordsets for Zone")
zone = conn.dns.find_zone(name_or_id)
if zone:
zone_id = zone.id
recordsets = conn.dns.recordsets(zone_id)
for recordset in recordsets:
print(recordset)
else:
print("Zone not found.")
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ Create Zone
Create a zone. It allows users to define and manage the DNS namespace for a particular domain ๐
def create_zone(
conn,
name,
email,
ttl=3600,
description="Default description",
zone_type="PRIMARY",
):
print("Create Zone: ")
zone = {
"name": name,
"email": email,
"ttl": ttl,
"description": description,
"type": zone_type,
}
print(conn.dns.create_zone(**zone))
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ Create Recordset
Create a recordset. It accepts several parameters that define the DNS record's properties and sends an API request to OpenStack to create the recordset within a specified DNS zone ๐ฅ
def create_recordset(
conn,
name_or_id,
recordset_name,
recordset_type="A",
records=["192.168.1.1"],
ttl=3600,
description="Default description",
):
print("Create Recordset: ")
zone = conn.dns.find_zone(name_or_id)
if not zone:
print("Zone not found.")
return None
zone_id = zone.id
recordset_data = {
"name": recordset_name,
"type": recordset_type,
"records": records,
"ttl": ttl,
"description": description,
}
print(conn.dns.create_recordset(zone_id, **recordset_data))
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ Delete Zone
Delete a zone. It allows users to completely delete the DNS management for a specified domain ๐
def delete_zone(conn, name_or_id):
print(f"Delete Zone: {name_or_id}")
zone = conn.dns.find_zone(name_or_id)
if zone:
conn.dns.delete_zone(zone.id)
else:
return None
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ง Delete Recordset
Delete a recordset. Just... poof, gone โจ
def delete_recordset(conn, name_or_id, recordset_name):
print(f"Deleting Recordset: {recordset_name} in Zone: {name_or_id}")
zone = conn.dns.find_zone(name_or_id)
if zone:
try:
recordset = conn.dns.find_recordset(zone.id, recordset_name)
if recordset:
conn.dns.delete_recordset(recordset, zone.id)
else:
print("Recordset not found")
except Exception as e:
print(f"{e}")
else:
return None
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ Find Zone
The find_zone function searches for and returns a DNS zone by its name using a given connection object ๐
def find_zone(conn, name_or_id):
print(f"Find Zone: {name_or_id}")
zone = conn.dns.find_zone(name_or_id)
if zone:
print(zone)
return zone
else:
print("Zone not found.")
return None
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ฆ Find Recordset
The find_recordset function searches for a DNS recordset with a specific name and type within a given zone. If multiple recordsets with the same name exist, the record type can be specified to find the exact match ๐ฏ
def find_recordset(conn, name_or_id, recordset_name, recordset_type=None):
print(f"Find Recordset: {recordset_name} in Zone: {name_or_id}")
zone = conn.dns.find_zone(name_or_id)
if not zone:
print("Zone not found.")
return None
zone_id = zone.id
try:
if recordset_type:
recordset = conn.dns.find_recordset(
zone_id, recordset_name, type=recordset_type
)
else:
recordset = conn.dns.find_recordset(zone_id, recordset_name)
if recordset:
print(recordset)
return recordset
else:
print("Recordset not found in Zone.")
return None
except Exception as e:
print(f"{e}")
return None
Full example: dns resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/dns/list.py>
๐ Using OpenStack Identity
Before working with the Identity service, you'll need to create a connection to your OpenStack cloud by following the Connect <> user guide. That's the whole vibe check that gives you the conn variable used in the examples below ๐ซถ
okay so the OpenStack Identity service is literally the default identity management system for OpenStack, no cap. Its authentication process confirms who a user is and checks an incoming request by validating the credentials that user hands over. At first, those credentials are a user name and password, or a user name and API key. Once the Identity service validates them, it issues an authentication token that the user sends in later requests. That token is an alpha-numeric text string that unlocks access to OpenStack APIs and resources. It can be revoked at any time, and itโs only valid for a finite duration. ๐
๐ List Users ๐
A user is a digital representation of a person, system, or service that uses OpenStack cloud services. The Identity service validates that incoming requests are made by the user who claims to be making the call. Users have a login and can access resources by using assigned tokens. Users can be directly assigned to a particular project and behave as if they are contained in that project. Periodt.
def list_users(conn):
print("List Users:")
for user in conn.identity.users():
print(user)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
๐ List Credentials ๐
Credentials are data that confirms the identity of the user. For example: user name and password, user name and API key, or an authentication token that the Identity service provides. Iconic little identity receipts, honestly.
def list_credentials(conn):
print("List Credentials:")
for credential in conn.identity.credentials():
print(credential)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
๐ฆ List Projects ๐ฆ
A project is a container that groups or isolates resources or identity objects. Itโs giving organizational bubble, and we love that for it.
def list_projects(conn):
print("List Projects:")
for project in conn.identity.projects():
print(project)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
๐ธ List Domains ๐ธ
A domain is an Identity service API v3 entity and represents a collection of projects and users that defines administrative boundaries for the management of Identity entities. Users can be granted the administrator role for a domain. A domain administrator can create projects, users, and groups in a domain and assign roles to users and groups in a domain.
def list_domains(conn):
print("List Domains:")
for domain in conn.identity.domains():
print(domain)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
๐ซถ List Groups ๐ซถ
A group is an Identity service API v3 entity and represents a collection of users that are owned by a domain. A group role granted to a domain or project applies to all users in the group. Adding users to, or removing users from, a group respectively grants, or revokes, their role and authentication to the associated domain or project.
def list_groups(conn):
print("List Groups:")
for group in conn.identity.groups():
print(group)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
โจ List Services โจ
A service is an OpenStack service, such as Compute, Object Storage, or Image service, that provides one or more endpoints through which users can access resources and perform operations.
def list_services(conn):
print("List Services:")
for service in conn.identity.services():
print(service)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
๐ List Endpoints ๐
An endpoint is a network-accessible address, usually a URL, through which you can access a service.
def list_endpoints(conn):
print("List Endpoints:")
for endpoint in conn.identity.endpoints():
print(endpoint)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
๐ List Regions ๐
A region is an Identity service API v3 entity and represents a general division in an OpenStack deployment. You can associate zero or more sub-regions with a region to make a tree-like structured hierarchy.
def list_regions(conn):
print("List Regions:")
for region in conn.identity.regions():
print(region)
Full example: identity resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/identity/list.py
๐ฆ Using OpenStack Image ๐ฆ
Before working with the Image service, youโll need to create a connection to your OpenStack cloud by following the Connect <> user guide. This will provide you with the conn variable used in the examples below.
The primary resource of the Image service is the image. Main character energy, obviously.
๐ List Images ๐
An image is a collection of files for a specific operating system that you use to create or rebuild a server. OpenStack provides pre-built images โ http://docs.openstack.org/image-guide/obtain-images.html. You can also create custom images, or snapshots, from servers that you have launched. Images come in different formats and are sometimes called virtual machine images. Obsessed.
def list_images(conn):
print("List Images:")
for image in conn.image.images():
print(image)
Full example: image resource list โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/image/list.py
๐ Create Image ๐
Create an image by uploading its data and setting its attributes. Thatโs the whole vibe.
def upload_image(conn):
print("Upload Image:")
# Load fake image data for the example.
data = 'This is fake image data.'
# Build the image attributes and upload the image.
image_attrs = {
'name': EXAMPLE_IMAGE_NAME,
'data': data,
'disk_format': 'raw',
'container_format': 'bare',
'visibility': 'public',
}
conn.image.upload_image(**image_attrs)
Full example: image resource create โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/image/create.py
๐ง Create Image via interoperable image import process ๐ง
Create an image, then use interoperable image import process to download data from a web URL.
For more information about the image import process, please check interoperable image import โ https://docs.openstack.org/glance/latest/admin/interoperable-image-import.html
def import_image(conn):
print("Import Image:")
# Url where glance can download the image
uri = (
'https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img'
)
# Build the image attributes and import the image.
image_attrs = {
'name': EXAMPLE_IMAGE_NAME,
'disk_format': 'qcow2',
'container_format': 'bare',
'visibility': 'public',
}
image = conn.image.create_image(**image_attrs)
conn.image.import_image(image, method="web-download", uri=uri)
Full example: image resource import โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/image/import.py
๐ Downloading an Image with stream=True ๐
As images are often very large pieces of data, storing their entire contents in the memory of your application can be less than desirable. A more efficient method may be to iterate over a stream of the response data.
By choosing to stream the response content, you determine the chunk_size that is appropriate for your needs, meaning only that many bytes of data are read for each iteration of the loop until all data has been consumed. See requests.Response.iter_content() for more information.
When you choose to stream an image download, openstacksdk is no longer able to compute the checksum of the response data for you. This example shows how you might do that yourself, in a very similar manner to how the library calculates checksums for non-streamed responses. Ngl, youโre on checksum duty now.
def download_image_stream(conn):
print("Download Image via streaming:")
# Find the image you would like to download.
image = conn.image.find_image("myimage")
# As the actual download now takes place outside of the library
# and in your own code, you are now responsible for checking
# the integrity of the data. Create an MD5 has to be computed
# after all of the data has been consumed.
md5 = hashlib.md5(usedforsecurity=False)
with open("myimage.qcow2", "wb") as local_image:
response = conn.image.download_image(image, stream=True)
# Read only 1 MiB of memory at a time until
# all of the image data has been consumed.
for chunk in response.iter_content(chunk_size=1024 * 1024):
# With each chunk, add it to the hash to be computed.
md5.update(chunk)
local_image.write(chunk)
# Now that you've consumed all of the data the response gave you,
# ensure that the checksums of what the server offered and
# what you downloaded are the same.
if response.headers["Content-MD5"] != md5.hexdigest():
raise Exception("Checksum mismatch in downloaded content")
๐ Downloading an Image with stream=False ๐
If you wish to download an imageโs contents all at once and to memory, simply set stream=False, which is the default. Easy.
def download_image(conn):
print("Download Image:")
# Find the image you would like to download.
image = conn.image.find_image("myimage")
with open("myimage.qcow2", "w") as local_image:
response = conn.image.download_image(image)
# Response will contain the entire contents of the Image.
local_image.write(response)
Full example: image resource download โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/image/download.py
๐ Delete Image ๐
Delete an image. Bye bestie.
def delete_image(conn):
print("Delete Image:")
example_image = conn.image.find_image(EXAMPLE_IMAGE_NAME)
conn.image.delete_image(example_image, ignore_missing=False)
Full example: image resource delete โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/image/delete.py
๐ Using OpenStack Key Manager ๐
Okay bestie, before you can vibe with the Key Manager service, you gotta make a connection to your OpenStack cloud by following the Connect <> user guide. That's what gives you the conn variable used in all the examples below, periodt โจ
๐ Table of Contents ๐
- Create a Secret
- List Secrets
- Get Secret Payload
- Find Secret
- Delete Secret
- Create a Secret Consumer
- List Secret Consumers
- Delete Secret Consumer
โ ๏ธ Note, bestie: some interactions with the Key Manager service differ from other services in that resources do not have a properidparameter, and likeโฆ you need that for some calls ๐ญ Instead, resources have a separately namedidattribute, e.g., the Secret resource hassecret_id. The examples below show you exactly when to pass in those id values. Don't skip this, iykyk ๐
๐ Create a Secret
The Key Manager service lets you create new secrets by passing the attributes of the Secret <#openstack.key_manager.v1.secret.Secret> to the create_secret() method. Slay ๐ซถ
def create_secret(conn):
print("Create a secret:")
conn.key_manager.create_secret(
name="My public key",
secret_type="public",
expiration="2020-02-28T23:59:59",
payload="ssh rsa...",
payload_content_type="text/plain",
)
๐ List Secrets
Once you've stored some secrets, they're available for you to list via the secrets() method. This method returns a generator, which yields each Secret <#openstack.key_manager.v1.secret.Secret>. Iconic behavior honestly โจ
def list_secrets(conn):
print("List Secrets:")
for secret in conn.key_manager.secrets():
print(secret)
The secrets() method can also make more advanced queries to limit the secrets that are returned. Fancy ๐
def list_secrets_query(conn):
print("List Secrets:")
for secret in conn.key_manager.secrets(
secret_type="symmetric", expiration="gte:2020-01-01T00:00:00"
):
print(secret)
๐ Get Secret Payload
Once you've received a Secret <#openstack.key_manager.v1.secret.Secret>, you can obtain the payload for it by passing the secret's id value to the secrets() method. Use the secret_id attribute when making this request โ yes, the separately-named one, that's the whole vibe check from earlier ๐
def get_secret_payload(conn):
print("Get a secret's payload:")
# Assuming you have an object `s` which you perhaps received from
# a conn.key_manager.secrets() call...
secret = conn.key_manager.get_secret(s.secret_id)
print(secret.payload)
๐ Find Secret
To find a secret by name or ID, use the find_secret() method. This method can search for a Secret <#openstack.key_manager.v1.secret.Secret> by either its name or ID, making it flexible when you don't have the exact secret ID. Literally so convenient ๐ธ
def find_secret(conn, name_or_id):
print(f"Find Secret: {name_or_id}")
secret = conn.key_manager.find_secret(name_or_id)
if secret:
print(secret)
return secret
else:
print("Secret not found")
return None
๐๏ธ Delete Secret
To delete a secret, use the delete_secret() method. The secret can be identified by its ID or by using find_secret() to locate it by name first. Main character energy from find_secret() ngl ๐
def delete_secret(conn, name_or_id):
print(f"Delete Secret: {name_or_id}")
secret = conn.key_manager.find_secret(name_or_id)
if secret:
conn.key_manager.delete_secret(secret)
else:
print("Secret not found")
๐ง Create a Secret Consumer
The Key Manager service lets you create a secret consumer by passing the attributes of the SecretConsumer <#openstack.key_manager.v1.secret_consumer.SecretConsumer> to the create_secret_consumer() method. Obsessed ๐
def create_secret_consumer(conn):
print("Create a secret consumer:")
secret = conn.key_manager.find_secret("My public key")
conn.key_manager.create_secret_consumer(
secret=secret,
service="service",
resource_type="resource_type",
resource_id="resource-id",
)
๐ List Secret Consumers
The Key Manager service lets you list secret consumers by passing the attributes of the SecretConsumer <#openstack.key_manager.v1.secret_consumer.SecretConsumer> to the secret_consumers() method.
def list_secret_consumers(conn, secret):
print("List Secret Consumers:")
for consumer in conn.key_manager.secret_consumers(secret=secret):
print(consumer)
โ Delete Secret Consumer
The Key Manager service lets you delete a secret consumer by passing the attributes of the SecretConsumer <#openstack.key_manager.v1.secret_consumer.SecretConsumer> to the delete_secret_consumer() method. Bye bestie ๐
def delete_secret_consumer(conn, secret):
print("Delete a secret consumer:")
conn.key_manager.delete_secret_consumer(
secret=secret,
service="service",
resource_type="resource_type",
resource_id="resource-id",
)
๐ Using OpenStack Message ๐
Before working with the Message service, you'll need to create a connection to your OpenStack cloud by following the Connect <> user guide. That gives you the conn variable used in the examples below. Yes, same drill every time, it's giving consistent ๐
๐ Table of Contents ๐
- Working with Queues
- Working with Messages
- Subscriptions and Claims
The Message service provides message queues, along with the messages, subscriptions and claims associated with them. The examples below show a representative subset of what's possible; for the complete set of operations, see the Message proxy reference <>. Lowkey there's so much more, go look ๐ฅ
๐ฌ Working with Queues
To list the existing queues, use the queues() method, which returns a generator of Queue objects. Create and delete queues with create_queue() and delete_queue():
>>> queue = conn.message.create_queue(name='my-queue')
>>> for queue in conn.message.queues():
... print(queue.name)
โ๏ธ Working with Messages
Producers post messages to a queue with post_message(), and consumers read them back with messages():
>>> conn.message.post_message(
... queue.name, messages=[{'body': 'hello', 'ttl': 300}])
>>> for message in conn.message.messages(queue.name):
... print(message.body)
๐งพ Subscriptions and Claims
Subscriptions notify an endpoint when messages arrive; manage them with create_subscription() and subscriptions(). Claims let a consumer reserve a batch of messages for processing; manage them with create_claim() and the related claim methods. Cute little system, honestly ๐ฆ
๐ Using OpenStack Network ๐
Before working with the Network service, you'll need to create a connection to your OpenStack cloud by following the Connect <> user guide. Same deal, that's where conn comes from, you know the vibe by now ๐
๐ Table of Contents ๐
- List Networks
- List Subnets
- List Ports
- List Security Groups
- List Routers
- List Network Agents
- Create Network
- Open a Port
- Accept Pings
- Delete Network
The primary resource of the Network service is the network. Periodt.
๐ธ๏ธ List Networks
A network is an isolated Layer 2 <https://en.wikipedia.org/wiki/Data_link_layer> networking segment. There are two types of networks, project and provider networks. Project networks are fully isolated and are not shared with other projects. Provider networks map to existing physical networks in the data center and provide external network access for servers. Only an OpenStack administrator can create provider networks. Networks can be connected via routers. So much lore honestly ๐ญ
def list_networks(conn):
print("List Networks:")
for network in conn.network.networks():
print(network)
Full example: network resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/list.py>
๐งฉ List Subnets
A subnet is a block of IP addresses and associated configuration state. Subnets are used to allocate IP addresses when new ports are created on a network. That's it, that's the whole subnet ๐ซถ
def list_subnets(conn):
print("List Subnets:")
for subnet in conn.network.subnets():
print(subnet)
Full example: network resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/list.py>
๐ List Ports
A port is a connection point for attaching a single device, such as the NIC <https://en.wikipedia.org/wiki/Network_interface_controller> of a server, to a network. The port also describes the associated network configuration, such as the MAC <https://en.wikipedia.org/wiki/Media_access_control> and IP addresses to be used on that port. Very demure, very network-y โจ
def list_ports(conn):
print("List Ports:")
for port in conn.network.ports():
print(port)
Full example: network resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/list.py>
๐ก๏ธ List Security Groups
A security group acts as a virtual firewall for servers. It's a container for security group rules which specify the type of network traffic and direction that is allowed to pass through a port. Protecting the servers, we love to see it ๐
def list_security_groups(conn):
print("List Security Groups:")
for port in conn.network.security_groups():
print(port)
Full example: network resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/list.py>
๐ฃ๏ธ List Routers
A router is a logical component that forwards data packets between networks. It also provides Layer 3 <https://en.wikipedia.org/wiki/Network_layer> and NAT <https://en.wikipedia.org/wiki/Network_address_translation> forwarding to provide external network access for servers on project networks. Iconic forwarding behavior ๐
def list_routers(conn):
print("List Routers:")
for router in conn.network.routers():
print(router)
Full example: network resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/list.py>
๐ค List Network Agents
A network agent is a plugin that handles various tasks used to implement virtual networks. These agents include neutron-dhcp-agent, neutron-l3-agent, neutron-metering-agent, and neutron-lbaas-agent, among others. Little worker bees fr fr ๐
def list_network_agents(conn):
print("List Network Agents:")
for agent in conn.network.agents():
print(agent)
Full example: network resource list <https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/list.py>
Create Network ๐ธ
Okay so you're making a project network and subnet. This network can be used when creating a server and lets the server talk to other servers on the same project network. Here's the function:
def create_network(conn):
print("Create Network:")
example_network = conn.network.create_network(
name='openstacksdk-example-project-network'
)
print(example_network)
example_subnet = conn.network.create_subnet(
name='openstacksdk-example-project-subnet',
network_id=example_network.id,
ip_version='4',
cidr='10.0.2.0/24',
gateway_ip='10.0.2.1',
)
print(example_subnet)
Full example: network resource create โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/create.py
Open a Port ๐
When you're creating a security group for a network, you need to open certain ports so communication can happen through them. For example, you might need to enable HTTPS access on port 443.
def open_port(conn):
print("Open a port:")
example_sec_group = conn.network.create_security_group(
name='openstacksdk-example-security-group'
)
print(example_sec_group)
example_rule = conn.network.create_security_group_rule(
security_group_id=example_sec_group.id,
direction='ingress',
remote_ip_prefix='0.0.0.0/0',
protocol='tcp',
port_range_max='443',
port_range_min='443',
ethertype='IPv4',
)
print(example_rule)
Full example: network security group create โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/security_group_rules.py
Accept Pings ๐
To ping a machine on your network inside a security group, you need to create a rule that allows inbound ICMP packets. Iconic networking behavior, honestly.
def allow_ping(conn):
print("Allow pings:")
example_sec_group = conn.network.create_security_group(
name='openstacksdk-example-security-group2'
)
print(example_sec_group)
example_rule = conn.network.create_security_group_rule(
security_group_id=example_sec_group.id,
direction='ingress',
remote_ip_prefix='0.0.0.0/0',
protocol='icmp',
port_range_max=None,
port_range_min=None,
ethertype='IPv4',
)
print(example_rule)
Full example: network security group create โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/security_group_rules.py
Delete Network ๐๏ธ
This deletes a project network and its subnets. Bye-bye, little network.
def delete_network(conn):
print("Delete Network:")
example_network = conn.network.find_network(
'openstacksdk-example-project-network'
)
for example_subnet in example_network.subnet_ids:
conn.network.delete_subnet(example_subnet, ignore_missing=False)
conn.network.delete_network(example_network, ignore_missing=False)
Full example: network resource delete โ https://opendev.org/openstack/openstacksdk/src/branch/master/examples/network/delete.py
Using OpenStack Object Store ๐ฆ
Before working with the Object Store service, you'll need to create a connection to your OpenStack cloud by following the Connect <> user guide. That gives you the conn variable used in the examples below.
Table of Contents ๐
- Working with Containers
- Listing Containers
- Creating Containers
- Working with Container Metadata
- Working with Objects
- Listing Objects
- Getting Object Data
- Uploading Objects
- Working with Object Metadata
The primary resources of the Object Store service are containers and objects. ๐
Working with Containers ๐งบ
Listing Containers ๐
To list existing containers, use the containers() method.
>>> for cont in conn.object_store.containers():
... print cont
...
openstack.object_store.v1.container.Container: {u'count': 5,
u'bytes': 500, u'name': u'my container'}
openstack.object_store.v1.container.Container: {u'count': 0,
u'bytes': 0, u'name': u'empty container'}
openstack.object_store.v1.container.Container: {u'count': 100,
u'bytes': 1000000, u'name': u'another container'}
The containers method returns a generator that yields Container <#openstack.object_store.v1.container.Container> objects. It handles pagination for you, and you can adjust that with the limit argument. By default, it yields as many containers as the service will return, and it keeps requesting until it gets no more.
>>> for cont in conn.object_store.containers(limit=500):
... print(cont)
...
<500 Containers>
... another request transparently made to the Object Store service
<500 more Containers>
...
Creating Containers ๐
To create a container, use the create_container() method.
>>> cont = conn.object_store.create_container(name="new container")
>>> cont
openstack.object_store.v1.container.Container: {'name': u'new container'}
Working with Container Metadata ๐ท๏ธ
To get the metadata for a container, use the get_container_metadata() method. This method either takes the name of a container or a Container <#openstack.object_store.v1.container.Container> object, and it returns a Container object with all of its metadata attributes set.
>>> cont = conn.object_store.get_container_metadata("new container")
openstack.object_store.v1.container.Container: {'content-length': '0',
'x-container-object-count': '0', 'name': u'new container',
'accept-ranges': 'bytes',
'x-trans-id': 'tx22c5de63466e4c05bb104-0054740c39',
'date': 'Tue, 25 Nov 2014 04:57:29 GMT',
'x-timestamp': '1416889793.23520', 'x-container-read': '.r:mysite.com',
'x-container-bytes-used': '0', 'content-type': 'text/plain; charset=utf-8'}
To set the metadata for a container, use the set_container_metadata() method. This method takes a Container <#openstack.object_store.v1.container.Container> object. For example, to grant another user write access to this container, you can call set_container_metadata passing it the Container to update and keyword argument key/value pairs representing the metadata name and value to set.
>>> acl = "big_project:another_user"
>>> conn.object_store.set_container_metadata(cont, write_ACL=acl)
openstack.object_store.v1.container.Container: {'content-length': '0',
'x-container-object-count': '0',
'name': u'my new container', 'accept-ranges': 'bytes',
'x-trans-id': 'txc3ee751f971d41de9e9f4-0054740ec1',
'date': 'Tue, 25 Nov 2014 05:08:17 GMT',
'x-timestamp': '1416889793.23520', 'x-container-read': '.r:mysite.com',
'x-container-bytes-used': '0', 'content-type': 'text/plain; charset=utf-8',
'x-container-write': 'big_project:another_user'}
Working with Objects ๐ฆ
Objects are held in containers. From an API standpoint, you work with them using similarly named methods, typically with an additional argument to specify their container.
Listing Objects ๐
To list the objects that exist in a container, use the objects() method.
If you have a Container <#openstack.object_store.v1.container.Container> object, you can pass it to objects.
>>> print cont.name
pictures
>>> for obj in conn.object_store.objects(cont):
... print obj
...
openstack.object_store.v1.container.Object:
{u'hash': u'0522d4ccdf9956badcb15c4087a0c4cb',
u'name': u'pictures/selfie.jpg', u'bytes': 15744,
'last-modified': u'2014-10-31T06:33:36.618640',
u'last_modified': u'2014-10-31T06:33:36.618640',
u'content_type': u'image/jpeg', 'container': u'pictures',
'content-type': u'image/jpeg'}
...
Similar to the containers() method, objects returns a generator which yields Object <#openstack.object_store.v1.obj.Object> objects stored in the container. It also handles pagination for you, which you can adjust with the limit parameter, otherwise making each request for the maximum that your Object Store will return.
If you have the name of a container instead of an object, you can also pass that to the objects method.
>>> for obj in conn.object_store.objects("pictures".decode("utf8"),
limit=100):
... print obj
...
<100 Objects>
... another request transparently made to the Object Store service
<100 more Objects>
Getting Object Data ๐ฅ
Once you have an Object <#openstack.object_store.v1.obj.Object>, you get the data stored inside of it with the get_object_data() method.
>>> print ob.name
message.txt
>>> data = conn.object_store.get_object_data(ob)
>>> print data
Hello, world!
Additionally, if you want to save the object to disk, the download_object() convenience method takes an Object <#openstack.object_store.v1.obj.Object> and a path to write the contents to.
>>> conn.object_store.download_object(ob, "the_message.txt")
Uploading Objects ๐ค
Once you have data you'd like to store in the Object Store service, you use the upload_object() method. This method takes the data to be stored, along with at least an object name and the container it is to be stored in.
>>> hello = conn.object_store.upload_object(container="messages",
name="helloworld.txt",
data="Hello, world!")
>>> print hello
openstack.object_store.v1.container.Object: {'content-length': '0',
'container': u'messages', 'name': u'helloworld.txt',
'last-modified': 'Tue, 25 Nov 2014 17:39:29 GMT',
'etag': '5eb63bbbe01eeed093cb22bb8f5acdc3',
'x-trans-id': 'tx3035d41b03334aeaaf3dd-005474bed0',
'date': 'Tue, 25 Nov 2014 17:39:28 GMT',
'content-type': 'text/html; charset=UTF-8'}
Working with Object Metadata ๐ท๏ธโจ
Working with metadata on objects is identical to how it's done with containers. You use the get_object_metadata() and set_object_metadata() methods.
The metadata attributes to be set can be found on the Object <#openstack.object_store.v1.obj.Object> object.
>>> secret.delete_after = 300
>>> secret = conn.object_store.set_object_metadata(secret)
We set the delete_after value to 500 seconds, causing the object to be deleted in 300 seconds, or five minutes. That attribute corresponds to the X-Delete-After header value, which you can see is returned when we retrieve the updated metadata.
Yes bestie, the original literally says500and300right there โ both numbers stay. ๐ซถ
>>> conn.object_store.get_object_metadata(ob)
openstack.object_store.v1.container.Object: {'content-length': '11',
'container': u'Secret Container',
'name': u'selfdestruct.txt', 'x-delete-after': 300,
'accept-ranges': 'bytes', 'last-modified': 'Tue, 25 Nov 2014 17:50:45 GMT',
'etag': '5eb63bbbe01eeed093cb22bb8f5acdc3',
'x-timestamp': '1416937844.36805',
'x-trans-id': 'tx5c3fd94adf7c4e1b8f334-005474c17b',
'date': 'Tue, 25 Nov 2014 17:50:51 GMT', 'content-type': 'text/plain'}
๐ผ Using OpenStack Orchestration
Okay bestie, before you touch the Orchestration service you gotta make a connection to your cloud โ follow the Connect <> user guide, and that's what hands you the conn variable used in all the examples below. No connection, no vibes. ๐
๐ Table of Contents
- Working with Stacks
- Software Configurations and Deployments
The Orchestration service creates and manages stacks โ collections of resources described by a template โ along with the software configurations and deployments applied to them. The examples below show a representative subset of what's possible; for the complete set of operations, see the Orchestration proxy reference <>. โจ
๐๏ธ Working with Stacks
To list the existing stacks, use the stacks() method, which returns a generator of Stack <#openstack.orchestration.v1.stack.Stack> objects:
>>> for stack in conn.orchestration.stacks():
... print(stack.name, stack.status)
To create a stack from a template, use the create_stack() method:
>>> stack = conn.orchestration.create_stack(
... name='my-stack',
... template_url='https://example.com/template.yaml',
... parameters={'key_name': 'my-key'})
To retrieve, update or delete a stack, use the get_stack(), update_stack() and delete_stack() methods. Each accepts either a stack ID or a Stack <#openstack.orchestration.v1.stack.Stack> instance:
>>> stack = conn.orchestration.get_stack(stack.id)
>>> conn.orchestration.delete_stack(stack)
You can validate a template before using it with validate_template(), and inspect the resources that make up a stack with resources(). Literally so helpful, ngl. ๐ฅ
๐งฉ Software Configurations and Deployments
Software configurations and the deployments that apply them to servers are managed through the corresponding create_software_config / software_configs and create_software_deployment / software_deployments methods. Slay. ๐
๐๏ธ Using OpenStack Shared File Systems
Before working with the Shared File System service, you'll need to create a connection to your OpenStack cloud by following the Connect <> user guide. This will provide you with the conn variable used in the examples below. Same drill as always, bestie โ get that conn first. ๐ซถ
๐ Table of Contents
- List Availability Zones
- Share Instances
- Get Share Instance
- Reset Share Instance Status
- Delete Share Instance
- Resize Share
- List Share Group Snapshots
- Get Share Group Snapshot
- List Share Group Snapshot Members
- Create Share Group Snapshot
- Reset Share Group Snapshot
- Update Share Group Snapshot
- Delete Share Group Snapshot
- List Share Metadata
- Get Share Metadata Item
- Create Share Metadata
- Update Share Metadata
- Delete Share Metadata
- Manage Share
- Unmanage Share
- List Share replicas
- Create Share Replica
- Get Share Replica
- Delete Share Replica
- Reset Status of Share Replica
- Reset Replica State of Share Replica
- Force Delete Share Replica
- Promote Share Replica
- Resync Share Replica
๐ List Availability Zones
A Shared File System service availability zone is a failure domain for your shared file systems. You may create a shared file system (referred to simply as shares) in a given availability zone, and create replicas of the share in other availability zones. Spreading the love, as one does. ๐
def list_availability_zones(conn):
print("List Shared File System Availability Zones:")
for az in conn.share.availability_zones():
print(az)
๐ง Share Instances
Administrators can list, show information for, explicitly set the state of, and force-delete share instances. Admin kid energy, iykyk. ๐
def share_instances(conn, **query):
print('List all share instances:')
for si in conn.share.share_instances(**query):
print(si)
๐ Get Share Instance
Shows details for a single share instance.
def get_share_instance(conn, share_instance_id):
print('Get share instance with given Id:')
share_instance = conn.share.get_share_instance(share_instance_id)
print(share_instance)
๐ Reset Share Instance Status
Explicitly updates the state of a share instance.
def reset_share_instance_status(conn, share_instance_id, status):
print(
'Reset the status of the share instance with the given '
'share_instance_id to the given status'
)
conn.share.reset_share_instance_status(share_instance_id, status)
๐ Delete Share Instance
Force-deletes a share instance. Dramatic but effective.
def delete_share_instance(conn, share_instance_id):
print('Force-delete the share instance with the given share_instance_id')
conn.share.delete_share_instance(share_instance_id)
๐ Resize Share
Shared File System shares can be resized (extended or shrunk) to a given size. For details on resizing shares, refer to the Manila docs <https://docs.openstack.org/manila/latest/user/create-and-manage-shares.html#extend-share>.
def resize_share(conn, share_id, share_size):
# Be explicit about not wanting to use force if the share
# will be extended.
use_force = False
print('Resize the share to the given size:')
conn.share.resize_share(share_id, share_size, use_force)
def resize_shares_without_shrink(conn, min_size):
# Sometimes, extending shares without shrinking
# them (effectively setting a min size) is desirable.
# Get list of shares from the connection.
shares = conn.share.shares()
# Loop over the shares:
for share in shares:
# Extend shares smaller than min_size to min_size,
# but don't shrink shares larger than min_size.
conn.share.resize_share(share.id, min_size, no_shrink=True)
๐ธ List Share Group Snapshots
A share group snapshot is a point-in-time, read-only copy of the data that is contained in a share group. You can list all share group snapshots โ like a little time capsule of your data, obsessed. ๐
def list_share_group_snapshots(conn, **query):
print("List all share group snapshots:")
share_group_snapshots = conn.share.share_group_snapshots(**query)
for share_group_snapshot in share_group_snapshots:
print(share_group_snapshot)
๐ Get Share Group Snapshot
Show share group snapshot details.
def get_share_group_snapshot(conn, group_snapshot_id):
print("Show share group snapshot with given Id:")
share_group_snapshot = conn.share.get_share_group_snapshots(
group_snapshot_id
)
print(share_group_snapshot)
๐ซ List Share Group Snapshot Members
Lists all share group snapshots members.
def share_group_snapshot_members(conn, group_snapshot_id):
print("Show share group snapshot members with given Id:")
members = conn.share.share_group_snapshot_members(group_snapshot_id)
for member in members:
print(member)
โจ Create Share Group Snapshot
Creates a snapshot from a share group.
def create_share_group_snapshot(conn, share_group_id, **attrs):
print("Creating a share group snapshot from given attributes:")
share_group_snapshot = conn.share.create_share_group_snapshot(
share_group_id, **attrs
)
print(share_group_snapshot)
๐ Reset Share Group Snapshot
Reset share group snapshot state.
def reset_share_group_snapshot_status(conn, group_snapshot_id, status):
print("Reseting the share group snapshot status:")
conn.share.reset_share_group_snapshot_status(group_snapshot_id, status)
๐ ๏ธ Update Share Group Snapshot
Updates a share group snapshot.
def update_share_group_snapshot(conn, group_snapshot_id, **attrs):
print("Updating a share group snapshot with given Id:")
share_group_snapshot = conn.share.update_share_group_snapshot(
group_snapshot_id, **attrs
)
print(share_group_snapshot)
๐๏ธ Delete Share Group Snapshot
Deletes a share group snapshot. Bye bestie, it was real. ๐
def delete_share_group_snapshot(conn, group_snapshot_id):
print("Deleting a share group snapshot with given Id:")
conn.share.delete_share_group_snapshot(group_snapshot_id)
๐ท๏ธ List Share Metadata
Lists all metadata for a given share.
def list_share_metadata(conn, share_id):
# Method returns the entire share with the metadata inside it.
returned_share = conn.get_share_metadata(share_id)
# Access metadata of share
metadata = returned_share['metadata']
print("List All Share Metadata:")
for meta_key in metadata:
print(f"{meta_key}={metadata[meta_key]}")
๐ Get Share Metadata Item
Retrieves a specific metadata item from a shares metadata by its key.
def get_share_metadata_item(conn, share_id, key):
# Method returns the entire share with the metadata inside it.
returned_share = conn.get_share_metadata_item(share_id, key)
# Access metadata of share
metadata = returned_share['metadata']
print("Get share metadata item given item key and share id:")
print(metadata[key])
๐ฑ Create Share Metadata
Creates share metadata.
def create_share_metadata(conn, share_id, metadata):
# Method returns the entire share with the metadata inside it.
created_share = conn.create_share_metadata(share_id, metadata)
# Access metadata of share
metadata = created_share['metadata']
print("Metadata created for given share:")
print(metadata)
๐ธ Update Share Metadata
Updates metadata of a given share.
def update_share_metadata(conn, share_id, metadata):
# Method returns the entire share with the metadata inside it.
updated_share = conn.update_share_metadata(share_id, metadata, True)
# Access metadata of share
metadata = updated_share['metadata']
print("Updated metadata for given share:")
print(metadata)
๐ Delete Share Metadata
Deletes a specific metadata item from a shares metadata by its key. Can specify multiple keys to be deleted.
def delete_share_metadata(conn, share_id, keys):
# Method doesn't return anything.
conn.delete_share_metadata(share_id, keys)
๐งฐ Manage Share
Manage a share with Manila.
Okay so the manage-share function wraps up like this โ no cap, this is the part where you finally get the ID:
def manage_share(conn, protocol, export_path, service_host, **params):
# Manage a share with the given protocol, export path, service host, and
# optional additional parameters
managed_share = conn.share.manage_share(
protocol, export_path, service_host, **params
)
# Can get the ID of the share, which is now being managed with Manila
managed_share_id = managed_share.id
print("The ID of the share which was managed: %s", managed_share_id)
๐งน Unmanage Share ๐งน
Unmanage a share from Manila. Bye-bye, management era ๐
def unmanage_share(conn, share_id):
# Unmanage the share with the given share ID
conn.share.unmanage_share(share_id)
try:
# Getting the share will raise an exception as it has been unmanaged
conn.share.get_share(share_id)
except Exception:
pass
๐ช List Share replicas ๐ช
Share replicas are literally the replicated copies of the existing share. You can use Share Replicas to sync data so each share replica has an identical copy of the same share. Share replication can be a disaster recovery solution or a load sharing mirroring solution โ iconic multitasking, fr fr โจ
def list_share_replicas(conn, **attrs):
print("List share replicas for the shared file system:")
for sr in conn.share.share_replicas(**attrs):
print(sr)
๐ฑ Create Share Replica ๐ฑ
Creates a share replica from attributes. New replica just dropped ๐
def create_share_replica(conn, share_id, **attrs):
print("Creating share replica:")
share_replica = conn.share.create_share_replica(share_id, **attrs)
print(share_replica)
๐ Get Share Replica ๐
List details of a single share replica. Gotta get that one specific replica, bestie ๐
def get_share_replica(conn, share_replica_id):
print("Getting share replica with give Id:")
share_replica = conn.share.share_replica(share_replica_id)
print(share_replica)
๐๏ธ Delete Share Replica ๐๏ธ
Delete a share replica. It's giving cleanup era ๐งน
def delete_share_replica(conn, share_replica_id):
print("Deleting share replica with give Id:")
conn.share.delete_share_replica(share_replica_id)
๐ Reset Status of Share Replica ๐
Reset status of the share replica. Fresh status, fresh vibes ๐
def reset_status_share_replica(conn, share_replica_id, status):
print("Resetting status for given share replica Id:")
conn.share.share_replica_reset_status(share_replica_id, status)
๐ง Reset Replica State of Share Replica ๐ง
Reset replica_state of the share replica. State reset supremacy ๐
def reset_replica_state_share_replica(conn, share_replica_id, reset_state):
print("Resetting replica state for given share replica Id:")
conn.share.share_replica_reset_replica_state(share_replica_id, reset_state)
๐ Force Delete Share Replica ๐
Force-delete share replica. It is not subtle, and that's the point ๐ญ
def force_delete_share_replica(conn, share_replica_id):
print("Force deleting the share replica for the given Id:")
conn.share.share_replica_force_delete(share_replica_id)
๐ Promote Share Replica ๐
Promote share replica. Main character replica behavior, periodt โญ
def promote_share_replica(conn, share_replica_id):
print("Promoting share replica with given Id:")
conn.share.share_replica_promote(share_replica_id)
๐ Resync Share Replica ๐
Resync share replica. Sync it back into alignment, bestie ๐ซถ
def resync_share_replica(conn, share_replica_id):
print("Resyncing share replica with given Id:")
conn.share.share_replica_resync(share_replica_id)
๐งช Testing ๐งช
The SDK provides a number of utilities to help you test your applications. Test era, but make it cute ๐
๐งช Testing applications using OpenStack SDK ๐งช
๐ญ Fakes ๐ญ
The fakes module exists to help application developers using the OpenStack SDK unit test their applications. It provides a number of helper utilities to generate fake Resource and Proxy instances. These fakes do not require an established connection, and they let you validate that your application is using valid attributes and methods for both Resource and Proxy instances. Lowkey so useful ๐
openstack.test.fakes.generate_fake_resource(resource_type, **attrs)
Generate a fake resource. Fake it till you make it, but make it type-correct โจ
Example usage:
>>> from openstack.compute.v2 import server
>>> from openstack.test import fakes
>>> fakes.generate_fake_resource(server.Server)
openstack.compute.v2.server.Server(...)
Parameters
resource_typeโ Object class.attrsโ Optional attributes to be set on resource.
Returns Instance of resource_type class populated with fake values of expected types.
Raises NotImplementedError โ If a resource attribute specifies a type or list_type that cannot be automatically generated.
openstack.test.fakes.generate_fake_resources(resource_type, count=1, attrs=None)
Generate a given number of fake resource entities. A little generator full of fake besties ๐ธ
Example usage:
>>> from openstack.compute.v2 import server
>>> from openstack.test import fakes
>>> fakes.generate_fake_resources(server.Server, count=3)
<generator object generate_fake_resources at 0x7f075dc65040>
Parameters
resource_typeโ Object class.countโ Number of objects to return.attrsโ Attribute values to set into each instance.
Returns Generator of resource_type class instances populated with fake values of expected types.
openstack.test.fakes.generate_fake_proxy(service, api_version=None)
Generate a fake proxy for the given service type. Proxy methods whose return type annotation is a Resource subclass (or a Generator / optional thereof) are automatically configured to return fake resource instances via generate_fake_resource() or generate_fake_resources(). Return values can still be overridden on the returned mock after the fact. That's the autospec magic, iykyk ๐
Example usage:
>>> from openstack.compute import compute_service
>>> from openstack.compute.v2 import server
>>> from openstack.test import fakes
>>> fake_compute_proxy = fakes.generate_fake_proxy(
... compute_service.ComputeService,
... )
>>> # get_server is pre-configured; returns a fake Server
>>> fake_server = fake_compute_proxy.get_server('some-uuid')
>>> isinstance(fake_server, server.Server)
True
>>> # servers() is pre-configured; yields fake Server instances
>>> fake_servers = list(fake_compute_proxy.servers())
>>> isinstance(fake_servers[0], server.Server)
True
>>> fake_compute_proxy.serverssss()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.11/unittest/mock.py", line 653, in __getattr__
raise AttributeError("Mock object has no attribute %r" % name)
AttributeError: Mock object has no attribute 'serverssss'. Did you mean: 'server_ips'?
Parameters
service(ServiceDescription) โ The service to generate the fake proxy for.api_version(intorNone) โ The API version to generate the fake proxy for. This should be a major version and must be supported byopenstacksdk, as specified in thesupported_versionsattribute of the provided service. This is only required ifopenstacksdksupports multiple API versions for the given service.
Raises ValueError โ if the service is not a valid ServiceDescription or if api_version is not supported.
Returns An autospecced mock of the Proxy implementation for the specified service type and API version.
๐ API Documentation ๐
Service APIs are exposed through a two-layered approach. The classes exposed through our Connection interface are the place to start if you're an application developer consuming an OpenStack cloud. The Resource interface is the layer upon which the Connection is built, with Connection methods accepting and returning Resource objects.
The Cloud Abstraction layer has a data model.
๐งฌ Data Model ๐งฌ
openstacksdk has a very strict policy on not breaking backwards compatibility ever. However, with the data structures returned from OpenStack, there are places where the resource structures from OpenStack are returned to the user somewhat directly, leaving an openstacksdk user open to changes/differences in result content. No cap, that's the risk ๐
To combat that, openstacksdk "normalizes" the return structure from OpenStack in many places, and the results of that normalization are listed below. Where openstacksdk performs normalization, a user can count on any fields declared in the docs as being completely safe to use โ they are as much a part of openstacksdk's API contract as any other Python method. That's the good part ๐ซถ
Some OpenStack objects allow for arbitrary attributes at the root of the object. openstacksdk will pass those through so as not to break anyone who may be counting on them, but as they are arbitrary openstacksdk can make no guarantees as to their existence. As part of normalization, openstacksdk will put any attribute from an OpenStack resource that is not in its data model contract into an attribute called properties. The contents of properties are defined to be an arbitrary collection of key value pairs with no promises as to any particular key ever existing.
If a user passes strict=True to the openstacksdk constructor, openstacksdk will not pass through arbitrary objects to the root of the resource, and will instead only put them in the properties dict. If a user is worried about accidentally writing code that depends on an attribute that is not part of the API contract, this can be a useful tool. Keep in mind all data can still be accessed via the properties dict, but any code touching anything in the properties dict should be aware that the keys found there are highly user/cloud specific. Any key that is transformed as part of the openstacksdk data model contract will not wind up with an entry in properties โ only keys that are unknown.
๐ The location field ๐
A Location defines where a resource lives. It includes a cloud name and a region name, an availability zone as well as information about the project that owns the resource. Location lore, honestly ๐บ๏ธ
The project info can be a project ID, or a combo of a project name plus a domain name or ID. If there's a project ID in there, bestie, just trust it โ it's correct. ๐ฏ
Some resources are out here with zero ownership info. For those, we fill in the project info from the project your current token is for. (The token knows, okay? ๐)
And some resources don't even have availability zone info, or they're just out here existing region-wide. Those get None as their availability zone. No zone, no drama. ๐
Location = dict(
cloud=str(),
region_name=str(),
zone=str() or None,
project=dict(
id=str() or None,
name=str() or None,
domain_id=str() or None,
domain_name=str() or None,
)
)
๐ซถ Connection Interface ๐ซถ
A Connection instance is like, the main character of your cloud config. It holds your cloud config, your session, your auth info, and it gives you a whole set of higher-level interfaces to work with all your OpenStack services. Iconic behavior. ๐
โจ Connection โจ
The Connection class is the primary interface to the Python SDK. It keeps a context for a connection to a region of a cloud provider. And it has an attribute to access each OpenStack service โ so you just vibe with conn.network, conn.compute, etc. ๐
At minimum, bestie, the Connection class needs to be created with a config or the parameters to build one. That's non-negotiable.
The whole system is super flexible (it's giving โจ adaptability โจ), but there are four main use cases for different ways to create a Connection:
- Using config settings and keyword arguments as described in Configuring OpenStack SDK Applications <#openstack-config>
- Using only keyword arguments passed to the constructor, ignoring config files and environment variables. (No outside noise, just vibes. ๐ โโ๏ธ)
- Using an existing authenticated
keystoneauth1.session.Session, such as might exist inside of an OpenStack service operational context. - Using an existing
CloudRegion<#openstack.config.cloud_region.CloudRegion>.
๐ ๏ธ Creating the Connection ๐ ๏ธ
Using config settings
For users who want to create a Connection making use of named clouds in clouds.yaml files, OS_ environment variables, and Python keyword arguments, the openstack.connect() factory function is the recommended way to go. It's the moment. ๐
import openstack
conn = openstack.connect(cloud='example', region_name='earth1')
If the app in question is a command line application that should also accept command line arguments, an argparse.Namespace can be passed to openstack.connect() โ it'll have relevant arguments added to it and then subsequently consumed by the constructor. So clean. โจ
import argparse
import openstack
options = argparse.ArgumentParser(description='Awesome OpenStack App')
conn = openstack.connect(options=options)
Using only keyword arguments
If the application wants to avoid loading any settings from clouds.yaml or environment variables, use the Connection constructor directly. As long as the cloud argument is omitted or None, the Connection constructor will not load settings from files or the environment. It literally minds its own business. ๐โโ๏ธ
Note: This is a different default behavior than theconnect()factory function. Inconnect()ifcloudis omitted orNone, a default cloud will be loaded, defaulting to theenvvarscloud if it exists. (So like,connect()is nosy,Connectionis chill. Different vibes entirely. ๐ซถ)
from openstack import connection
conn = connection.Connection(
region_name='example-region',
auth={
'auth_url': 'https://auth.example.com',
'username': 'amazing-user',
'password': 'super-secret-password',
'project_id': '33aa1afc-03fe-43b8-8201-4e0d3b4b8ab5',
'user_domain_id': '054abd68-9ad9-418b-96d3-3437bb376703',
},
compute_api_version='2',
identity_interface='internal',
)
Per-service settings as needed by keystoneauth1.adapter.Adapter โ like api_version, service_name, and interface โ can be set, as seen above, by prefixing them with the official service-type name of the service. And region_name is a setting for the entire CloudRegion <#openstack.config.cloud_region.CloudRegion> and cannot be set per service. It's a whole-cloud mood, not a per-service one. fyi. ๐
From existing authenticated Session
For applications that already have an authenticated Session, simply passing it to the Connection constructor is all that's needed. Easy. Slay. โจ
from openstack import connection
conn = connection.Connection(
session=session,
region_name='example-region',
compute_api_version='2',
identity_interface='internal',
)
From oslo.conf CONF object
For applications that have an oslo.config CONF object that has been populated with keystoneauth1.loading.register_adapter_conf_options in groups named by the OpenStack service's project name, it is possible to construct a Connection with the CONF object and an authenticated Session. Big brain energy. ๐ง โจ
Note: This is primarily intended for use by OpenStack services to talk amongst themselves. (It's giving internal group chat. ๐ฌ)
from keystoneauth1 import loading as ks_loading
from openstack import connection
from oslo_config import cfg
CONF = cfg.CONF
group = cfg.OptGroup('neutron')
ks_loading.register_session_conf_options(CONF, group)
ks_loading.register_auth_conf_options(CONF, group)
ks_loading.register_adapter_conf_options(CONF, group)
CONF()
auth = ks_loading.load_auth_from_conf_options(CONF, 'neutron')
sess = ks_loading.load_session_from_conf_options(
CONF, 'neutron', auth=auth
)
conn = connection.Connection(
session=sess,
oslo_conf=CONF,
)
This can then be used with an appropriate configuration file. ๐
[neutron]
region_name = RegionOne
auth_strategy = keystone
project_domain_name = Default
project_name = service
user_domain_name = Default
password = password
username = neutron
auth_url = http://10.0.110.85/identity
auth_type = password
service_metadata_proxy = True
default_floating_pool = public
You may also wish to configure a service user. As discussed in the Keystone documentation <https://docs.openstack.org/keystone/latest/admin/manage-services.html>, service users are users with specific roles that identify the user as a service. The use of service users can avoid issues caused by the expiration of the original user's token during long running operations, as a fresh token issued for the service user will always accompany the user's token, which may have expired. (Long story short: your token might expire mid-operation and that's a whole mess. Service users fix that. ๐ )
from keystoneauth1 import loading as ks_loading
from keystoneauth1 import service_token
from oslo_config import cfg
import openstack
from openstack import connection
CONF = cfg.CONF
neutron_group = cfg.OptGroup('neutron')
ks_loading.register_session_conf_options(CONF, neutron_group)
ks_loading.register_auth_conf_options(CONF, neutron_group)
ks_loading.register_adapter_conf_options(CONF, neutron_group)
service_group = cfg.OptGroup('service_user')
ks_loading.register_session_conf_options(CONF, service_group)
ks_loading.register_auth_conf_options(CONF, service_group)
CONF()
user_auth = ks_loading.load_auth_from_conf_options(CONF, 'neutron')
service_auth = ks_loading.load_auth_from_conf_options(CONF, 'service_user')
auth = service_token.ServiceTokenAuthWrapper(user_auth, service_auth)
sess = ks_loading.load_session_from_conf_options(
CONF, 'neutron', auth=auth
)
conn = connection.Connection(
session=sess,
oslo_conf=CONF,
)
This will necessitate an additional section in the configuration file used. ๐
[service_user]
auth_strategy = keystone
project_domain_name = Default
project_name = service
user_domain_name = Default
password = password
username = nova
auth_url = http://10.0.110.85/identity
auth_type = password
From existing CloudRegion
If you already have an CloudRegion <#openstack.config.cloud_region.CloudRegion> you can pass it in instead. Reuse, recycle, slay. โป๏ธโจ
from openstack import connection
import openstack.config
config = openstack.config.get_cloud_region(
cloud='example',
region_name='earth',
)
conn = connection.Connection(config=config)
๐ซ Using the Connection ๐ซ
Services are accessed through an attribute named after the service's official service-type. So conn.identity, conn.network, conn.compute โ it's giving organized. ๐๏ธ
List
An iterator containing a list of all the projects is retrieved in this manner:
projects = conn.identity.projects()
Find or create
If you wanted to make sure you had a network named 'zuul', you would first try to find it and if that fails, you would create it. (Find-or-create: the "if not found, make it" of cloud resources. ๐ซถ)
network = conn.network.find_network("zuul")
if network is None:
network = conn.network.create_network(name="zuul")
Additional information about the services can be found in the Service Proxies <#service-proxies> documentation.
๐ from_config ๐
openstack.connection.from_config(cloud=None, config=None, options=None, **kwargs)
Create a Connection using openstack.config. It's the factory vibes.
Parameters
cloud(str) โ Use the cloud configuration details when creating theConnection.config(openstack.config.cloud_region.CloudRegion <#openstack.config.cloud_region.CloudRegion>) โ An existingCloudRegionconfiguration. If no config is provided,openstack.config.OpenStackConfigwill be called, and the provided name will be used in determining which cloud's configuration details will be used in creation of theConnectioninstance.options(argparse.Namespace) โ Allows direct passing in of options to be added to the cloud config. This does not have to be an actual instance ofargparse.Namespace, despite the naming of theopenstack.config.loader.OpenStackConfig.get_oneargument to which it is passed. (Naming is just quirky like that, bestie. ๐คทโโ๏ธ)
Return type: Connection
๐ Connection Object ๐
class openstack.connection.Connection(cloud=None, config=None, session=None, app_name=None, app_version=None, extra_services=None, strict=False, use_direct_get=None, task_manager=None, rate_limit=None, oslo_conf=None, service_types=None, global_request_id=None, strict_proxies=False, pool_executor=None, **kwargs)
Create a connection to a cloud. Main character constructor energy. ๐
A connection needs information about how to connect, how to authenticate, and how to select the appropriate services to use. (The holy trinity of cloud vibes. โจ๐ฉ๏ธ)
Okay so the recommended way to hand over this info is by referencing a named cloud config from an existing clouds.yaml file. The cloud name envvars may be used to consume a cloud configured via OS_ environment variables.
A pre-existing CloudRegion (openstack.config.cloud_region.CloudRegion) object can be passed in lieu of a cloud name, for cases where you already have a fully formed CloudRegion and literally just want to use it.
Similarly, if for some reason you already have a Session and want to use it, it may be passed in. ๐
Parameters
cloud(str) โ Name of the cloud from config to use.config(CloudRegion, i.e.openstack.config.cloud_region.CloudRegion) โ CloudRegion object representing the config for the region of the cloud in question.session(Session) โ A session object compatible withSession.app_name(str) โ Name of the application to be added to User Agent.app_version(str) โ Version of the application to be added to User Agent.extra_servicesโ List ofServiceDescription(openstack.service_description.ServiceDescription) objects describing services that openstacksdk otherwise does not know about.use_direct_get(bool) โ For get methods, make specific REST calls for server-side filtering instead of making list calls and filtering client-side. Defaultfalse.task_managerโ Ignored. Exists for backwards compat during transition. Rate limit parameters should be passed directly to therate_limitparameter.rate_limitโ Client-side rate limit, expressed in calls per second. The parameter can either be a single float, or it can be a dict with keys as service-type and values as floats expressing the calls per second for that service. Defaults toNone, which means no rate-limiting is performed.oslo_conf(ConfigOpts) โ Anoslo.configCONFobject that has been populated withkeystoneauth1.loading.register_adapter_conf_optionsin groups named by the OpenStack service's project name.service_typesโ A list/set of service types thisConnectionshould support. All other service types will be disabled (will error if used). Currently only supported in conjunction with theoslo_confkwarg.strict_proxies(bool) โ Throw anopenstack.exceptions.ServiceDiscoveryExceptionif the endpoint for a given service doesn't work. This is useful for OpenStack services using sdk to talk to other OpenStack services where it can be expected that the deployer config is correct and errors should be reported immediately. Defaultfalse.global_request_id(str) โ A Request-id to send with all interactions.pool_executor(Executor) โ AfuturistExecutorobject to be used for concurrent background activities. Defaults toNonein which case aThreadPoolExecutorwill be created if needed.kwargsโ If aconfigis not provided, the rest of the parameters provided are assumed to be arguments to be passed to theCloudRegionconstructor.
add_service(service)
Add a service to the Connection. โจ
Attaches an instance of the Proxy (openstack.proxy.Proxy) class contained in ServiceDescription (openstack.service_description.ServiceDescription). The Proxy (openstack.proxy.Proxy) will be attached to the Connection by its service_type and by any aliases that may be specified.
Parameters
service(openstack.service_description.ServiceDescriptionfromopenstack.service_description.ServiceDescription) โ Object describing the service to be attached. As a convenience, ifserviceis a string it will be treated as aservice_typeand a basicServiceDescription(openstack.service_description.ServiceDescription) will be created.
authorize()
Authorize this Connection ๐
Note: This method is optional. When an application makes a call to any OpenStack service, this method allows you to request a token manually before attempting to do anything else.
Returns โ A string token.
Raises HttpException (openstack.exceptions.HttpException) if the authorization fails due to reasons like the credentials provided are unable to be authorized or the auth_type argument is missing, etc.
connect_as(**kwargs)
Make a new Connection object with new auth context.
Take the existing settings from the current cloud and construct a new Connection object with some of the auth settings overridden. This is useful for getting an object to perform tasks with as another user, or in the context of a different project.
conn = openstack.connect(cloud='example')
# Work normally
servers = conn.list_servers()
conn2 = conn.connect_as(username='different-user', password='')
# Work as different-user
servers = conn2.list_servers()
Parameters
kwargsโ keyword arguments can contain anything that would normally go in an auth dict. They will override the same settings from the parent cloud as appropriate. Entries that do not want to be overridden can be ommitted.
connect_as_project(project)
Make a new Connection object with a new project.
Take the existing settings from the current cloud and construct a new Connection object with the project settings overridden. This is useful for getting an object to perform tasks with as another user, or in the context of a different project.
cloud = openstack.connect(cloud='example')
# Work normally
servers = cloud.list_servers()
cloud2 = cloud.connect_as_project('different-project')
# Work in different-project
servers = cloud2.list_servers()
Parameters
projectโ Either a project name or a project dict as returned bylist_projects.
endpoint_for(service_type, interface=None, region_name=None)
Return the endpoint for a given service. ๐ฆ
Respects config values for Connection, including *_endpoint_override. For direct values from the catalog regardless of overrides, see get_endpoint_from_catalog() (openstack.config.cloud_region.CloudRegion.get_endpoint_from_catalog).
Parameters
service_typeโ Service Type of the endpoint to search for.interfaceโ Interface of the endpoint to search for. Optional, defaults to the configured value forinterfacefor thisConnection.region_nameโ Region Name of the endpoint to search for. Optional, defaults to the configured value forregion_namefor thisConnection.
Returns โ The endpoint of the service, or None if not found.
add_auto_ip(server, wait=False, timeout=60, reuse=True)
Add a floating IP to a server. ๐
This method is intended for basic usage. For advanced network architecture (e.g. multiple external networks or servers with multiple interfaces), use other floating IP methods.
This method can reuse available IPs, or allocate new IPs to the current project.
Parameters
serverโ a server dictionary.reuseโ Whether or not to attempt to reuse IPs, defaults toTrue.waitโ (optional) Wait for the address to appear as assigned to the server. Defaults toFalse.timeoutโ (optional) Seconds to wait, defaults to60. See thewaitparameter.reuseโ Try to reuse existing ips. Defaults toTrue.
yes bestie, reuse is listed twice in the source โ both stay, no cap ๐
Returns โ Floating IP address attached to server.
add_flavor_access(flavor_id, project_id)
Grant access to a private flavor for a project/tenant.
Parameters
flavor_id(string) โ ID of the private flavor.project_id(string) โ ID of the project/tenant.
Returns โ None
Raises SDKException (openstack.exceptions.SDKException) on operation error.
add_host_to_aggregate(name_or_id, host_name)
Add a host to an aggregate.
Parameters
name_or_idโ Name or ID of the host aggregate.host_nameโ Host to add.
Raises SDKException (openstack.exceptions.SDKException) on operation error.
add_ip_list(server, ips, wait=False, timeout=60, fixed_address=None, nat_destination=None)
Attach a list of IPs to a server.
Parameters
serverโ a server objectipsโ list of floating IP addresses or a single address โจwaitโ (optional) wait for the address to appear as assigned to the server. Defaults toFalse. ๐ฐ๏ธtimeoutโ (optional) seconds to wait, defaults to60. See thewaitparameter. โณfixed_addressโ (optional) fixed address of the server to attach the IP tonat_destinationโ (optional) name or ID of the network that the fixed IP to attach the floating IP should be on ๐
Returns: the updated server โ openstack.compute.v2.server.Server ๐
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
add_router_interface(router, subnet_id=None, port_id=None)
Attach a subnet to an internal router interface. ๐ฐ๏ธ
You gotta specify either a subnet ID or a port ID for the internal interface. Supply both and boom โ that's an error. No mixing, bestie.
Parameters
router(dict) โ the dict object of the router being changedsubnet_id(string) โ the ID of the subnet to use for the interfaceport_id(string) โ the ID of the port to use for the interface
Returns: the raw response body from the request. ๐ฆ
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
add_server_security_groups(server, security_groups)
Add security groups to a server. ๐
Add existing security groups to an existing server. If the security groups are already present on the server, this will continue unaffected. So likeโฆ no drama, it just keeps going.
Parameters
serverโ the server to remove security groups from. (Yep, the page literally says โremoveโ here โ not me being chaotic ๐)security_groupsโ a list of security groups to remove.
Returns: False if server or security groups are undefined, True otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
add_user_to_group(name_or_id, group_name_or_id)
Add a user to a group. ๐ฏ
Parameters
name_or_idโ name or unique ID of the user.group_name_or_idโ group name or ID.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
add_volume_type_access(name_or_id, project_id)
Grant access on a volume_type to a project. ๐๏ธ
NOTE: the call works even if the project does not exist. Yes, really. The page said it, I'm just repeating it.
Parameters
name_or_idโ ID or name of avolume_typeproject_idโ a project id
Returns: None
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
attach_port_to_machine(name_or_id, port_name_or_id)
Attach a virtual port to the bare metal machine. ๐ฅ๏ธโจ
Parameters
name_or_id(string) โ a machine name or UUID.port_name_or_id(string) โ a port name or UUID. Note that this is a Network service port, not a bare metal NIC. Important distinction, bestie ๐ซถ
Returns: Nothing.
attach_volume(server, volume, device=None, wait=True, timeout=None)
Attach a volume to a server. ๐ฝ
This will attach a volume, described by the passed-in volume dict (as returned by get_volume()), to the server described by the passed-in server dict (as returned by get_server()) on the named device on the server.
If the volume is already attached to the server, or generally not available, then an exception is raised. To re-attach to a server, but under a different device, the user must detach it first. No sneaky double-attach, okay? ๐ญ
Parameters
serverโ the server dict to attach to.volumeโ the volume dict to attach.deviceโ the device name where the volume will attach.waitโ if true, waits for volume to be attached.timeoutโ seconds to wait for volume attachment.Noneis forever.
Returns: a volume attachment object.
Raises: ResourceTimeout <#openstack.exceptions.ResourceTimeout> if wait time exceeded.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
available_floating_ip(network=None, server=None)
Get a floating IP from a network or a pool. ๐
Return the first available floating IP or allocate a new one.
Parameters
networkโ name or ID of the network.serverโ server the IP is for if known
Returns: a (normalized) structure with a floating IP address description.
bind_accelerator_request(uuid, properties)
Bind an accelerator to VM. โก
A deprecated alias for patch_accelerator_request. ๐จ Deprecated alert, bestie โ it's giving โold route, still works, donโt make it your whole personality.โ
close()
Release any resources held open. ๐งนโจ
create_accelerator_request(attrs)
Create an accelerator_request. ๐
Parameters
attrsโ the info ofaccelerator_requestto be created.
Returns: an accelerator AcceleratorRequest object.
create_aggregate(name, availability_zone=None)
Create a new host aggregate. ๐๏ธ
Parameters
nameโ name of the host aggregate being createdavailability_zoneโ availability zone to assign hosts
Returns: the created compute Aggregate object.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
create_cluster_template(name, image_id=None, keypair_id=None, coe=None, **kwargs)
Create a cluster template. ๐งฉ
Parameters
name(string) โ name of the cluster template.image_id(string) โ name or ID of the image to use.keypair_id(string) โ name or ID of the keypair to use.coe(string) โ name of thecoefor the cluster template. Other arguments will be passed inkwargs.
Returns: a dict containing the cluster template description
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
create_coe_cluster(name, cluster_template_id, **kwargs)
Create a COE cluster based on given cluster template. ๐ณ
Parameters
name(string) โ name of the cluster.cluster_template_id(string) โ ID of the cluster template to use.kwargs(dict) โ any other arguments to pass in.
Returns: the created container infrastructure management Cluster object.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
create_container(name, public=False)
Create an object-store container. ๐๏ธ
Parameters
name(str) โ name of the container to create.public(bool) โ whether to set this container to be public. Defaults toFalse.
Returns: the created object store Container object.
create_device_profile(attrs)
Create a device_profile. ๐งฌ
Parameters
attrsโ the info ofdevice_profileto be created.
Returns: an accelerator DeviceProfile objects.
create_directory_marker_object(container, name, **headers)
Create a zero-byte directory marker object. ๐โจ
Note: this method is not needed in most cases. Modern swift does not require directory marker objects. However, some swift installs may need these.
When using swift Static Web and Web Listings to serve static content one may need to create a zero-byte object to represent each โdirectoryโ. Doing so allows Web Listings to generate an index of the objects inside of it, and allows Static Web to render index.html โfilesโ that are โinsideโ the directory.
Parameters
containerโ the name of the container.nameโ name for the directory marker object within the container.headersโ these will be passed through to the object creation API as HTTP Headers.
Returns: the created object store Object object.
create_domain(name, description=None, enabled=True)
Create a domain. ๐
Parameters
nameโ the name of the domain.descriptionโ a description of the domain.enabledโ is the domain enabled or not (defaults toTrue) โจ
Returns โ the created identity Endpoint object ๐
Raises SDKException if the domain cannot be created ๐ญ
create_endpoint(service_name_or_id, url=None, interface=None, region=None, enabled=True, **kwargs)
okay so this one makes a Keystone endpoint โ the actual addressable thing your service lives at ๐ฅ
Parameters
service_name_or_idโ service name or id this endpoint belongs to ๐urlโ URL of the endpointinterfaceโ interface type of the endpointpublic_urlโ the endpoint's public URL ๐internal_urlโ the endpoint's internal URLadmin_urlโ the endpoint's admin URL ๐regionโ endpoint regionenabledโ whether the endpoint is enabled or not
Returns โ a list of identity Endpoint objects ๐
Raises SDKException if the service can't be found, or if something goes sideways during the OpenStack API call ๐
create_endpoint_group(name, filters, description=None)
creates a Keystone endpoint group, no cap ๐ซถ
Parameters
nameโ the name of the endpoint group ๐ธdescriptionโ the description of the endpoint groupfiltersโ describes the filtering performed by the endpoint group ๐
Returns โ an identity EndpointGroup object โจ
Raises SDKException if the endpoint group cannot be created ๐ญ
create_firewall_group(**kwargs)
creates a firewall group ๐งฑ Two things worth knowing: the keys egress_firewall_policy and ingress_firewall_policy get looked up and mapped to egress_firewall_policy_id and ingress_firewall_policy_id respectively, and the port name-or-ids list gets turned into a list of port ids before the POST request goes out. iykyk ๐
Parameters
admin_state_up(bool) โ state of the firewall group. Setting it toFalsewill block all traffic. Defaults toTrueโ ๏ธdescriptionโ human-readable descriptionegress_firewall_policyโ name or id of the egress firewall policyingress_firewall_policyโ name or id of the ingress firewall policynameโ human-readable name ๐ports(list[str]) โ list of associated ports (name or id)project_idโ project idsharedโ visibility to other projects. Defaults toFalse๐ฆ
Raises BadRequestException if parameters are malformed
Raises DuplicateResource on multiple matches ๐
Raises NotFoundException if the (ingress-, egress-) firewall policy or a port is not found ๐
Returns โ the created network FirewallGroup object ๐
create_firewall_policy(**kwargs)
creates a firewall policy, iconic behaviour honestly ๐
Parameters
audited(bool) โ status of audition of firewall policy. It gets set toFalseevery time the firewall policy or its associated firewall rules are changed, and it has to be explicitly set back toTrue๐descriptionโ human-readable descriptionfirewall_rules(list[str]) โ list of associated firewall rulesnameโ human-readable nameproject_idโ project idshared(bool) โ visibility to other projects. Defaults toFalseโจ
Raises BadRequestException if parameters are malformed
Raises NotFoundException if a resource from firewall_list isn't found ๐ญ
Returns โ the created network FirewallPolicy object ๐ซถ
create_firewall_rule(**kwargs)
creates a firewall rule โ this is the one with the most knobs, lowkey a lot ๐๏ธ
Parameters
actionโ action performed on traffic. Valid values:allow,deny. Defaults todenyโ ๏ธdescriptionโ human-readable descriptiondestination_firewall_group_idโ id of the destination firewall groupdestination_ip_addressโ IPv4-, IPv6 address or CIDRdestination_portโ port or port range (e.g.80:90)enabled(bool) โ status of the firewall rule. you can disable rules without disassociating them from firewall policies. Defaults toTrue๐ip_version(int) โ IP version. Valid values:4,6. Defaults to4nameโ human-readable name ๐ธproject_idโ project idprotocolโ IP protocol. Valid values:icmp,tcp,udp,nullshared(bool) โ visibility to other projects. Defaults toFalsesource_firewall_group_idโ id of the source firewall groupsource_ip_addressโ IPv4-, IPv6 address or CIDRsource_portโ port or port range (e.g.80:90) ๐ฅ
Raises BadRequestException if parameters are malformed
Returns โ the created network FirewallRule object ๐
create_flavor(name, ram, vcpus, disk, description=None, flavorid='auto', ephemeral=0, swap=0, rxtx_factor=1.0, is_public=True)
creates a brand new flavor, the blueprint for your servers ๐
Parameters
nameโ descriptive name of the flavorramโ memory in MB for the flavorvcpusโ number of VCPUs for the flavordiskโ size of local disk in GB ๐พdescriptionโ description of the flavorflavoridโ id for the flavor (optional)ephemeralโ ephemeral space size in GBswapโ swap space in MBrxtx_factorโ RX/TX factoris_publicโ make the flavor accessible to the public ๐
Returns โ the created compute Flavor object โจ
Raises SDKException on operation error ๐ญ
create_floating_ip(network=None, server=None, fixed_address=None, nat_destination=None, port=None, wait=False, timeout=60)
allocates a new floating IP from a network or a pool ๐ so glamorous of it
Parameters
networkโ name or ID of the network the floating IP should come fromserverโ (optional) server dict for the server to create the IP for and to which it should be attachedfixed_addressโ (optional) fixed IP to attach the floating IP tonat_destinationโ (optional) name or ID of the network that the fixed IP to attach the floating IP to should be onportโ (optional) the port ID the floating IP should be attached to. heads up: specifying a port conflicts with specifying aserver,fixed_addressornat_destinationโ ๏ธwaitโ (optional) whether to wait for the IP to be active. Defaults toFalse. Only applies if a server is providedtimeoutโ (optional) how long to wait for the IP to be active. Defaults to60. Only applies if a server is provided โณ
Returns โ a floating IP address ๐
Raises SDKException on operation error ๐
create_group(name, description, domain=None)
creates a group ๐ฏโโ๏ธ literally the friend group of identity objects
Parameters
name(string) โ group namedescription(string) โ group descriptiondomain(string) โ domain name or ID for the group ๐ธ
Returns โ an identity Group object ๐ซถ
Raises SDKException if something goes wrong during the OpenStack API call ๐ญ
create_image(name, filename=None, container=None, md5=None, sha256=None, disk_format=None, container_format=None, disable_vendor_agent=True, wait=False, timeout=3600, tags=None, allow_duplicates=False, meta=None, volume=None, **kwargs)
uploads an image ๐ผ๏ธ main character energy fr fr
Parameters
name(str) โ name of the image to create. if it's a pathname of an image, the name will be constructed from the extensionless basename of the path โจfilename(str) โ the path to the file to upload, if needed (optional, defaults toNone)container(str) โ name of the container in swift where images should be uploaded for import if the cloud requires such a thing (optional, defaults to'images') ๐ฆmd5(str) โ md5 sum of the image file. if it's not given, an md5 will be calculated ๐
and there's more params where that came from, don't you worry bestie ๐
sha256(str) โ the sha256 sum of the image file. If you don't pass it, an md5 gets calculated instead. ๐disk_format(str) โ which disk format the image is in. (optional, and it defaults to the os-client-config config value for this cloud)container_format(str) โ the container format the image is in. (optional, defaults to the os-client-config config value for this cloud, same deal)tags(list) โ the list of tags for this image. Every tag is a string of at most 255 chars. โจdisable_vendor_agent(bool) โ whether or not to append metadata flags to the image so the cloud in question knows not to expect a vendor agent to be running. (optional, defaults toTrue)wait(bool) โ if true, it waits for the image to be created. Defaults to true โ but heads up bestie, one of the upload methods is always synchronous, so likeโฆ yeah. ๐ญtimeoutโ seconds to wait for image creation.Noneis forever.allow_duplicatesโ if true, it skips the checks that enforce unique image name. (optional, defaults toFalse)metaโ a dict of key/value pairs to use for metadata that bypasses automatic type conversion.volumeโ name or ID or volume object of a volume to create an image from. Mutually exclusive with (optional, defaults toNone)
Additional kwargs will be passed to the image creation as additional metadata for the image, and every value gets converted to string โ except for min_disk, min_ram, size and virtual_size, which get converted to int. ๐งฎ
So if you're 100% sure all your data types are correct, or you have some advanced need to be explicit, use meta. If you're just a normal consumer, passing kwargs is probably the move. ๐ซถ
And if a value shows up in both meta and kwargs โ meta wins. periodt.
Returns An image openstack.image.v2.image.Image <#openstack.image.v2.image.Image> object.
Raises SDKException <#openstack.exceptions.SDKException> if there are problems uploading.
create_image_snapshot(name, server, wait=False, timeout=3600, **metadata)
Create an image by snapshotting an existing server. ๐ธ
note: on most clouds this is a cold snapshot โ meaning the server in question will be shut down before the snapshot is taken. It's possible that it's a live snapshot, but there is literally no way to know as a user, so caveat emptor. ๐
Parameters
nameโ name of the image to be createdserverโ server name or ID or dict representing the server to be snapshottedwaitโ if true, waits for image to be created.timeoutโ seconds to wait for image creation.Noneis forever.metadataโ metadata to give the newly-created image entity
Returns The created image Image object. ๐
Raises SDKException <#openstack.exceptions.SDKException> if there are problems uploading.
create_keypair(name, public_key=None)
Create a new keypair. ๐โจ
Parameters
nameโ name of the keypair being created.public_keyโ public key for the new keypair.
Returns The created compute Keypair object.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
create_network(name, shared=False, admin_state_up=True, external=False, provider=None, project_id=None, availability_zone_hints=None, port_security_enabled=None, mtu_size=None, dns_domain=None)
Create a network. ๐
Parameters
name(string) โ name of the network being created.shared(bool) โ set the network as shared.admin_state_up(bool) โ set the network administrative state to up.external(bool) โ whether this network is externally accessible.provider(dict) โ a dict of network provider options. Example:
{'network_type': 'vlan', 'segmentation_id': 'vlan1'}
project_id(string) โ specify the project ID this network will be created on (admin-only). ๐availability_zone_hints(types.ListType) โ a list of availability zone hints.port_security_enabled(bool) โ enable / disable port securitymtu_size(int) โ maximum transmission unit value to address fragmentation. Minimum value is68for IPv4, and1280for IPv6.dns_domain(string) โ specify the DNS domain associated with this network.
Returns The created network Network object.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
create_object(container, name, filename=None, md5=None, sha256=None, segment_size=None, use_slo=True, metadata=None, generate_checksums=None, data=None, **headers)
Create a file object. ๐๏ธ
Automatically uses large-object segments if needed โ she's smart like that.
Parameters
containerโ the name of the container to store the file in. This container will be created if it doesn't exist already.nameโ name for the object within the container.filenameโ the path to the local file whose contents will be uploaded. Mutually exclusive withdata.dataโ the content to upload to the object. Mutually exclusive withfilename.md5โ a hexadecimal md5 of the file. (Optional) if it's known and you can pass it here, it saves repeating the expensive md5 process. It's assumed to be accurate.sha256โ a hexadecimal sha256 of the file. (Optional) seemd5.segment_sizeโ break the uploaded object into segments of this many bytes. (Optional) Shade will attempt to discover the maximum value for this from the server if it isn't specified, or will use a reasonable default.headersโ these will be passed through to the object creation API as HTTP Headers.use_sloโ if the object is large enough to need to be a Large Object, use a static rather than dynamic object. Static Objects will delete segment objects when the manifest object is deleted. (optional, defaults toTrue)generate_checksumsโ whether to generate checksums on the client side that get added to headers, for later prevention of double uploads of identical data. (optional, defaults toTrue)metadataโ this dict will get changed into headers that set metadata of the object
Returns The created object store Object object.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
create_port(network_id, **kwargs)
Create a port. ๐
Parameters
network_idโ the ID of the network. (Required)nameโ a symbolic name for the port. (Optional)admin_state_upโ the administrative status of the port, which is up (true, default) or down (false). (Optional)mac_addressโ the MAC address. (Optional)fixed_ipsโ list ofip_addressesandsubnet_ids. Seesubnet_idandip_address. (Optional) For example:
[
{
"ip_address": "10.29.29.13",
"subnet_id": "a78484c4-c380-4b47-85aa-21c51a2d8cbd",
},
...,
]
where
subnet_id: If you specify only a subnet
ID,
OpenStack Networking allocates an
available IP from that subnet to
the port.
ip_address: (Optional) If you specify both
a subnet ID and
an IP address, OpenStack Networking
tries to allocate the specified
address to the port.
security_groupsโ list of security group UUIDs. (Optional)allowed_address_pairsโ allowed address pairs list (Optional) For example:
extra_dhcp_optsโ extra DHCP options, optional bestie. Like this:
[{"opt_name": "opt name1", "opt_value": "value1"}, ...]
device_ownerโ the ID of the entity that uses this port. Think a DHCP agent, that kind of thing. (Optional)device_idโ the ID of the device using this port, like a virtual server. (Optional)vnic_type(binding) โ the type of the port we're creating. (Optional)port_security_enabledโ the security port state that gets created on the network. (Optional)qos_policy_idโ the ID of the QoS policy you want applied to this port. (Optional)project_idโ which project the port lives in. (Optional)descriptionโ a lil description of the port. (Optional)dns_domainโ the DNS domain relevant for the port. (Optional)dns_nameโ the DNS name of the port. (Optional)numa_affinity_policyโ the numa affinity policy, honestly. Can be"None","required","preferred"or"legacy". (Optional)propagate_uplink_statusโ whether the uplink status of the port should be propagated. (Optional)mac_learning_enabledโ whether mac learning should be enabled on the port. (Optional)
Returns โ the created network Port object. ๐
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error. ๐ญ
create_project(name, domain_id, description=None, enabled=True, **kwargs)
Create a project. Slay, an org chart in code form. โจ
Parameters
namedomain_iddescriptionenabled
Returns โ an identity Project object. ๐
create_qos_bandwidth_limit_rule(policy_name_or_id, max_kbps, **kwargs)
Create a QoS bandwidth limit rule. Speed limits but make it cloud. ๐ฅ
Parameters
policy_name_or_id(string) โ name or ID of the QoS policy this rule should be attached to.max_kbps(int) โ the maximum bandwidth limit value, in kilobits per second.max_burst_kbps(int) โ the maximum burst value, in kilobits.direction(string) โ ingress or egress. Basically: which way is the traffic getting limited.
Returns โ the created network QoSBandwidthLimitRule object. โจ
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
create_qos_dscp_marking_rule(policy_name_or_id, dscp_mark)
Create a QoS DSCP marking rule. Fancy packet-labeling behaviour, we love to see it. ๐
Parameters
policy_name_or_id(string) โ name or ID of the QoS policy this rule should be attached to.dscp_mark(int) โ the DSCP mark value.
Returns โ the created network QoSDSCPMarkingRule object.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
create_qos_minimum_bandwidth_rule(policy_name_or_id, min_kbps, **kwargs)
Create a QoS minimum bandwidth limit rule. The floor, not the ceiling, bestie. ๐ฆ
Parameters
policy_name_or_id(string) โ name or ID of the QoS policy this rule should be attached to.min_kbps(int) โ the minimum bandwidth value, in kilobits per second.direction(string) โ ingress or egress. The direction in which the traffic will be available.
Returns โ the created network QoSMinimumBandwidthRule object.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
create_qos_policy(**kwargs)
Create a QoS policy. The whole vibe container for the rules above. ๐
Parameters
name(string) โ the name of the QoS policy being created.description(string) โ description of the created QoS policy.shared(bool) โ set the QoS policy as shared.default(bool) โ set the QoS policy as the default for the project.project_id(string) โ specify the project ID this QoS policy will be created on (admin-only).
Returns โ the created network QosPolicy object.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
create_recordset(zone, name, recordset_type, records, description=None, ttl=None)
Create a recordset. DNS but make it an accessory. ๐
Parameters
zoneโ name, ID oropenstack.dns.v2.zone.Zone <#openstack.dns.v2.zone.Zone>instance of the zone managing the recordset.nameโ name of the recordset.recordset_typeโ type of the recordset.recordsโ list of the recordset definitions.descriptionโ description of the recordset.ttlโ TTL value of the recordset.
Returns โ a dict representing the created recordset.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
create_role(name, **kwargs)
Create a Keystone role. Permissions era. ๐
Parameters
name(string) โ the name of the role.domain_idโ domain id (v3).
Returns โ an identity Role object.
Raises โ SDKException <#openstack.exceptions.SDKException> if the role cannot be created.
create_router(name=None, admin_state_up=True, ext_gateway_net_id=None, enable_snat=None, ext_fixed_ips=None, project_id=None, availability_zone_hints=None)
Create a logical router. The main character of your network topology, fr. ๐ฆ
Parameters
name(string) โ the router name.admin_state_up(bool) โ the administrative state of the router.ext_gateway_net_id(string) โ network ID for the external gateway.enable_snat(bool) โ enable the Source NAT (SNAT) attribute.ext_fixed_ipsโ list of dictionaries of the desired IP and/or subnet on the external network. Example:
[
{
"subnet_id": "8ca37218-28ff-41cb-9b10-039601ea7e6b",
"ip_address": "192.168.10.2",
}
]
project_id(string) โ project ID for the router.availability_zone_hints(types.ListType) โ a list of availability zone hints.
Returns โ the created network Router object.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
create_security_group(name, description, project_id=None, stateful=None)
Create a new security group. Your little velvet rope for traffic. ๐
Parameters
name(string) โ a name for the security group.description(string) โ describes the security group.project_id(string) โ specify the project ID this security group will be created on (admin-only).stateful(string) โ whether the security group is stateful or not.
Returns โ a openstack.network.v2.security_group.SecurityGroup representing the new security group.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
Raises โ OpenStackCloudUnavailableFeature if security groups are not supported on this cloud. ๐ญ Rough.
create_security_group_rule(secgroup_name_or_id, port_range_min=None, port_range_max=None, protocol=None, remote_ip_prefix=None, remote_group_id=None, remote_address_group_id=None, direction='ingress', ethertype='IPv4', project_id=None, description=None)
Create a new security group rule. The actual individual rules of the velvet rope. ๐
Parameters
secgroup_name_or_id(string) โ the security group name or ID to associate with this security group rule. Heads up: if you hand it a non-unique group name, an exception is raised.port_range_min(int) โ the minimum port number in the range matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to theport_range_maxattribute value. And like, if nova is used by the cloud provider for security groups, then a value ofNonewill be transformed to-1.port_range_max(int) โ the biggest port number in the range this security group rule matches ๐ real talk:port_range_minis the one that constrainsport_range_max. And if your cloud provider uses nova for security groups, then a value ofNonegets transformed into-1. iykyk.protocol(string) โ the protocol this security group rule matches. Valid values areNone,tcp,udp, andicmp. that's the whole list, bestie, don't get creative ๐remote_ip_prefix(string) โ the remote IP prefix to associate with this security group rule. This attribute matches the specified IP prefix as the source IP address of the IP packet. it's giving "who's allowed in" energy โจremote_group_id(string) โ the remote group ID to associate with this security group rule.remote_address_group_id(string) โ the remote address group ID to associate with this security group rule.direction(string) โ ingress or egress: the direction in which the security group rule is applied. For a compute instance, an ingress security group rule is applied to incoming (ingress) traffic for that instance. An egress rule is applied to traffic leaving the instance. so ingress = coming in, egress = heading out ๐ฆethertype(string) โ must beIPv4orIPv6, and addresses represented in CIDR must match the ingress or egress rules. no mixing, no matching, periodt.project_id(string) โ specify the project ID this security group will be created on (admin-only). ๐ admin only, so if that's not you, this one's not for you.description(string) โ description of the rule, max 255 characters.
Returns
A openstack.network.v2.security_group.SecurityGroup representing the new security group rule. a whole new rule, freshly created, slay ๐
Raises
SDKException <#openstack.exceptions.SDKException> on operation error. ๐ญ
create_server(name, image=None, flavor=None, auto_ip=True, ips=None, ip_pool=None, root_volume=None, terminate_volume=False, wait=False, timeout=180, reuse_ips=True, network=None, boot_from_volume=False, volume_size='50', boot_volume=None, volumes=None, nat_destination=None, group=None, **kwargs)
Create a virtual server instance. this is the big one, the main character of the whole SDK, no cap ๐ฅ
Parameters
nameโ something to name the server. give it a good one, bestie ๐imageโ image dict, name or ID to boot with.imageis required unlessboot_volumeis given. one or the other, okurr.flavorโ flavor dict, name or ID to boot onto.auto_ipโ whether to take actions to find a routable IP for the server. (defaults toTrue) ๐ซถipsโ list of IPs to attach to the server (defaults toNone)ip_poolโ name of the network or floating IP pool to get an address from. (defaults toNone)root_volumeโ name or ID of a volume to boot from (defaults toNoneโ deprecated, useboot_volume). โ ๏ธ deprecated, so lowkey don't.boot_volumeโ name or ID of a volume to boot from (defaults toNone)terminate_volumeโ if booting from a volume, whether it should be deleted when the server is destroyed. (defaults toFalse) so by default the volume lives, okurr ๐volumesโ (optional) a list of volumes to attach to the servermetaโ (optional) a dict of arbitrary key/value metadata to store for this server. Both keys and values must be<=255characters.filesโ (optional, deprecated) a dict of files to overwrite on the server upon boot. Keys are file names (i.e./etc/passwd) and values are the file contents (either as a string or as a file-like object). A maximum of five entries is allowed, and each file must be10kor less. ๐ five files max and 10k each, them's the rules.reservation_idโ a UUID for the set of servers being requested.min_countโ (optional extension) the minimum number of servers to launch.max_countโ (optional extension) the maximum number of servers to launch.security_groupsโ a list of security group namesuserdataโ user data to pass to be exposed by the metadata server; this can be a file type object as well or a string. โจkey_nameโ (optional extension) name of previously created keypair to inject into the instance.availability_zoneโ name of the availability zone for instance placement.block_device_mappingโ (optional) a dict of block device mappings for this server.block_device_mapping_v2โ (optional) a dict of block device mappings for this server. yes there's a v2, no we're not skipping it ๐nicsโ (optional extension) an ordered list of nics to be added to this server, with information about connected networks, fixed IPs, port etc.scheduler_hintsโ (optional extension) arbitrary key-value pairs specified by the client to help boot an instanceconfig_driveโ (optional extension) value for config drive either boolean, or volume-iddisk_configโ (optional extension) control how the disk is partitioned when the server is created. possible values are'AUTO'or'MANUAL'. two options, pick one bestie ๐ฆadmin_passโ (optional extension) add a user supplied admin password. ๐waitโ (optional) wait for the address to appear as assigned to the server. Defaults toFalse.timeoutโ (optional) seconds to wait, defaults to60. See thewaitparameter. โณ (yes the signature up there says180, the description says60โ we're just reporting what the page says, don't come for me ๐ญ)reuse_ipsโ (optional) whether to attempt to reuse pre-existing floating ips should a floating IP be needed (defaults toTrue)networkโ (optional) network dict or name or ID to attach the server to. Mutually exclusive with thenicsparameter. Can also be a list of network names or IDs or network dicts. mutually exclusive means not both, bestie, pick a lane ๐boot_from_volumeโ whether to boot from volume.'boot_volume'impliesTrue, butboot_from_volume=Truewith noboot_volumeis valid and will create a volume from the image and use that. iconic behaviour honestly โจvolume_sizeโ when booting an image from volume, how big should the created volume be? Defaults to50.nat_destinationโ which network should a created floating IP be attached to, if it's not possible to infer from the cloud's configuration. (Optional, defaults toNone)groupโ ServerGroup dict, name or id to boot the server in. If a group is provided in bothscheduler_hintsand in thegroupparam, thegroupparam will win. (Optional, defaults toNone) ๐ group param takes the crown.
Returns
The created compute Server object. ๐ฅ๏ธ your baby is born.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error. ๐ญ
create_server_group(name, policies=None, policy=None)
Create a new server group. squads, but for servers ๐ซถ
Parameters
nameโ name of the server group being createdpoliciesโ list of policies for the server group.
Returns
The created compute ServerGroup object.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
create_service(name, enabled=True, **kwargs)
Create a service. โจ
Parameters
nameโ service name.typeโ service type. (typeorservice_typerequired.)service_typeโ service type. (typeorservice_typerequired.) yes both are listed, and yes one of them is required, we're not making the rules ๐descriptionโ service description (optional).enabledโ whether the service is enabled (v3 only)
Returns
an identity Service object
Raises
SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call. ๐ญ
create_stack(name, tags=None, template_file=None, template_url=None, template_object=None, files=None, rollback=True, wait=False, timeout=3600, environment_files=None, **parameters)
Create a stack. stacking, but make it cloud ๐ง
Parameters
nameโ name of the stack.tagsโ list of tag(s) of the stack. (optional)template_fileโ path to the template.template_urlโ URL of template.template_objectโ URL to retrieve template object.
filesโ a dict of extra file content you wanna include ๐rollbackโ turn on rollback if the create fails (yes queen, safety net)waitโ whether to wait for the delete to finishtimeoutโ stack create timeout, counted in seconds โฑ๏ธenvironment_filesโ paths to the environment files you want applied
Any other arguments you throw in get passed along as stack parameters, and those take precedence over anything those same parameters say inside the environments. Lowkey important, bestie.
Only one of template_file, template_url, template_object should be specified. Pick one. Just one. ๐
Returns โ a dict holding the stack description
Raises โ SDKException (as in openstack.exceptions.SDKException) if something goes sideways during the OpenStack API call ๐ญ
create_subnet
create_subnet(network_name_or_id, cidr=None, ip_version=4,
enable_dhcp=False, subnet_name=None, tenant_id=None,
allocation_pools=None, gateway_ip=None, disable_gateway_ip=False,
dns_nameservers=None, host_routes=None, ipv6_ra_mode=None,
ipv6_address_mode=None, prefixlen=None,
use_default_subnetpool=False, subnetpool_name_or_id=None,
**kwargs)
Make a subnet on a network you already picked out. Slay ๐ฆ
Parameters
network_name_or_id(string) โ the unique name or ID of the attached network. Heads up: if the name you give isn't unique, it raises an exception ๐cidr(string) โ the CIDR. Only one ofcidr,use_default_subnetpoolandsubnetpool_name_or_idcan be specified at the same time. One. Not two. Not three.ip_version(int) โ the IP version, and it's either4or6enable_dhcp(bool) โ set toTrueif DHCP is enabled andFalseif it's disabled. Default isFalse.subnet_name(string) โ the name of the subnettenant_id(string) โ the ID of the tenant that owns the network. Only admin users can hand out a tenant ID that isn't their own ๐allocation_poolsโ a list of dictionaries with the start and end addresses for the allocation pools. Like, for example:
[{"start": "192.168.199.2", "end": "192.168.199.254"}]
gateway_ip(string) โ the gateway IP address. When you specify bothallocation_poolsandgateway_ip, you must make sure the gateway IP doesn't overlap with the allocation pools you gave. No overlap, no drama ๐disable_gateway_ip(bool) โ set toTrueif the gateway IP address is disabled andFalseif it's enabled. It is not allowed alongsidegateway_ip. Default isFalse.dns_nameserversโ a list of DNS name servers for the subnet. For example:
["8.8.8.7", "8.8.8.8"]
host_routesโ a list of host route dictionaries for the subnet. For example:
[
{"destination": "0.0.0.0/0", "nexthop": "123.456.78.9"},
{"destination": "192.168.0.0/24", "nexthop": "192.168.0.1"},
]
ipv6_ra_mode(string) โ IPv6 Router Advertisement mode. Valid values are:'dhcpv6-stateful','dhcpv6-stateless', or'slaac'.ipv6_address_mode(string) โ IPv6 address mode. Valid values are:'dhcpv6-stateful','dhcpv6-stateless', or'slaac'.prefixlen(string) โ the prefix length to use for subnet allocation from a subnetpooluse_default_subnetpool(bool) โ use the default subnetpool forip_versionto obtain a CIDR. Only one ofcidr,use_default_subnetpoolandsubnetpool_name_or_idmay be specified at the same time. (Yes, saying it again. It's that serious.)subnetpool_name_or_id(string) โ the unique name or id of the subnetpool to grab a CIDR from. Only one ofcidr,use_default_subnetpoolandsubnetpool_name_or_idmay be specified at the same time.kwargsโ key value pairs passed straight to the Neutron API โจ
Returns โ the created network Subnet object ๐
Raises โ SDKException (that's openstack.exceptions.SDKException) on operation error
create_user
create_user(name, password=None, email=None,
default_project=None, enabled=True, domain_id=None,
description=None)
Create a user. That's it, that's the whole thing. Iconic minimalism ๐
create_volume
create_volume(size, wait=True, timeout=None, image=None,
bootable=None, **kwargs)
Create a volume. Big storage energy ๐ฅ
Parameters
sizeโ size, in GB, of the volume you're creatingwaitโ if true, it waits for the volume to be createdtimeoutโ seconds to wait for volume creation.Noneis forever ๐imageโ (optional) image name, ID or object to create the volume frombootableโ (optional) make this volume bootable. If it's set,waitalso gets set to true.kwargsโ keyword arguments as expected for the cinder client
Returns โ the created volume Volume object
Raises โ ResourceTimeout (openstack.exceptions.ResourceTimeout) if the wait time is exceeded โฐ
Raises โ SDKException (openstack.exceptions.SDKException) on operation error
create_volume_backup
create_volume_backup(volume_id, name=None, description=None,
force=False, wait=True, timeout=None, incremental=False,
snapshot_id=None)
Create a volume backup. Because bestie, you need a backup ๐ซถ
Parameters
volume_idโ the ID of the volume to back upnameโ name of the backup. One gets generated for you if you don't provide one.descriptionโ description of the backup. Same deal, one gets generated if you don't provide one.forceโ if set toTruethe backup gets created even if the volume is attached to an instance; ifFalse, it won'twaitโ if true, it waits for the volume backup to be createdtimeoutโ seconds to wait for the volume backup creation.Noneis foreverincrementalโ if set to true, the backup will be incrementalsnapshot_idโ the UUID of the source snapshot to back up
Returns โ the created volume Backup object
Raises โ ResourceTimeout (openstack.exceptions.ResourceTimeout) if the wait time is exceeded
Raises โ SDKException (openstack.exceptions.SDKException) on operation error
create_volume_snapshot
create_volume_snapshot(volume_id, force=False, wait=True,
timeout=None, **kwargs)
Create a snapshot ๐ธ
Parameters
volume_idโ the ID of the volume to snapshotforceโ if set toTruethe snapshot gets created even if the volume is attached to an instance; ifFalse, it won'tnameโ name of the snapshot. One gets generated if you don't provide one.descriptionโ description of the snapshot. One gets generated if you don't provide one.waitโ if true, it waits for the volume snapshot to be createdtimeoutโ seconds to wait for the volume snapshot creation.Noneis forever
Returns โ the created volume Snapshot object
Raises โ ResourceTimeout (openstack.exceptions.ResourceTimeout) if the wait time is exceeded
Raises โ SDKException (openstack.exceptions.SDKException) on operation error
create_zone
create_zone(name, zone_type=None, email=None, description=None,
ttl=None, masters=None)
Create a brand new zone ๐ธ
Parameters
nameโ name of the zone being createdzone_typeโ type of the zone (primary/secondary)emailโ email of the zone owner (only applies ifzone_typeisprimary)descriptionโ description of the zonettlโ TTL (Time to live) value in secondsmastersโ master nameservers (only applies ifzone_typeissecondary)
Returns โ a dict representing the created zone โจ
Raises โ SDKException (openstack.exceptions.SDKException) on operation error
property current_location
Returns a utils.Munch explaining the current cloud location ๐
property current_project
Returns a utils.Munch describing the current project
property current_project_id
Get the current project ID ๐ชช
Returns the project_id of the current token scope. None means the token is domain scoped or unscoped.
Raises
keystoneauth1.exceptions.auth.AuthorizationFailureโ if a new token fetch fails. ๐ญkeystoneauth1.exceptions.auth_plugins.MissingAuthPluginโ if a plugin is not available. ๐
property current_user_id โ grabs the id of whoever's logged in rn, straight from the token. no cap, it just reads it off the token. ๐ซถ
delete_accelerator_request(uuid, filters=None)
Deletes a accelerator_request. bye bestie ๐
Parameters:
uuidโ the UUID of the accelerator request you're deleting.filtersโ dict of filter conditions to push down.
Returns: True if delete succeeded, False otherwise.
delete_aggregate(name_or_id)
Deletes a host aggregate. it's giving cleanup era โจ
Parameters:
name_or_idโ Name or ID of the host aggregate to delete.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
delete_autocreated_image_objects(container=None, segment_prefix=None)
Deletes all objects autocreated for image uploads. like, every single one. ๐งน
Lowkey you should NOT need this method most of the time โ shade is supposed to clean up the objects it uses for object-based image creation all on its own. but if something goes wrong and it turns out there are leaked objects chilling there, this method is the one to call to delete any objects that shade created on the user's behalf in service of image uploads. it's the cleanup crew fr fr. ๐
Parameters:
container(str) โ Name of the container. Defaults to'images'.segment_prefix(str) โ Prefix for the image segment names to delete. If not given, all image upload segments present are deleted.
Returns: True if deletion was successful, else False.
delete_cluster_template(name_or_id)
Deletes a cluster template. poof ๐
Parameters:
name_or_idโ Name or unique ID of the cluster template.
Returns: True if the delete succeeded, False if the cluster template was not found.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
delete_coe_cluster(name_or_id)
Deletes a COE cluster. โจ
Parameters:
name_or_idโ Name or unique ID of the cluster.
Returns: True if the delete succeeded, False if the cluster was not found.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
delete_compute_quotas(name_or_id)
Deletes quota for a project. quota? gone. ๐ฆ
Parameters:
name_or_idโ project name or id.
Raises: SDKException <#openstack.exceptions.SDKException> if it's not a valid project or the nova client call failed.
delete_container(name)
Deletes an object-store container. ๐
Parameters:
name(str) โ Name of the container to delete.
delete_device_profile(uuid, filters=None)
Deletes a device_profile. slay ๐
Parameters:
uuidโ the UUID of the device profile to be deleted.filtersโ dict of filter conditions to push down.
Returns: True if delete succeeded, False otherwise.
delete_domain(domain_id=None, name_or_id=None)
Deletes a Keystone domain. ๐
Parameters:
domain_idโ ID of the domain to delete.name_or_idโ Name or unique ID of the domain.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
delete_endpoint(id)
Deletes a Keystone endpoint. icon behavior ๐ฅ
Parameters:
idโ ID of the endpoint to delete.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
delete_endpoint_group(id)
Deletes a Keystone endpoint group. the whole squad, deleted. ๐ญ
Parameters:
idโ ID of the endpoint group to delete.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
delete_firewall_group(name_or_id, filters=None)
Deletes a firewall group. prints a debug message in case the to-be-deleted resource was not found โ so it's not just silently ghosting you, ok? ๐
Parameters:
name_or_idโ firewall group name or id.filters(dict) โ optional filters.
Raises: DuplicateResource on multiple matches.
Returns: True if resource is successfully deleted, False otherwise.
Return type: bool
delete_firewall_policy(name_or_id, filters=None)
Deletes a firewall policy. prints a debug message in case the to-be-deleted resource was not found. ๐
Parameters:
name_or_idโ firewall policy name or id.filtersโ
A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Raises: DuplicateResource on multiple matches.
Returns: True if resource is successfully deleted, False otherwise.
Return type: bool
delete_firewall_rule(name_or_id, filters=None)
Deletes a firewall rule.
Prints a debug message in case the to-be-deleted resource was not found. (again, no silent ghosting ๐)
Parameters:
name_or_idโ firewall rule name or id.filtersโ
A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Raises: DuplicateResource on multiple matches.
Returns: True if resource is successfully deleted, False otherwise.
Return type: bool
delete_flavor(name_or_id)
Deletes a flavor. bye flavor ๐
Parameters:
name_or_idโ ID or name of the flavor to delete.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
delete_floating_ip(floating_ip_id, retry=1)
Deallocates a floating IP from a project. releasing it back into the wild ๐
Parameters:
floating_ip_idโ a floating IP address ID.retryโ number of times to retry. Optional, defaults to1, which is in addition to the initial delete call. A value of0will also cause no checking of results to occur.
Returns: True if the IP address has been deleted, False if the IP address was not found.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
delete_group(name_or_id)
Deletes a group. ๐ฏ
Parameters:
name_or_idโ Name or unique ID of the group.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
delete_image(name_or_id, wait=False, timeout=3600, delete_objects=True)
Deletes an existing image. ๐ผ๏ธ
Parameters:
name_or_idโ Name of the image to be deleted.waitโ IfTrue, waits for image to be deleted.timeoutโ Seconds to wait for image deletion.Noneis forever. (yes, forever forever ๐ญ)delete_objectsโ IfTrue, also deletes uploaded swift objects.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> if there are problems deleting.
delete_keypair(name)
Deletes a keypair. ๐
Parameters:
nameโ Name of the keypair to delete.
Returns: True if delete succeeded, False otherwise.
(...and yeah, that previous one raises SDKException on operation error too โ forgot to mention it before the page break, my bad bestie ๐ญ)
โ๏ธ delete_network(name_or_id)
Delete a network. Poof. Gone. ๐จ
Parameters
- name_or_id โ Name or ID of the network being deleted.
Returns
True if delete succeeded, False otherwise.
Raises SDKException on operation error.
๐งฎ delete_network_quotas(name_or_id)
Delete network quotas for a project. Bye-bye limits ๐
Parameters
- name_or_id โ project name or id
Returns
dict with the quotas
Raises SDKException if it's not a valid project or the network client call failed
๐๏ธ delete_object(container, name, meta=None)
Delete an object from a container. Like yeeting a file out of a bucket, but make it cloud โ๏ธ
Parameters
- container (string) โ Name of the container holding the object.
- name (string) โ Name of the object to delete.
- meta (dict) โ Metadata for the object in question. (optional, will be fetched if not provided)
Returns
True if delete succeeded, False if the object was not found.
Raises SDKException on operation error.
๐ delete_port(name_or_id)
Delete a port ๐ช
Parameters
- name_or_id โ ID or name of the port to delete.
Returns
True if delete succeeded, False otherwise.
Raises SDKException on operation error.
๐ delete_project(name_or_id, domain_id=None)
Delete a project. Iconic behaviour, honestly ๐
Parameters
- name_or_id โ Name or unique ID of the project.
- domain_id โ Domain ID to scope the retrieved project.
Returns
True if delete succeeded, False if the project was not found.
Raises SDKException if something goes wrong during the OpenStack API call
๐ฆ delete_qos_bandwidth_limit_rule(policy_name_or_id, rule_id)
Delete a QoS bandwidth limit rule. Speed limits, but make it deletion ๐
Parameters
- policy_name_or_id (string) โ Name or ID of the QoS policy to which rule is associated.
- rule_id (string) โ ID of rule to update.
Raises SDKException on operation error.
๐ท๏ธ delete_qos_dscp_marking_rule(policy_name_or_id, rule_id)
Delete a QoS DSCP marking rule ๐ฏ
Parameters
- policy_name_or_id (string) โ Name or ID of the QoS policy to which rule is associated.
- rule_id (string) โ ID of rule to update.
Raises SDKException on operation error.
๐ delete_qos_minimum_bandwidth_rule(policy_name_or_id, rule_id)
Delete a QoS minimum bandwidth rule. (Note: this one says delete, not update โ the other two said update, we're just reporting what the page says, no cap ๐คทโโ๏ธ)
Parameters
- policy_name_or_id (string) โ Name or ID of the QoS policy to which rule is associated.
- rule_id (string) โ ID of rule to delete.
Raises SDKException on operation error.
๐ delete_qos_policy(name_or_id)
Delete a QoS policy. Whole policy, gone, slay โจ
Parameters
- name_or_id โ Name or ID of the policy being deleted.
Returns
True if delete succeeded, False otherwise.
Raises SDKException on operation error.
๐ delete_recordset(zone, name_or_id)
Delete a recordset.
Parameters
- zone โ Name, ID or
openstack.dns.v2.zone.Zoneinstance of the zone managing the recordset. - name_or_id โ Name or ID of the recordset being deleted.
Returns
True if delete succeeded, False otherwise.
Raises SDKException on operation error.
๐ delete_role(name_or_id, **kwargs)
Delete a Keystone role. Bye permission-dispenser ๐ซถ
Parameters
- name_or_id โ Name or unique ID of the role.
- domain_id โ domain id (v3)
Returns
True if delete succeeded, False otherwise.
Raises SDKException if something goes wrong during the OpenStack API call.
๐ฐ๏ธ delete_router(name_or_id)
Delete a logical router.
Heads up bestie, this is the important bit: if a name, instead of a unique UUID, is supplied, it is possible that we could find more than one matching router since names are not required to be unique. An error will be raised in this case. So like... use the ID if you can ๐ญ
Parameters
- name_or_id โ Name or ID of the router being deleted.
Returns
True if delete succeeded, False otherwise.
Raises SDKException on operation error.
๐ก๏ธ delete_security_group(name_or_id)
Delete a security group
Parameters
- name_or_id (string) โ The name or unique ID of the security group.
Returns
True if delete succeeded, False otherwise.
Raises SDKException on operation error.
Raises OpenStackCloudUnavailableFeature if security groups are not supported on this cloud.
๐ง delete_security_group_rule(rule_id)
Delete a security group rule
Parameters
- rule_id (string) โ The unique ID of the security group rule.
Returns
True if delete succeeded, False otherwise.
Raises SDKException on operation error.
Raises OpenStackCloudUnavailableFeature if security groups are not supported on this cloud.
๐ delete_server(name_or_id, wait=False, timeout=180, delete_ips=False, delete_ip_retry=1)
Delete a server instance. Whole entire server. Into the void ๐ฅ
Parameters
- name_or_id โ name or ID of the server to delete
- wait (bool) โ If true, waits for server to be deleted.
- timeout (int) โ Seconds to wait for server deletion.
- delete_ips (bool) โ If true, deletes any floating IPs associated with the instance.
- delete_ip_retry (int) โ Number of times to retry deleting any floating ips, should the first try be unsuccessful.
Returns
True if delete succeeded, False otherwise if the server does not exist.
Raises SDKException on operation error.
๐ฏ delete_server_group(name_or_id)
Delete a server group.
Parameters
- name_or_id โ Name or ID of the server group to delete
Returns
True if delete succeeded, False otherwise
Raises SDKException on operation error.
๐ท๏ธ delete_server_metadata(name_or_id, metadata_keys)
Delete metadata from a server instance.
Parameters
- name_or_id (str) โ The name or ID of the server instance to update.
- metadata_keys โ A list with the keys to be deleted from the server instance.
Returns
None
Raises SDKException on operation error.
๐งพ delete_service(name_or_id)
Delete a Keystone service.
Parameters
- name_or_id โ Name or unique ID of the service.
Returns
True if delete succeeded, False otherwise.
Raises SDKException if something goes wrong during the OpenStack API call
๐ฅ delete_stack(name_or_id, wait=False)
Delete a stack
Parameters
- name_or_id โ Stack name or ID.
- wait โ Whether to wait for the delete to finish
Returns
True if delete succeeded, False if the stack was not found.
Raises SDKException if something goes wrong during the OpenStack API call
๐ delete_subnet(name_or_id)
Delete a subnet.
Okay same warning as the router one, because apparently we gotta say it twice: if a name, instead of a unique UUID, is supplied, it is possible that we could find more than one matching subnet since names are not required to be unique. An error will be raised in this case. Names are lowkey not it, use IDs ๐
Parameters
name_or_idโ Name or ID of the subnet being deleted.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
delete_unattached_floating_ips(retry=1)
Okay so this one safely deletes unattached floating IPs. If the cloud can safely purge any unattached floating IPs without race conditions, it does so. ๐
Safely here means a specific thing. It means that you are not running this while another process that might do a two step create/attach is running. You can safely run this method while another process is creating servers and attaching floating IPs to them if either that process is using add_auto_ip from shade, or is creating the floating IPs by passing in a server to the create_floating_ip call. iykyk โจ
Parameters
retryโ number of times to retry. Optional, defaults to1, which is in addition to the initial delete call. A value of0will also cause no checking of results to occur.
Returns: Number of Floating IPs deleted, False if none.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
delete_volume(name_or_id, wait=True, timeout=None, force=False)
Delete a volume. Main character deletion energy, but make it safe. ๐ฆ
Parameters
name_or_idโ Name or unique ID of the volume.waitโ If true, waits for volume to be deleted.timeoutโ Seconds to wait for volume deletion.Noneis forever.forceโ Force delete volume even if the volume is indeletingorerror_deletingstate.
Returns: True if deletion was successful, else False.
Raises: ResourceTimeout (#openstack.exceptions.ResourceTimeout) if wait time exceeded.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
delete_volume_backup(name_or_id=None, force=False, wait=False, timeout=None)
Delete a volume backup. Bestie, check the force/wait combo before you yeet it. ๐
Parameters
name_or_idโ Name or unique ID of the volume backup.forceโ Allow delete in state other thanerrororavailable.waitโ If true, waits for volume backup to be deleted.timeoutโ Seconds to wait for volume backup deletion.Noneis forever.
Returns: True if deletion was successful, else False.
Raises: ResourceTimeout (#openstack.exceptions.ResourceTimeout) if wait time exceeded.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
delete_volume_quotas(name_or_id)
Delete volume quotas for a project. Quota cleanup era. ๐
Parameters
name_or_idโ project name or id.
Returns: The deleted volume QuotaSet object.
Raises: SDKException (#openstack.exceptions.SDKException) if it's not a valid project or the call failed.
delete_volume_snapshot(name_or_id=None, wait=False, timeout=None)
Delete a volume snapshot. Snap it away, but mind the wait. ๐
Parameters
name_or_idโ Name or unique ID of the volume snapshot.waitโ If true, waits for volume snapshot to be deleted.timeoutโ Seconds to wait for volume snapshot deletion.Noneis forever.
Returns: True if deletion was successful, else False.
Raises: ResourceTimeout (#openstack.exceptions.ResourceTimeout) if wait time exceeded.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
delete_zone(name_or_id)
Delete a zone. Zone be gone, respectfully. ๐ฆ
Parameters
name_or_idโ Name or ID of the zone being deleted.
Returns: True if delete succeeded, False otherwise.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
detach_ip_from_server(server_id, floating_ip_id)
Detach a floating IP from a server. Unattach that little IP, bestie. โจ
Parameters
server_idโ ID of a server.floating_ip_idโ Id of the floating IP to detach.
Returns: True if the IP has been detached, or False if the IP wasn't attached to any server.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
detach_port_from_machine(name_or_id, port_name_or_id)
Detach a virtual port from the bare metal machine. Port detachment, but make it metal. ๐
Parameters
name_or_id(string) โ A machine name or UUID.port_name_or_id(string) โ A port name or UUID. Note that this is a Network service port, not a bare metal NIC.
Returns: Nothing.
detach_volume(server, volume, wait=True, timeout=None)
Detach a volume from a server. Volume breakup, but clean. ๐โจ
Parameters
serverโ The server dict to detach from.volumeโ The volume dict to detach.waitโ If true, waits for volume to be detached.timeoutโ Seconds to wait for volume detachment.Noneis forever.
Returns: None
Raises: ResourceTimeout (#openstack.exceptions.ResourceTimeout) if wait time exceeded.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
download_image(name_or_id, output_path=None, output_file=None, chunk_size=1048576, stream=False)
Download an image by name or ID. Literally saving the whole image to your whole vibe. ๐
Parameters
name_or_id(str) โ Name or ID of the image.output_pathโ the output path to write the image to. Either this oroutput_filemust be specified.output_fileโ a file object (or file-like object) to write the image data to. Onlywrite()will be called on this object. Either this oroutput_pathmust be specified.chunk_size(int) โ size in bytes to read from the wire and buffer at one time. Defaults to1024 * 1024 = 1 MiB.Param bool stream:โ whether to stream the output inchunk_size.
Returns: When output_path and output_file are not given - the bytes comprising the given Image when stream is False, otherwise a requests.Response instance. When output_path or output_file are given - an image Image instance (#openstack.image.v2.image.Image).
Raises: SDKException (#openstack.exceptions.SDKException) in the event download_image is called without exactly one of either output_path or output_file.
Raises: BadRequestException (#openstack.exceptions.BadRequestException) if no images are found matching the name or ID provided.
export_volume_backup(backup_id)
Export a volume backup. Backup export, no cap. ๐ฆ
Parameters
backup_idโ the ID of the backup.
Returns: The backup export record fields. This is a dict when using the (deprecated) v2 API and a requests.Response when using the v3 API.
Raises: ResourceTimeout (#openstack.exceptions.ResourceTimeout) if wait time exceeded.
Raises: SDKException (#openstack.exceptions.SDKException) on operation error.
get_aggregate(name_or_id, filters=None)
Get an aggregate by name or ID. Aggregate fetch, lowkey iconic. โญ
Parameters
name_or_idโ Name or ID of the aggregate.filters(dict) โ DEPRECATED A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{
'availability_zone': 'nova',
'metadata': {'cpu_allocation_ratio': '1.0'},
}
Returns: An aggregate dict or None if no matching aggregate is found.
get_cluster_template(name_or_id, filters=None, detail=False)
Get a cluster template by name or ID. Cluster template fetch, bestie edition. ๐
Parameters
name_or_idโ Name or ID of the cluster template.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR A string containing a jmespath expression for further filtering. Example::
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns: A cluster template dict or None if no matching cluster template is found.
get_coe_cluster(name_or_id, filters=None)
Get a COE cluster by name or ID. ๐ซถ
Parameters:
name_or_idโ name or ID of the cluster, bestie.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries, iykyk. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] |
[?other.gender]==`Female`]"
Returns: a container infrastructure management Cluster object if found, else None.
get_coe_cluster_certificate(cluster_id)
Get details about the CA certificate for a cluster by name or ID ๐ (yes, "by name or ID" in the summary but the arg is the ID, that's just how it is, don't @ me).
Parameters:
cluster_idโ ID of the cluster.
Returns: details about the CA certificate for the given cluster.
get_compute_limits(name_or_id=None)
Get absolute compute limits for a project.
Parameters:
name_or_idโ (optional) project name or ID to get limits for, if it's different from the current project.
Returns: a compute AbsoluteLimits object.
Raises: SDKException <#openstack.exceptions.SDKException> if it's not a valid project ๐ญ
get_compute_quotas(name_or_id)
Get quota for a project.
Parameters:
name_or_idโ project name or id.
Returns: a compute QuotaSet object if found, else None.
Raises: SDKException <#openstack.exceptions.SDKException> if it's not a valid project.
get_compute_usage(name_or_id, start=None, end=None)
Get usage for a specific project โฐ
Parameters:
name_or_idโ project name or id.startโdatetime.datetimeor string. Start date in UTC. Defaults to2010-07-06T12:00:00Z(the date the OpenStack project was started, iconic origin story ngl).endโdatetime.datetimeor string. End date in UTC. Defaults to now.
Returns: a Usage <#openstack.compute.v2.usage.Usage> object.
Raises: SDKException <#openstack.exceptions.SDKException> if it's not a valid project.
get_container(name, skip_cache=False)
Get metadata about a container ๐
Parameters:
name(str) โ name of the container to get metadata for.skip_cache(bool) โ ignored. Present for backwards compatibility. (It literally does nothing, bestie, it's just there so old code doesn't break ๐)
Returns: an object store Container object if found, else None.
get_container_access(name)
Get the control list from a container ๐
Parameters:
name(str) โ name of the container.
Returns: the control list for the container.
Raises: SDKException <#openstack.exceptions.SDKException> if the container was not found or container access could not be determined.
get_default_network()
Return the network that is configured to be the default interface. The main character network, basically ๐
Returns: a network Network object if one is found.
get_domain(domain_id=None, name_or_id=None, filters=None)
Get exactly one Keystone domain.
Parameters:
domain_idโ ID of the domain.name_or_idโ name or unique ID of the domain.filtersโ DEPRECATED ๐จ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns: an identity Domain object.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
get_endpoint(id, filters=None)
Get exactly one Keystone endpoint.
Parameters:
idโ ID of endpoint.
Returns: an identity Endpoint object.
get_endpoint_group(id)
Get exactly one Keystone endpoint group.
Parameters:
idโ ID of endpoint group.
Returns: an identity EndpointGroup object.
get_external_ipv4_floating_networks()
Return the networks that are configured to route northbound ๐
Returns: a list of network Network objects if any are found.
get_external_ipv4_networks()
Return the networks that are configured to route northbound.
Returns: a list of network Network objects if any are found.
get_external_ipv6_networks()
Return the networks that are configured to route northbound.
Returns: a list of network Network objects if any are found.
get_external_networks()
Return the networks that are configured to route northbound.
Heads up bestie โ ๏ธ โ this one should be avoided in favor of the specific ipv4/ipv6 method, but is here for backwards compatibility. It's giving legacy energy.
Returns: a list of network Network objects if any are found.
get_firewall_group(name_or_id, filters=None)
Retrieves firewall group ๐ฅ
Parameters:
name_or_idโ firewall group name or id.filters(dict) โ optional filters.
Raises: DuplicateResource on multiple matches.
Returns: a network FirewallGroup object if found, else None.
get_firewall_policy(name_or_id, filters=None)
Retrieves a single firewall policy.
Parameters:
name_or_idโ firewall policy name or id.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] |
[?other.gender]==`Female`]"
Raises: DuplicateResource on multiple matches.
Returns: a network FirewallPolicy object if found, else None.
get_firewall_rule(name_or_id, filters=None)
Retrieves a single firewall rule.
Parameters:
name_or_idโ firewall rule name or id.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] |
[?other.gender]==`Female`]"
Raises: DuplicateResource on multiple matches.
Returns: a network FirewallRule object if found, else None.
get_flavor(name_or_id, filters=None, get_extra=True)
Get a flavor by name or ID, slay ๐
Parameters:
name_or_idโ name or ID of the flavor.filtersโ DEPRECATED ๐จ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] |
[?other.gender]==`Female`]"
get_extraโ whether or not thelist_flavorscall should get the extra flavor specs.
Returns: a compute Flavor object if found, else None.
get_flavor_by_id(id, get_extra=False)
Get a flavor by ID.
Parameters:
idโ ID of the flavor.get_extraโ whether or not thelist_flavorscall should get the extra flavor specs. (Note it defaults toFalsehere, notTrueโ different vibe from its sibling above ๐)
Returns: a compute Flavor object if found, else None.
get_flavor_by_ram(ram, include=None, get_extra=True)
Get a flavor based on amount of RAM available ๐ง
Finds the flavor with the least amount of RAM that is at least as much as the specified amount. If include is given, further filter based on matching flavor name.
Parameters:
ram(int) โ minimum amount of RAM.include(string) โ If given, will return a flavor whose name contains this string as a substring. ๐get_extraโ Whether to fetch extra specs. โจ
Returns: A compute Flavor object. ๐
Raises SDKException <#openstack.exceptions.SDKException> if no matching flavour could be found. ๐ญ
get_flavor_name(flavor_id)
Get the name of a flavor, bestie. ๐
Parameters:
flavor_idโ ID of the flavor.
Returns: The name of the flavor if a match if found, else None. ๐
get_floating_ip(id, filters=None)
Get a floating IP by ID. ๐
Parameters:
idโ ID of the floating IP.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns: A floating IP openstack.network.v2.floating_ip.FloatingIP or None if no matching floating IP is found. ๐ฆ
get_floating_ip_by_id(id)
Get a floating ip by ID.
Parameters:
idโ ID of the floating ip.
Returns: A floating ip :class:`~openstack.network.v2.floating_ip.FloatingIP. ๐
get_group(name_or_id, filters=None, domain_id=None)
Get exactly one Keystone group. ๐
Parameters:
name_or_idโ Name or unique ID of the group(s).domain_idโ Domain ID to scope the retrieved group.
Returns: An identity Group object.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call. ๐ญ
get_image(name_or_id, filters=None)
Get an image by name or ID. ๐ผ๏ธ
Parameters:
name_or_idโ Name or ID of the image.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns: An image openstack.image.v2.image.Image <#openstack.image.v2.image.Image> object. ๐ธ
get_image_by_id(id)
Get a image by ID.
Parameters:
idโ ID of the image.
Returns: An image openstack.image.v2.image.Image <#openstack.image.v2.image.Image> object. โจ
get_internal_ipv4_networks()
Return the networks that are configured to not route northbound. ๐ฐ๏ธ
Returns: A list of network Network objects if any are found.
get_internal_ipv6_networks()
Return the networks that are configured to not route northbound. ๐ฐ๏ธ
Returns: A list of network Network objects if any are found.
get_internal_networks()
Return the networks that are configured to not route northbound. ๐ฐ๏ธ
โ ๏ธ This should be avoided in favor of the specific ipv4/ipv6 method, but is here for backwards compatibility.
Returns: A list of network Network objects if any are found.
get_keypair(name_or_id, filters=None, *, user_id=None)
Get a keypair by name or ID. ๐
Parameters:
name_or_idโ Name or ID of the keypair.filtersโ ๐จ DEPRECATED A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
user_idโ User to retrieve keypair from.
Returns: A compute Keypair object if found, else None. ๐
get_machine(name_or_id)
Get Machine by name or uuid. ๐ค
Search the baremetal host out by utilizing the supplied id value which can consist of a name or UUID.
Parameters:
name_or_idโ A node name or UUID that will be looked up.
Return type: Node <#openstack.baremetal.v1.node.Node>.
Returns: The node found or None if no nodes are found. ๐ฆ
get_machine_by_mac(mac)
Get machine by port MAC address. ๐
Parameters:
macโ Port MAC address to query in order to return a node.
Return type: Node <#openstack.baremetal.v1.node.Node>.
Returns: The node found or None if no nodes are found. ๐ซ
get_nat_destination()
Return the network that is configured to be the NAT destination. ๐
Returns: A network Network object if one is found.
get_nat_source()
Return the network that is configured to be the NAT destination. ๐
Returns: A network Network object if one is found.
get_network(name_or_id, filters=None)
Get a network by name or ID. ๐ธ๏ธ
Parameters:
name_or_idโ Name or ID of the network.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns: A network Network object if found, else None. โจ
get_network_by_id(id)
Get a network by ID.
Parameters:
idโ ID of the network.
Returns: A network Network object if found, else None. ๐
get_network_extensions()
Get Cloud provided network extensions. โ๏ธ
Returns: A set of Neutron extension aliases. ๐
get_network_quotas(name_or_id, details=False)
Get network quotas for a project. ๐
Parameters:
name_or_idโ project name or iddetailsโ if set toTrueit will return details about usage of quotas by given project
Returns: A network Quota object if found, else None.
Raises SDKException <#openstack.exceptions.SDKException> if it's not a valid project. ๐ญ
get_nic_by_mac(mac)
Get bare metal NIC by its hardware address (usually MAC). ๐
get_object(container, obj, query_string=None, resp_chunk_size=1024, outfile=None, stream=False)
Get the headers and body of an object. ๐ฆ
Parameters:
container(string) โ Name of the container.obj(string) โ Name of the object.query_string(string) โ Query args for uri. (delimiter, prefix, etc.)resp_chunk_size(int) โ Chunk size of data to read. Only used if the results are being written to a file or stream isTrue. (optional, defaults to 1k)outfileโ Write the object to a file instead of returning the contents. If this option is given, body in the return tuple will beNone.outfilecan either be a file path given as a string, or a File like object.
Returns: Tuple (headers, body) of the object, or None if the object is not found (404). ๐ซถ
Raises SDKException <#openstack.exceptions.SDKException> on operation error. ๐
get_object_capabilities()
Get infomation about the object-storage service. ๐๏ธ
The object-storage service publishes a set of capabilities that include metadata about maximum values and thresholds.
Returns: An object store Info object. ๐
get_object_metadata(container, name)
Get object metadata. ๐ท๏ธ
Parameters:
containername
Returns: The object metadata. โจ
get_object_raw(container, obj, query_string=None, stream=False)
Get a raw response object for an object. ๐ง
Parameters:
container(string) โ Name of the container.obj(string) โ the name of the object, bestie.query_string(string) โ the query args for the uri (delimiter, prefix, etc., all that good stuff).stream(bool) โ whether we're streaming the response or not.
Returns โ a requests.Response ๐
Raises SDKException <#openstack.exceptions.SDKException> on operation error. ๐ญ
get_object_segment_size(segment_size)
okay so this one gets you a segment size that will actually work given the capabilities. so thoughtful of it ๐ซถ
Parameters โ segment_size
Returns โ a segment size. literally that's it, slay.
get_port(name_or_id, filters=None)
Get a port by name or ID.
Parameters
name_or_idโ the name or ID of the port.filtersโ a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a network Port object if found, else None. ๐
get_port_by_id(id)
Get a port by ID.
Parameters โ id โ the ID of the port.
Returns โ a network Port object if found, else None.
get_project(name_or_id, filters=None, domain_id=None)
Get exactly one project. exactly one. no crumbs, no extras ๐
Parameters
name_or_idโ name or unique ID of the project.filtersโ DEPRECATED โ ๏ธ a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
domain_idโ domain ID to scope the retrieved project.
Returns โ an identity Project object.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call. ๐ญ
get_qos_bandwidth_limit_rule(policy_name_or_id, rule_id)
Get a QoS bandwidth limit rule by name or ID.
Parameters
policy_name_or_id(string) โ name or ID of the QoS policy to which the rule should be associated.rule_idโ ID of the rule.
Returns โ a network QoSBandwidthLimitRule object if found, else None.
get_qos_dscp_marking_rule(policy_name_or_id, rule_id)
Get a QoS DSCP marking rule by name or ID.
Parameters
policy_name_or_id(string) โ name or ID of the QoS policy to which the rule should be associated.rule_idโ ID of the rule.
Returns โ a network QoSDSCPMarkingRule object if found, else None.
get_qos_minimum_bandwidth_rule(policy_name_or_id, rule_id)
Get a QoS minimum bandwidth rule by name or ID.
Parameters
policy_name_or_id(string) โ name or ID of the QoS policy to which the rule should be associated.rule_idโ ID of the rule.
Returns โ a network QoSMinimumBandwidthRule object if found, else None.
get_qos_policy(name_or_id, filters=None)
Get a QoS policy by name or ID.
Parameters
name_or_idโ name or ID of the policy.filtersโ a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a network QoSPolicy object if found, else None. โจ
get_qos_rule_type_details(rule_type, filters=None)
Get QoS rule type details by rule type name.
Parameters
rule_typeโ name of the QoS rule type.filtersโ a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a network QoSRuleType object if found, else None.
get_recordset(zone, name_or_id)
Get a recordset by name or ID.
Parameters
zoneโ name, ID oropenstack.dns.v2.zone.Zone<# openstack.dns.v2.zone.Zone>instance of the zone managing the recordset.name_or_idโ name or ID of the recordset.
Returns โ a recordset dict or None if no matching recordset is found. ๐ฆ
get_role(name_or_id, filters=None, domain_id=None)
Get a Keystone role.
Parameters
name_or_idโ name or unique ID of the role.domain_idโ domain ID to scope the retrieved role.
Returns โ an identity Role object if found, else None.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call. ๐ญ
get_router(name_or_id, filters=None)
Get a router by name or ID.
Parameters
name_or_idโ name or ID of the router.filtersโ a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a network Router object if found, else None. ๐
get_security_group(name_or_id, filters=None)
Get a security group by name or ID.
Parameters
name_or_idโ name or ID of the security group.filtersโ a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a security group openstack.network.v2.security_group.SecurityGroup or None if no matching security group is found. ๐
get_security_group_by_id(id)
Get a security group by ID.
Parameters โ id โ the ID of the security group.
Returns โ a security group openstack.network.v2.security_group.SecurityGroup.
get_server(name_or_id=None, filters=None, detailed=False, bare=False, all_projects=False)
Get a server by name or ID. the main character of compute calls ngl ๐
Parameters
name_or_idโ name or ID of the server.filtersโ DEPRECATED โ ๏ธ a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
detailedโ whether or not to add detailed additional information. Defaults toFalse.bareโ whether to skip adding any additional information to the server record. Defaults toFalse, meaning the addresses dict will be populated as needed from neutron. Setting toTrueimpliesdetailed = False. ๐ฅall_projectsโ whether to get the server from all projects or just the current auth scoped project.
Returns โ a compute Server object if found, else None.
get_server_by_id(id)
Get a server by ID.
Parameters
idโ ID of the server.
Returns
A compute Server object if found, else None.
๐ฅ๏ธ get_server_console(server, length=None)
Pulls the console log for a server โ yes, the actual scrolling wall of text, like the server's diary. ๐โจ
Parameters
serverโ the server you wanna fetch the console log for. Can be either a server dict or the Name or ID of the server.length(int) โ the number of lines you want from the end of the log. (optional, defaults to all โ so if you skip it you get the whole thing, no cap)
Returns
A string containing the text of the console log, or an empty string if the cloud does not support console logs.
Raises โ SDKException (openstack.exceptions.SDKException) if an invalid server argument is given, or if something else unforeseen happens. ๐ญ
๐ซ get_server_group(name_or_id=None, filters=None)
Grabs a server group by name or ID. Affinity girlies rise ๐
Parameters
name_or_idโ Name or ID of the server group.filtersโ DEPRECATED A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{
'policy': 'affinity',
}
OR a string containing a jmespath expression for further filtering. Example::
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns
A compute ServerGroup object if found, else None.
๐ get_server_id(name_or_id)
Finds the ID of a server. โจ
Parameters
name_or_id
Returns
The name of the server if found, else None. (yeah bestie, it says name โ that's literally what the manpage says, I'm not fixing it ๐)
๐ท๏ธ get_server_meta(server)
Gets the metadata for a server.
Deprecated since version โ use cloud.compute.fetch_server_metadata(server) instead. She's retired, respect her legacy though ๐
Parameters
server
Returns
The metadata for the server if found, else None.
๐ get_server_private_ip(server)
Gets the private IP of a server โ the inside-voice address, iykyk.
Parameters
server
Returns
The private IP of the server if set, else None.
๐ get_server_public_ip(server)
Gets the public IP of a server โ the one that's out here living its main character life on the internet.
Parameters
server
Returns
The public IP of the server if set, else None.
๐ซ get_service(name_or_id, filters=None)
Gets exactly one Keystone service. Not two. Not zero. One. ๐
Parameters
name_or_idโ Name or unique ID of the service.
Returns
an identity Service object
Raises โ SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call, or if multiple matches are found. ๐ค
๐ฅ get_stack(name_or_id, filters=None, resolve_outputs=True)
Gets exactly one stack. Heat stack bestie, not a pancake stack, but honestly same energy. ๐ฅ๐ฅ
Parameters
name_or_idโ Name or ID of the desired stack.filtersโ a dict containing additional filters to use. e.g.{'stack_status': 'CREATE_COMPLETE'}resolve_outputsโ IfTrue, then outputs for this stack will be resolved.
Returns
a openstack.orchestration.v1.stack.Stack containing the stack description
Raises โ SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call, or if multiple matches are found.
๐ get_subnet(name_or_id, filters=None)
Gets a subnet by name or ID.
Parameters
name_or_idโ Name or ID of the subnet.filtersโ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
Returns
A network Subnet object if found, else None.
๐ get_subnet_by_id(id)
Gets a subnet by ID โ no name games, straight to the ID.
Parameters
idโ ID of the subnet.
Returns
A network Subnet object if found, else None.
๐งบ get_subnetpool(name_or_id)
Gets a subnetpool by name or ID. The subnet pool, bestie โ the whole collection, not one little subnet. ๐ซถ
Parameters
name_or_idโ Name or ID of the subnetpool.
Returns
A network Subnetpool object if found, else None.
๐ค get_user(name_or_id, filters=None, domain_id=None)
Gets exactly one user. One. Singular. ๐
Parameters
name_or_idโ Name or unique ID of the user.filtersโ DEPRECATED A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
domain_idโ Domain ID to scope the retrieved user.
Returns
an identity User object
Raises โ SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call.
๐ชช get_user_by_id(user_id, normalize=None)
Gets a user by ID. Very demure, very ID-based. ๐
Parameters
user_id(string) โ user ID
Returns
an identity User object
๐พ get_volume(name_or_id, filters=None)
Gets a volume by name or ID.
Parameters
name_or_idโ Name or unique ID of the volume.filtersโ DEPRECATED A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns
A volume Volume object if found, else None.
๐ get_volume_attach_device(volume, server_id)
Returns the device name a volume is attached to, for a server. Handy lil trick: this can also be used to verify whether a volume is attached to a particular server at all. Vibe check for attachments ๐
Parameters
volumeโ The volume to fetch the device name from.server_idโ ID of server to check.
Returns
Device name if attached, None if volume is not attached.
๐๏ธ get_volume_backup(name_or_id, filters=None)
Gets a volume backup by name or ID. Your data's safety net, iconic behaviour honestly. ๐ฆ
Parameters
name_or_idโ Name or unique ID of the volume backup.filtersโ DEPRECATED A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns
A volume Backup object if found, else None.
๐ get_volume_by_id(id)
Gets a volume by ID.
Parameters
idโ ID of the volume.
Returns
A volume Volume object if found, else None.
๐ท๏ธ get_volume_id(name_or_id)
Gets the ID of a volume.
Parameters
name_or_idโ Name or unique ID of the volume.
Returns
The ID of the volume if found, else None.
๐ get_volume_limits(name_or_id=None)
Gets volume limits for the current project โ the receipts on how much room you've got. ๐ฅ
Parameters
name_or_idโ (optional) Project name or ID to get limits for, if different from the current project
Returns
The volume Limits object if found, else None.
๐ get_volume_quotas(name_or_id)
Gets volume quotas for a project.
Parameters
name_or_idโ project name or id
Returns
A volume QuotaSet object with the quotas
Raises โ SDKException (openstack.exceptions.SDKException) if it's not a valid project. ๐ซ
๐ธ get_volume_snapshot(name_or_id, filters=None)
Gets a volume by name or ID. (yep โ the manpage literally says "volume" here even though this is the snapshot one; I'm just the messenger bestie ๐)
Parameters
name_or_idโ Name or unique ID of the volume snapshot.filtersโ (and this is where our part cuts off โ catch you in the next bit ๐ซถ๐)filtersโ DEPRECATED ๐ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns: A volume Snapshot object if found, else None.
๐ซถ get_volume_snapshot_by_id(snapshot_id)
Takes a snapshot_id and gets a dict of the snapshot that matches that ID.
Note: this is more efficient than get_volume_snapshot. โก
param: snapshot_id: ID of the volume snapshot. :returns: A volume Snapshot object if found, else None.
๐ฆ get_volume_type(name_or_id, filters=None)
Get a volume type by name or ID.
Parameters:
name_or_idโ Name or unique ID of the volume type.filtersโ DEPRECATED A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns: A volume Type object if found, else None.
๐ get_volume_type_access(name_or_id)
Return a list of volume_type_access.
Parameters:
name_or_idโ Name or unique ID of the volume type.
Returns: A volume Type object if found, else None.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error. ๐ญ
๐ธ get_volumes(server, cache=None)
Get volumes for a server.
Parameters:
serverโ The server to fetch volumes for.cacheโ DEPRECATED This parameter no longer does anything. ๐
Returns: A list of volume Volume objects.
โจ get_zone(name_or_id, filters=None)
Get a zone by name or ID.
Parameters:
name_or_idโ Name or ID of the zone.filtersโ A dictionary of meta data to use for further filtering.
Returns: A zone dict or None if no matching zone is found.
๐ global_request(global_request_id)
Make a new Connection object with a global request id set.
Take the existing settings from the current Connection and construct a new Connection object with the global_request_id overridden.
from oslo_context import context
cloud = openstack.connect(cloud='example')
# Work normally
servers = cloud.list_servers()
cloud2 = cloud.global_request(context.generate_request_id())
# cloud2 sends all requests with global_request_id set
servers = cloud2.list_servers()
Additionally, this can be used as a context manager:
from oslo_context import context
c = openstack.connect(cloud='example')
# Work normally
servers = c.list_servers()
with c.global_request(context.generate_request_id()) as c2:
# c2 sends all requests with global_request_id set
servers = c2.list_servers()
Parameters:
global_request_idโ Theglobal_request_idto send.
๐ grant_role(name_or_id, user=None, group=None, project=None, domain=None, system=None, inherited=False, wait=False, timeout=60)
Grant a role to a user. ๐
Parameters:
name_or_id(string) โ Name or unique ID of the role.user(string) โ The name or id of the user.group(string) โ The name or id of the group. (v3)project(string) โ The name or id of the project.domain(string) โ The id of the domain. (v3)system(bool) โ The name of the system. (v3)inherited(bool) โ Whether the role assignment is inherited. (v3)wait(bool) โ Wait for role to be granted.timeout(int) โ Timeout to wait for role to be granted.
NOTE: domain is a required argument when the grant is on a project, user or group specified by name. In that situation, they are all considered to be in that domain. If different domains are in use in the same role grant, it is required to specify those by ID.
NOTE: forwaitandtimeout, sometimes granting roles is not instantaneous. ๐ญ
NOTE: precedence is given first toproject, thendomain, thensystem.
Returns: True if the role is assigned, otherwise False.
Raises: SDKException <#openstack.exceptions.SDKException> if the role cannot be granted.
๐ง insert_rule_into_policy(name_or_id, rule_name_or_id, insert_after=None, insert_before=None, filters=None)
Add firewall rule to a policy.
Adds firewall rule to the firewall_rules list of a firewall policy. Short-circuits and returns the firewall policy early if the firewall rule id is already present in the firewall_rules list. This method doesn't do re-ordering. If you want to move a firewall rule or down the list, you have to remove and re-add it. ๐ซ
Parameters:
name_or_idโ firewall policy name or id.rule_name_or_idโ firewall rule name or id.insert_afterโ rule name or id that should precede added rule.insert_beforeโ rule name or id that should succeed added rule.filters(dict) โ optional filters.
Raises: DuplicateResource on multiple matches.
Raises: NotFoundException if firewall policy or any of the firewall rules (inserted, after, before) is not found.
Returns: updated firewall policy.
Return type: FirewallPolicy.
๐ฅ inspect_machine(name_or_id, wait=False, timeout=3600)
Inspect a Barmetal machine.
Engages the Ironic node inspection behavior in order to collect metadata about the baremetal machine.
Parameters:
name_or_idโ String representing machine name or UUID value in order to identify the machine.waitโ Boolean value controlling if the method is to wait for the desired state to be reached or a failure to occur.timeoutโ Integer value, defaulting to3600seconds, for the wait state to reach completion.
Return type: Node <#openstack.baremetal.v1.node.Node>.
Returns: Current state of the node.
๐ is_object_stale(container, name, filename, file_md5=None, file_sha256=None)
Check to see if an object matches the hashes of a file.
Parameters:
containerโ Name of the container.nameโ Name of the object.filenameโ Path to the file.file_md5โ Pre-calculated md5 of the file contents. Defaults toNonewhich means calculate locally.file_sha256โ Pre-calculated sha256 of the file contents. Defaults toNonewhich means calculate locally.
๐ is_user_in_group(name_or_id, group_name_or_id)
Check to see if a user is in a group.
Parameters:
name_or_idโ Name or unique ID of the user.group_name_or_idโ Group name or ID.
Returns: True if user is in the group, False otherwise.
Raises: SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
โญ list_accelerator_requests(filters=None)
List all accelerator_requests.
Parameters:
filtersโ (optional) dict of filter conditions to push down.
Returns: A list of accelerator AcceleratorRequest objects.
๐ list_aggregates(filters=None)
List all available host aggregates.
Returns: A list of compute Aggregate objects.
๐ธ list_availability_zone_names(unavailable=False)
List names of availability zones.
Parameters:
unavailable(bool) โ Whether or not to include unavailable zones in the output. Defaults toFalse.
Returns: A list of availability zone names, or an empty list if the list could not be fetched.
๐ฆ list_cluster_templates(detail=False)
List cluster templates. โจ
detail(bool) โ ignored, bestie. Kept purely for backwards compat. ClusterTemplates always come back with full details anyway, no cap.
Returns โ a list of dicts holding the cluster template details.
Raises SDKException <#openstack.exceptions.SDKException> if literally anything goes sideways during the OpenStack API call.
list_coe_clusters()
List COE (Container Orchestration Engine) clusters. That's the whole vibe.
Returns โ a list of container infrastructure management Cluster objects.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call. ๐ญ
list_containers(full_listing=None, prefix=None)
List containers. Yes like the object store kind. ๐ซ
Parameters
full_listingโ ignored. Present for backwards compat, periodt.prefixโ only objects with this prefix will be returned. (optional)
Returns โ a list of object store Container objects.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
list_deployables(filters=None)
List all the available deployables. Every single one. ๐
Parameters
filtersโ (optional) dict of filter conditions to push down.
Returns โ a list of accelerator Deployable objects.
list_device_profiles(filters=None)
List all device_profiles โ the whole roster.
Parameters
filtersโ (optional) dict of filter conditions to push down.
Returns โ a list of accelerator DeviceProfile objects.
list_devices(filters=None)
List all devices. All of them. Every last one. ๐ฅ
Parameters
filtersโ (optional) dict of filter conditions to push down.
Returns โ a list of accelerator Device objects.
list_domains(**filters)
List Keystone domains. ๐
Returns โ a list of identity Domain objects.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
list_endpoint_groups(**kwargs)
List Keystone endpoint groups.
Returns โ a list of identity EndpointGroup objects.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
list_endpoints()
List Keystone endpoints.
Returns โ a list of identity Endpoint objects.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
list_firewall_groups(filters=None)
Lists firewall groups. ๐ฅ๐งฑ
Returns โ a list of network FirewallGroup objects.
list_firewall_policies(filters=None)
Lists firewall policies.
Parameters
filtersโ
A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] |
[?other.gender]==`Female`]"
Returns โ a list of network FirewallPolicy objects.
Return type โ list[FirewallPolicy]
list_firewall_rules(filters=None)
Lists firewall rules.
Parameters
filtersโ
A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] |
[?other.gender]==`Female`]"
Returns โ a list of network FirewallRule objects.
Return type โ list[FirewallRule]
list_flavor_access(flavor_id)
List access from a private flavor for a project/tenant. Private flavors stay private, iykyk. ๐
Parameters
flavor_id(string) โ ID of the private flavor.
Returns โ list of dicts with flavor_id and tenant_id attributes.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
list_flavors(get_extra=False)
List all available flavors. ๐
Parameters
get_extraโ whether or not to fetch extra specs for each flavor. The doc says defaults toTrue(yes, while the signature up there says=Falseโ I'm just the messenger ๐). The default behavior value can be overridden inclouds.yamlby settingopenstack.cloud.get_extra_specstoFalse.
Returns โ a list of compute Flavor objects.
list_floating_ip_pools()
List all available floating IP pools. ๐
NOTE: This function supports the nova-net view of the world. nova-net has been deprecated, so it's highly recommended to switch to using neutron. get_external_ipv4_floating_networks is what you should almost certainly be using. Like, seriously bestie.
Returns โ a list of floating IP pool objects.
list_floating_ips(filters=None)
List all available floating IPs. Floats, but make it cloud. โ๏ธ
Parameters
filtersโ (optional) dict of filter conditions to push down.
Returns โ a list of floating IP openstack.network.v2.floating_ip.FloatingIP.
list_groups(**kwargs)
List Keystone groups. Girl groups, but identity. ๐
Parameters
domain_idโ domain ID.
Returns โ a list of identity Group objects.
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
list_hypervisors(filters=None)
List all hypervisors.
Parameters
filtersโ additional query parameters passed to the API server.
Returns โ a list of compute Hypervisor objects.
list_images(filter_deleted=True, show_all=False)
Get available images. ๐ธ
Parameters
filter_deletedโ control whether deleted images are returned.show_allโ show all images, including images that are shared but not accepted. (By default in glance v2, shared images that have not been accepted are not shown.)show_allwill override the value offilter_deletedtoFalse. Yes, override. Watch out for that.
Returns โ a list of glance images.
list_keypairs(filters=None)
List all available keypairs. ๐
Parameters
filters
Returns โ a list of compute Keypair objects.
list_machines()
List Machines. Bare metal ones, main character energy. ๐ค
Returns โ list of Node <#openstack.baremetal.v1.node.Node>.
list_magnum_services()
List all Magnum services.
Returns โ a list of dicts containing the service details.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
list_networks(filters=None)
List all available networks. The whole web. ๐ธ๏ธ
Parameters
filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network Network objects.
list_nics()
Return a list of all bare metal ports.
list_nics_for_machine(uuid)
Returns a list of ports present on the machine node.
Parameters
uuidโ string representing the machine UUID value, in order to identify the machine.
Returns โ a list of ports.
list_objects(container, full_listing=True, prefix=None)
List objects. ๐ฆ
Parameters
containerโ name of the container to list objects in.full_listingโ ignored. Present for backwards compat.prefixโ only objects with this prefix will be returned. (optional)
Returns โ a list of object store Object objects.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
list_ports(filters=None)
List all available ports. ๐
Parameters
filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network Port objects.
list_ports_attached_to_machine(name_or_id)
List virtual ports attached to the bare metal machine. Bestie, note the arg is literally called name_or_id โ you get to pick which one. ๐ซถ
name_or_id(string) โ a machine name or a UUID, whichever you vibe with.
Returns โ a list of openstack.Resource objects that represent the ports. ๐
list_projects(domain_id=None, name_or_id=None, filters=None)
List projects. Bestie, this one's a classic โจ
With no parameters at all? It returns a full listing of every visible project. No cap, the whole thing.
Parameters
domain_idโ the Domain ID used to scope which projects get searched.name_or_idโ the name or the ID of the project(s) you're after.filtersโ a dictionary of meta data for further filtering. Heads up: the elements of this dictionary may themselves be dictionaries, iykyk. Like this:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR โ plot twist โ it can be a string containing a jmespath expression for further filtering:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of identity Project objects.
Raises SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call. ๐ญ
list_qos_bandwidth_limit_rules(policy_name_or_id, filters=None)
List all the available QoS bandwidth limit rules. ๐
Parameters
policy_name_or_id(string) โ the name or ID of the QoS policy from which rules should be listed.filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network QoSBandwidthLimitRule objects.
Raises ~openstack.exceptions.BadRequestException if the QoS policy will not be found. ๐
list_qos_dscp_marking_rules(policy_name_or_id, filters=None)
List all the available QoS DSCP marking rules. ๐
Parameters
policy_name_or_id(string) โ the name or ID of the QoS policy from which rules should be listed.filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network QoSDSCPMarkingRule objects.
Raises ~openstack.exceptions.BadRequestException if the QoS policy will not be found. ๐
list_qos_minimum_bandwidth_rules(policy_name_or_id, filters=None)
List all the available QoS minimum bandwidth rules. ๐ธ
Parameters
policy_name_or_id(string) โ the name or ID of the QoS policy from which rules should be listed.filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network QoSMinimumBandwidthRule objects.
Raises ~openstack.exceptions.BadRequestException if the QoS policy will not be found. ๐
list_qos_policies(filters=None)
List all the available QoS policies. Periodt. ๐
Parameters
filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network QosPolicy objects.
list_qos_rule_types(filters=None)
List all the available QoS rule types. Literally all of them. ๐
Parameters
filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network QosRuleType objects.
list_recordsets(zone)
List all the available recordsets. ๐ฆ
Parameters
zoneโ the name, the ID, or anopenstack.dns.v2.zone.Zoneinstance of the zone that manages the recordset.
Returns โ a list of recordsets.
list_role_assignments(filters=None)
List Keystone role assignments. ๐
Parameters
filters(dict) โ a dict of filter conditions. The acceptable keys are:'user'(string) โ User ID to be used as the query filter.'group'(string) โ Group ID to be used as the query filter.'project'(string) โ Project ID to be used as the query filter.'domain'(string) โ Domain ID to be used as the query filter.'system'(string) โ System name to be used as the query filter.'role'(string) โ Role ID to be used as the query filter.'inherited_to'(string) โ return inherited role assignments for either'projects'or'domains'.'os_inherit_extension_inherited_to'(string) โ deprecated, use'inherited_to'instead. (yes bestie, it's giving legacy ๐ฌ)'effective'(boolean) โ return effective role assignments.'include_subtree'(boolean) โ include subtree.
Heads up:'user'and'group'are mutually exclusive, and so are'domain'and'project'. Pick a lane. ๐
Returns โ a list of identity openstack.identity.v3.role_assignment.RoleAssignment objects.
Raises SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call. ๐ญ
list_roles(**kwargs)
List Keystone roles. Simple. Iconic. ๐
Returns โ a list of identity Role objects.
Raises SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call. ๐ญ
list_router_interfaces(router, interface_type=None)
List all the interfaces for a router. ๐
Parameters
router(dict) โ a router dict object.interface_type(string) โ one ofNone,"internal", or"external". This controls whether all interfaces, internal interfaces, or external interfaces get returned. Your call, bestie โจ
Returns โ a list of network Port objects.
list_routers(filters=None)
List all the available routers. ๐
Parameters
filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network Router objects.
list_security_groups(filters=None)
List all the available security groups. ๐ก๏ธ
Parameters
filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of security group openstack.network.v2.security_group.SecurityGroup.
list_server_groups()
List all the available server groups. ๐ฏโโ๏ธ
Returns โ a list of compute ServerGroup objects.
list_server_security_groups(server)
List all the security groups associated with the given server. ๐
Returns โ a list of security group dictionary objects.
list_servers(detailed=False, all_projects=False, bare=False, filters=None)
List all the available servers. The main character of listing methods, honestly. ๐
Parameters
detailedโ whether or not to add detailed additional information. Defaults toFalse.all_projectsโ whether to list servers from all projects or just the current auth-scoped project.bareโ whether to skip adding any additional information to the server record. Defaults toFalse, meaning theaddressesdict will be populated as needed from neutron. Setting this toTrueimpliesdetailed = False.filtersโ additional query parameters passed to the API server.
Returns โ a list of compute Server objects.
list_services()
List all Keystone services. โจ
Returns โ a list of identity Service object.
Raises SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call. ๐ญ
list_share_availability_zones()
List all the availability zones for the Shared File Systems service. ๐ธ
Returns โ a list of Shared File Systems Availability Zones.
list_stacks(**query)
List all the stacks. ๐ฅ
Parameters
queryโ query parameters to limit the stacks.
Returns โ a list of openstack.orchestration.v1.stack.Stack objects containing the stack description.
Raises SDKException (openstack.exceptions.SDKException) if something goes wrong during the OpenStack API call. ๐ญ
list_subnets(filters=None)
List all the available subnets. ๐
Parameters
filtersโ (optional) a dict of filter conditions to push down.
Returns โ a list of network Subnet objects.
list_users(**kwargs)
List users. ๐ซถ
Parameters
namedomain_idโ the Domain ID used to scope the retrieved users.
Returns โ a list of identity User objects. โจ
Raises SDKException if literally anything goes sideways during the OpenStack API call. ๐ญ
๐พ list_volume_backups(detailed=True, filters=None)
List out all the volume backups, bestie.
Parameters
detailedโ whether or not you want the detailed extra info added on. More is more, honestly.filtersโ a dictionary of meta data for further filtering. Example:
{
'name': 'my-volume-backup',
'status': 'available',
'volume_id': 'e126044c-7b4c-43be-a32a-c9cbbc9ddb56',
'all_tenants': 1,
}
Returns โ a list of volume Backup objects. ๐
๐ธ list_volume_snapshots(detailed=True, filters=None)
Same energy, but for all the volume snapshots.
Parameters
detailedโ whether or not to add detailed additional information.filtersโ a dictionary of meta data to use for further filtering. Example:
{
'name': 'my-volume-snapshot',
'volume_id': 'e126044c-7b4c-43be-a32a-c9cbbc9ddb56',
'all_tenants': 1,
}
Returns โ a list of volume Snapshot objects. ๐
๐๏ธ list_volume_types(get_extra=None)
List every volume type that's available.
Parameters
get_extraโ DEPRECATED. This parameter no longer does anything. It's giving legacy, it's giving decorational. ๐ซ
Returns โ a list of volume Type objects.
๐ฝ list_volumes(cache=None)
List all the available volumes, periodt.
Parameters
cacheโ DEPRECATED. This parameter no longer does anything either. Rip bozo, no cap. ๐
Returns โ a list of volume Volume objects.
๐ list_zones(filters=None)
List all the available zones.
Returns โ a list of zone dicts.
๐ฅ๏ธ node_set_provision_state(name_or_id, state, configdrive=None, wait=False, timeout=3600)
Set Node Provision State โ the main character method of baremetal setup, honestly.
It lets a user provision a Machine and, if they want, define a config drive to be utilized.
Parameters
name_or_id(string) โ the Name or UUID value representing the baremetal node.state(string) โ the desired provision state for the baremetal node.configdrive(string) โ an optional URL or file or path representing the configdrive. In the case of a directory, the client API will create a properly formatted configuration drive file and post the file contents to the API for deployment. She does the formatting for you, so slay. โจwait(boolean) โ a boolean value, defaulted tofalse, controlling whether the method waits for the desired end state to be reached before returning.timeout(integer) โ integer value, defaulting to3600seconds, representing the amount of time to wait for the desired end state to be reached. That's a whole hour of patience btw.
Returns โ the current state of the machine upon exit of the method.
Return type โ Node <#openstack.baremetal.v1.node.Node>
Raises SDKException on operation error. ๐ญ
โก patch_accelerator_request(uuid, patch)
Update an accelerator request.
Parameters
uuidโ the UUID of the accelerator request to be updated.patchโ the (patch) that will bind the accelerator.
Returns โ True if bind succeeded, False otherwise. Binary queen. ๐
๐ฉน patch_machine(name_or_id, patch)
Patch Machine Information โ this one gives you an interface to manipulate node entries within Ironic.
Parameters
name_or_id(string) โ a machine name or UUID to be updated.patchโ the JSON Patch document, which is a list of dictionary objects that comply with RFC 6902, found at <https://tools.ietf.org/html/rfc6902>.
Example patch construction:
patch = []
patch.append({'op': 'remove', 'path': '/instance_info'})
patch.append(
{'op': 'replace', 'path': '/name', 'value': 'newname'}
)
patch.append(
{
'op': 'add',
'path': '/driver_info/username',
'value': 'administrator',
}
)
Returns โ the current state of the node.
Return type โ Node <#openstack.baremetal.v1.node.Node>
Raises SDKException on operation error. ๐ฆ
๐ pformat(resource)
A wrapper around pformat that groks munch objects. Short, sweet, iconic.
๐ pprint(resource)
A wrapper around pprint that groks munch objects. Same vibes, prettier printing. โจ
๐งน project_cleanup(dry_run=True, wait_timeout=120, status_queue=None, filters=None, resource_evaluation_fn=None, skip_resources=None)
Cleanup the project resources. Basically the spring cleaning of all spring cleanings.
It cleans up all resources in all services, which provide cleanup methods.
Parameters
dry_runโ cleanup, or only list the identified resources. (Spoiler: dry run just lists. Very "looking respectfully" of it. ๐)wait_timeoutโ maximum amount of time given to each service to complete the cleanup.status_queueโ a threading queue object used to get current process status. The queue contains processed resources.filtersโ additional filters for the cleanup (only resources matching all filters will be deleted, if there are no other dependencies).resource_evaluation_fnโ a callback function which will be invoked for each resource and must returnTrue/Falsedepending on whether the resource needs to be deleted or not.skip_resourcesโ list of specific resources whose cleanup should be skipped. Leave my faves alone pls. ๐
๐ข range_search(data, filters)
Perform integer range searches across a list of dictionaries. Ngl this one's kind of a flex.
Given a list of dictionaries, it searches across the list using the given dictionary keys and a range of integer values for each key. Only dictionaries that match ALL search filters across the entire original data set will be returned.
It is not a requirement that each dictionary contain the key used for searching. Those without the key will be considered non-matching.
The range values must be string values, and each is either a set of digits representing an integer for matching, or a range operator followed by a set of digits representing an integer for matching. If a range operator is not given, exact value matching will be used. Valid operators are one of: <,>,<=,>=
Parameters
dataโ list of dictionaries to be searched.filtersโ dict describing the one or more range searches to perform. If more than one search is given, the result will be the members of the original data set that match ALL searches. An example of filtering by multiple ranges:
{"vcpus": "<=5", "ram": "<=2048", "disk": "1"}
Returns โ a list subset of the original data set.
Raises SDKException on invalid range expressions. ๐จ
๐จ rebuild_server(server_id, image_id, admin_pass=None, detailed=False, bare=False, wait=False, timeout=180)
Rebuild a server. Fresh start, new you, etc.
Parameters
server_idimage_idadmin_passdetailedbarewaittimeout
Returns โ a compute Server object.
๐๏ธ register_machine(nics, wait=False, timeout=3600, lock_timeout=600, provision_state='available', **kwargs)
Register Baremetal with Ironic โ okay this one ate, fr fr.
It allows for the registration of Baremetal nodes with Ironic and population of pertinent node information or configuration to be passed to the Ironic API for the node.
This method also creates ports for a list of MAC addresses passed in, to be utilized for boot and potentially network configuration. Ports! Plural! ๐ซถ
If a failure is detected creating the network ports, any ports created are deleted, and the node is removed from Ironic. It cleans up after itself, we love a self-aware icon. โจ
Parameters
nicsโ- An array of ports that represent the network interfaces for the node we're creating โ and the timing matters, bestie: these ports get created after the node is enrolled but before it heads off into cleaning ๐งผ
Example:
[
{'address': 'aa:bb:cc:dd:ee:01'},
{'address': 'aa:bb:cc:dd:ee:02'},
]
Alternatively you can just pass an array of MAC addresses. Lowkey easier, tbh ๐
waitโ Boolean value, defaults tofalse, and it makes the method wait for the node to reach the available state, y'know, the state where the node can actually be provisioned. But important caveat, so listen up ๐: when it's set tofalse, the method will still wait for locks to clear before it sends the next required command. So there's no fully skipping the lock wait, ever, periodt.timeoutโ Integer value, defaults to3600seconds, for the wait state to reach completion. Give it an hour, she'll get there โจlock_timeoutโ Integer value, defaults to600seconds, for locks to clear.provision_stateโ the expected provision state, one of"enroll","manageable"or"available". Heads up: using"available"results in automated cleaning ๐งฝkwargsโ key value pairs that get passed along to the Ironic API, includinguuid,name,chassis_uuid,driver_info,properties.
Returns
Current state of the node.
Return type
Node <#openstack.baremetal.v1.node.Node>.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
remove_flavor_access(flavor_id, project_id)
Revoke access from a private flavor for a project/tenant. Bye-bye access ๐
Parameters
flavor_id(string) โ ID of the private flavor.project_id(string) โ ID of the project/tenant.
Returns
None
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
remove_host_from_aggregate(name_or_id, host_name)
Remove a host from an aggregate. Just yeet it out of the group ๐ซถ
Parameters
name_or_idโ name or ID of the host aggregate.host_nameโ host to remove.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
remove_machine_from_maintenance(name_or_id)
Remove Baremetal Machine from Maintenance State ๐ง
Very much the mirror twin of set_machine_maintenance_state โ this method removes a machine from maintenance state. And ngl, the way it works is charmingly lazy: it simply calls set_machine_maintenace_state for the name_or_id you requested and sets the state to False. That's it, that's the whole trick ๐
Parameters
name_or_id(string) โ the Name or UUID value representing the baremetal node.
Returns
None
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
remove_router_interface(router, subnet_id=None, port_id=None)
Detach a subnet from an internal router interface โ๏ธ
At least one of subnet_id or port_id must be supplied. Non-negotiable, bestie.
And if you specify both subnet and port ID, the subnet ID must correspond to the subnet ID of the first IP address on the port specified by the port ID. Otherwise an error occurs. Like, an actual error ๐ญ
Parameters
router(dict) โ the dict object of the router being changed.subnet_id(string) โ the ID of the subnet to use for the interface.port_id(string) โ the ID of the port to use for the interface.
Returns
None on success.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
remove_rule_from_policy(name_or_id, rule_name_or_id, filters=None)
Remove a firewall rule from a firewall policy's firewall_rules list. And the icon move here: it short-circuits and returns the firewall policy early if the firewall rule is already absent from the firewall_rules list. Efficient queen ๐
Parameters
name_or_idโ firewall policy name or id.rule_name_or_idโ firewall rule name or id.filters(dict) โ optional filters.
Raises
DuplicateResource on multiple matches.
Raises
NotFoundException if firewall policy is not found.
Returns
Updated firewall policy.
Return type
FirewallPolicy
remove_server_security_groups(server, security_groups)
Remove security groups from a server ๐ก๏ธ
Remove existing security groups from an existing server. And the chill part: if the security groups aren't even present on the server, this will continue unaffected. No drama, no crash ๐
Parameters
serverโ the server to remove security groups from.security_groupsโ a list of security groups to remove.
Returns
False if server or security groups are undefined, True otherwise.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
remove_user_from_group(name_or_id, group_name_or_id)
Remove a user from a group. Sorry bestie, you're out of the group chat ๐ช
Parameters
name_or_idโ name or unique ID of the user.group_name_or_idโ group name or ID.
Raises
SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
remove_volume_type_access(name_or_id, project_id)
Revoke access on a volume_type to a project. Access: revoked. Vibe: immaculate โจ
Parameters
name_or_idโ ID or name of avolume_type.project_idโ a project id.
Returns
None
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
revoke_role(name_or_id, user=None, group=None, project=None, domain=None, system=None, inherited=False, wait=False, timeout=60)
Revoke a role from a user. Taking the crown back ๐
Parameters
name_or_id(string) โ name or unique ID of the role.user(string) โ the name or id of the user.group(string) โ the name or id of the group. (v3)project(string) โ the name or id of the project.domain(string) โ the id of the domain. (v3)system(bool) โ the name of the system. (v3)inherited(bool) โ whether the role assignment is inherited.wait(bool) โ wait for role to be revoked.timeout(int) โ
Timeout to wait for role to be revoked.
NOTE: forwaitandtimeout, sometimes revoking roles is not instantaneous. Patience, gorgeous ๐ซถ
NOTE: project is required for keystone v2.
NOTE: precedence is given first toproject, thendomain, thensystem.
Returns
True if the role is revoked, otherwise False.
Raises
SDKException <#openstack.exceptions.SDKException> if the role cannot be removed.
search_aggregates(name_or_id=None, filters=None)
Search host aggregates ๐ (the original page says "Seach", and honestly? she's searching for her keys, we love her anyway ๐)
Parameters
nameโ aggregate name or id.filters(dict) โ
A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{
'availability_zone': 'nova',
'metadata': {'cpu_allocation_ratio': '1.0'},
}
Returns
A list of compute Aggregate objects matching the search criteria.
Raises
SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
search_cluster_templates(name_or_id=None, filters=None, detail=False)
Search cluster templates ๐ธ
Parameters
name_or_idโ cluster template name or ID.filtersโ a dict containing additional filters to use.detailโ a boolean to control if we need summarized or detailed output.
Returns
A list of dict containing the cluster templates.
Raises
SDKException <#openstack.exceptions.SDKException>: if something goes wrong during the OpenStack API call.
search_coe_clusters(name_or_id=None, filters=None)
Search COE cluster ๐ (container orchestration energy, iykyk)
Parameters
name_or_idโ cluster name or ID.filtersโ a dict containing additional filters to use.detailโ a boolean to control if we need summarized or detailed output.
Returns
A list of container infrastructure management Cluster objects.
Raises SDKException (that's openstack.exceptions.SDKException, bestie) โ only if something goes totally sideways during the OpenStack API call. ๐ญ
search_containers(name=None, filters=None)
Search containers. Your lil treasure hunt through the object store ๐
search_containers(name=None, filters=None)
Parameters
- name (
string) โ Container name. - filters โ A
dictcontaining additional filters to use. OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ A list of object store Container objects matching the search criteria.
Raises SDKException: if something goes wrong during the OpenStack API call.
search_domains(filters=None, name_or_id=None)
Search Keystone domains. ๐
search_domains(filters=None, name_or_id=None)
Parameters
- name_or_id โ Name or ID of the domain(s).
- filters โ dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of identity Domain objects.
Raises SDKException if something goes wrong during the OpenStack API call.
search_endpoint_groups(name_or_id=None, filters=None)
Search Keystone endpoint groups. Grouping endpoints together = iconic behaviour, no cap โจ
search_endpoint_groups(name_or_id=None, filters=None)
Parameters
- name_or_id โ Name or ID of the endpoint group(s).
- filters โ dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ A list of identity EndpointGroup objects.
Raises SDKException if something goes wrong during the OpenStack API call.
search_endpoints(id=None, filters=None)
List Keystone endpoints. Slightly different flavour from the others โ this one takes an id, not a name_or_id. Read the signature, babe ๐ซถ
search_endpoints(id=None, filters=None)
Parameters
- id โ ID of endpoint(s).
- filters โ dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ A list of identity Endpoint objects.
Raises SDKException if something goes wrong during the OpenStack API call.
search_flavors(name_or_id=None, filters=None, get_extra=True)
Search flavors. Get you a flavor that fits ๐
search_flavors(name_or_id=None, filters=None, get_extra=True)
Parameters
- name_or_id โ Name or unique ID of the flavor(s).
- filters โ (yep, that's the whole description, she's mysterious like that ๐)
- get_extra โ Whether to fetch extra specs.
Returns โ A list of compute Flavor objects matching the search criteria.
Heads up: no Raises listed for this one โ don't go inventing one. ๐
search_groups(name_or_id=None, filters=None, domain_id=None)
Search Keystone groups. Besties of the identity world ๐ธ
search_groups(name_or_id=None, filters=None, domain_id=None)
Parameters
- name_or_id โ Name or ID of the group(s).
- filters โ dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
- domain_id โ Domain ID to scope the searched groups.
Returns โ A list of identity Group objects.
Raises SDKException if something goes wrong during the OpenStack API call.
search_keypairs(name_or_id=None, filters=None)
Search keypairs. ๐ Lowkey the most useful search ever.
search_keypairs(name_or_id=None, filters=None)
Parameters
- name_or_id โ Name or unique ID of the keypair(s).
- filters โ A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Invalid filters will be ignored. (noted. behaviour check: they get dropped, not errored ๐ซก)
Returns โ A list of compute Keypair objects matching the search criteria.
Raises SDKException if something goes wrong during the OpenStack API call.
search_networks(name_or_id=None, filters=None)
Search networks. Networking era ๐ฆ
search_networks(name_or_id=None, filters=None)
Parameters
- name_or_id โ Name or ID of the desired network.
- filters โ A
dictcontaining additional filters to use, e.g.{'router:external': True}
Returns โ A list of network Network objects matching the search criteria.
Raises SDKException if something goes wrong during the OpenStack API call.
search_objects(container, name=None, filters=None)
Search objects. Note the required container first โ objects live inside containers, she's not optional โจ
search_objects(container, name=None, filters=None)
Parameters
- name (
string) โ Object name. - filters โ A
dictcontaining additional filters to use. OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ A list of object store Object objects matching the search criteria.
Raises SDKException: if something goes wrong during the OpenStack API call.
search_ports(name_or_id=None, filters=None)
Search ports. The little connectors that carry everything ๐
search_ports(name_or_id=None, filters=None)
Parameters
- name_or_id โ Name or ID of the desired port.
- filters โ A
dictcontaining additional filters to use, e.g.{'device_id': '2711c67a-b4a7-43dd-ace7-6187b791c3f0'}(yes, that UUID is exactly correct, don't retype it, copy it ๐ญ)
Returns โ A list of network Port objects matching the search criteria.
Raises SDKException if something goes wrong during the OpenStack API call.
search_projects(name_or_id=None, filters=None, domain_id=None)
Backwards compatibility method for search_projects. ๐ซถ
Okay so the lore: search_projects originally had a parameter list that was name_or_id, filters, and list had domain_id first. This method exists in this form to allow code written with positional parameters to still work. But really โ use keyword arguments. Fr fr, use keyword arguments.
search_projects(name_or_id=None, filters=None, domain_id=None)
Parameters
- name_or_id โ Name or ID of the project(s).
- filters โ dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
- domain_id โ Domain ID to scope the searched projects.
Returns โ A list of identity Project objects.
No Raises block on this one in the source โ so I'm not adding one. Periodt. ๐
search_qos_bandwidth_limit_rules(policy_name_or_id, rule_id=None, filters=None)
Search QoS bandwidth limit rules. Bandwidth, but make it governed ๐ฅ
search_qos_bandwidth_limit_rules(policy_name_or_id, rule_id=None,
filters=None)
Parameters
- policy_name_or_id (
string) โ Name or ID of the QoS policy to which rules should be associated. - rule_id (
string) โ ID of searched rule. - filters โ a
dictcontaining additional filters to use, e.g.{'max_kbps': 1000}
Returns โ A list of network QoSBandwidthLimitRule objects matching the search criteria.
Raises SDKException if something goes wrong during the OpenStack API call.
search_qos_dscp_marking_rules(policy_name_or_id, rule_id=None, filters=None)
Search QoS DSCP marking rules
policy_name_or_id(string) โ the name or the ID of the QoS policy these rules are supposed to be attached to ๐ซถrule_id(string) โ the ID of the rule we're hunting forfiltersโ a dict of extra filters to narrow stuff down, like{'dscp_mark': 32}
Returns โ a list of network QoSDSCPMarkingRule objects that match what you asked for โจ
Raises SDKException <#openstack.exceptions.SDKException> if anything goes sideways during the OpenStack API call ๐ญ
search_qos_minimum_bandwidth_rules(policy_name_or_id, rule_id=None, filters=None)
Search QoS minimum bandwidth rules, lowkey the bandwidth bouncers of the network ๐
Parameters
policy_name_or_id(string) โ name or ID of the QoS policy the rules belong torule_id(string) โ ID of the rule you're searching forfiltersโ a dict of extra filters, e.g.{'min_kbps': 1000}
Returns โ a list of network QoSMinimumBandwidthRule objects matching the search criteria ๐ธ
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_qos_policies(name_or_id=None, filters=None)
Search QoS policies, the main character energy of network traffic shaping ๐
Parameters
name_or_idโ name or ID of the policy you wantfiltersโ a dict of extra filters, e.g.{'shared': True}
Returns โ a list of network QosPolicy objects matching the search criteria โจ
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_resources(resource_type, name_or_id, get_args=None, get_kwargs=None, list_args=None, list_kwargs=None, **filters)
Search resources โ like, search resources that match certain conditions, bestie ๐
Parameters
resource_typeโ a string version of the resource you expect, written as service.resource (so like"network.security_group")name_or_idโ name or ID of the resourceget_argsโ optional args passed along to the_getcallget_kwargsโ optional kwargs passed along to the_getcalllist_argsโ optional args passed along to the_listcalllist_kwargsโ optional kwargs passed along to the_listcallfiltersโ extra filters used when querying resources
search_roles(name_or_id=None, filters=None, domain_id=None)
Search Keystone roles ๐
Parameters
nameโ name or ID of the role(s)filtersโ
a dictionary of meta data for further filtering. The elements of this dictionary may themselves be dictionaries too. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
a string holding a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
domain_idโ domain ID used to scope the searched roles
Returns โ a list of identity Role objects ๐
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_routers(name_or_id=None, filters=None)
Search routers ๐
Parameters
name_or_idโ name or ID of the router you wantfiltersโ a dict of extra filters, e.g.{'admin_state_up': True}
Returns โ a list of network Router objects matching the search criteria
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_server_groups(name_or_id=None, filters=None)
Search server groups, we love a squad ๐ซถ
Parameters
name_or_idโ name or unique ID of the server group(s)filtersโ
a dictionary of meta data for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
a string containing a jmespath expression for further filtering. Invalid filters get ignored, no cap ๐
Returns โ a list of compute ServerGroup objects matching the search criteria โจ
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_servers(name_or_id=None, filters=None, detailed=False, all_projects=False, bare=False)
Search servers โ the whole server roster ๐ฅ
Parameters
name_or_idโ name or unique ID of the server(s)filtersโ
a dictionary of meta data for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
a string containing a jmespath expression for further filtering. Invalid filters will be ignored ๐
detailedall_projectsbare
Returns โ a list of compute Server objects matching the search criteria โญ
search_services(name_or_id=None, filters=None)
Search Keystone services ๐ธ
Parameters
name_or_idโ name or ID of the service(s)filtersโ
a dictionary of meta data for further filtering. The elements of this dictionary may themselves be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of identity Service objects ๐
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_stacks(name_or_id=None, filters=None)
Search stacks, orchestration girlies rise ๐ง
Parameters
name_or_idโ name or ID of the stack you wantfiltersโ a dict of extra filters, e.g.{'stack_status': 'CREATE_COMPLETE'}
Returns โ a list of openstack.orchestration.v1.stack.Stack containing the stack description
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_subnets(name_or_id=None, filters=None)
Search subnets ๐
Parameters
name_or_idโ name or ID of the subnet you wantfiltersโ a dict of extra filters, e.g.{'enable_dhcp': True}
Returns โ a list of network Subnet objects matching the search criteria
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_users(name_or_id=None, filters=None, domain_id=None)
Search users, the people of the cloud ๐
Parameters
name_or_idโ name or ID of the user(s)domain_idโ domain ID used to scope the retrieved usersfiltersโ
a dictionary of meta data for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
a string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of identity User objects ๐
Raises SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call
search_volume_backups(name_or_id=None, filters=None)
Search for one or more volume backups, so you never lose the precious data ๐
Parameters
name_or_idโ name or unique ID of the volume backup(s)filtersโfiltersโ DEPRECATED bestie it's a whole dictionary of meta data you can use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of volume Backup objects, if any are found. ๐ซถ
search_volume_snapshots(name_or_id=None, filters=None) ๐ซ
Search for one or more volume snapshots. Iconic little lookup, no notes.
Parameters
name_or_idโ name or unique ID of the volume snapshot(s).filtersโ DEPRECATED a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of volume Snapshot objects, if any are found. โจ
search_volume_types(name_or_id=None, filters=None, get_extra=None) ๐ง
Search for one or more volume types.
Parameters
name_or_idโ name or unique ID of the volume type(s).filtersโ DEPRECATED a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of volume Type objects, if any are found.
Yes, get_extra=None is in the signature, and nope, the page doesn't say anything else about it. That's the whole vibe check. ๐
search_volumes(name_or_id=None, filters=None) ๐
Search for one or more volumes. The classic.
Parameters
name_or_idโ name or unique ID of the volume(s).filtersโ DEPRECATED a dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR
A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
Returns โ a list of volume Volume objects, if any are found. ๐
set_aggregate_metadata(name_or_id, metadata) ๐๏ธ
Set aggregate metadata, replacing the existing metadata. Not merging โ replacing, so read that twice before you run it, fr fr.
Parameters
name_or_idโ name of the host aggregate to update.metadataโ dict containing metadata to replace. Pro tip straight from the page: use{'key': None}to remove a key.
Returns โ a dict representing the new host aggregate.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
set_compute_quotas(name_or_id, **kwargs) ๐
Set a quota in a project.
Parameters
name_or_idโ project name or id.kwargsโ key/value pairs of quota name and quota value.
Raises SDKException <#openstack.exceptions.SDKException> if the resource to set the quota does not exist.
set_container_access(name, access, refresh=False) ๐
Set the access control list on a container.
Parameters
name(str) โ name of the container.access(str) โ ACL string to set on the container. Can also bepublicorprivate, which will be translated into appropriate ACL strings. Slay.refreshโ flag to trigger refresh of the container properties.
set_flavor_specs(flavor_id, extra_specs) ๐ฆ
Add extra specs to a flavor.
Parameters
flavor_id(string) โ ID of the flavor to update.extra_specs(dict) โ dictionary of key-value pairs.
Returns โ None.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
Raises BadRequestException <#openstack.exceptions.BadRequestException> if flavor ID is not found.
set_machine_maintenance_state(name_or_id, state=True, reason=None) ๐ ๏ธ
Set Baremetal Machine Maintenance State.
Sets the Baremetal maintenance state and the maintenance reason. Two-for-one.
Parameters
name_or_id(string) โ the Name or UUID value representing the baremetal node.state(boolean) โ the desired state of the node.Truebeing in maintenance, whereasFalsemeans the machine is not in maintenance mode. This value defaults toTrueif not explicitly set.reason(string) โ an optional freeform string that is supplied to the baremetal API to allow for notation as to why the node is in maintenance state. Receipts, basically. ๐งพ
Returns โ None.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
set_machine_power_off(name_or_id) ๐
De-activate baremetal machine power.
This is a method that sets the node power state to "off". That's it, that's the whole thing.
Parameters
name_or_idโ a string representing the baremetal node to have power turned to an"off"state.
Returns โ None.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
set_machine_power_on(name_or_id) โก
Activate baremetal machine power.
This is a method that sets the node power state to "on". The comeback era.
Parameters
name_or_idโ a string representing the baremetal node to have power turned to an"on"state.
Returns โ None.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
set_machine_power_reboot(name_or_id) ๐
De-activate baremetal machine power.
(Yes, that's the summary line the page gives it. Not me, I'm just the messenger. ๐)
This is a method that sets the node power state to "reboot", which in essence changes the machine power state to "off", and then back to "on". Glow-down, glow-up, immediately.
Parameters
name_or_idโ a string representing the baremetal node to have power turned to an"off"state.
Returns โ None.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
set_network_quotas(name_or_id, **kwargs) ๐
Set a network quota in a project.
Parameters
name_or_idโ project name or id.kwargsโ key/value pairs of quota name and quota value.
Raises SDKException <#openstack.exceptions.SDKException> if the resource to set the quota does not exist.
set_server_metadata(name_or_id, metadata) ๐ฅ๏ธ
Set metadata in a server instance.
Parameters
name_or_id(str) โ the name or ID of the server instance to update.metadata(dict) โ a dictionary with the key=value pairs to set in the server instance. It only updates the key=value pairs provided. Existing ones will remain untouched. Non-destructive, we love to see it. ๐ซถ
Returns โ None.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
set_volume_bootable(name_or_id, bootable=True) ๐ข
Set a volume's bootable flag.
Parameters
name_or_idโ name or unique ID of the volume.bootable(bool) โ whether the volume should be bootable. (Defaults toTrue.)
Returns โ None.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if wait time exceeded.
Raises SDKException <#openstack.exceptions.SDKException> on operation error.
set_volume_quotas(name_or_id, **kwargs) ๐พ
Set a volume quota in a project.
Parameters
name_or_idโ project name or id.kwargsโ key/value pairs of quota name and quota value.
Returns โ None.
Raises SDKException <#openstack.exceptions.SDKException> if the resource to set the quota does not exist.
sign_coe_cluster_certificate(cluster_id, csr) ๐
Sign client key and generate the CA certificate for a cluster. Very main character certificate behaviour, ngl.
Parameters
cluster_idโ UUID of the cluster.csrโ Certificate Signing Request (CSR) for authenticating client key. The CSR will be used by Magnum to generate a signed certificate that client will use to communicate with the cluster.
Returns โ a dict representing the signed certs.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
๐ฆ stream_object(container, obj, query_string=None, resp_chunk_size=1024)
Download the content via a streaming iterator. Very demure, very streamy.
Parameters
container(string) โ Name of the container.obj(string) โ Name of the object.query_string(string) โ Query args for uri. (delimiter, prefix, etc.)resp_chunk_size(int) โ Chunk size of data to read. Only used if the results are
Returns โ An iterator over the content or None if the object is not found.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
๐ง unbind_accelerator_request(uuid, properties)
Unbind an accelerator from VM.
A deprecated alias for patch_accelerator_request. It's giving legacy, bestie โ still here, still working.
๐ unregister_machine(nics, uuid, wait=None, timeout=600)
Unregister Baremetal from Ironic. Removes entries for Network Interfaces and baremetal nodes from an Ironic API.
Parameters
nicsโ An array of strings that consist of MAC addresses to be removed.uuid(string) โ The UUID of the node to be deleted.waitโ DEPRECATED, do not use.timeoutโ Integer value, representing seconds with a default value of600, which controls the maximum amount of time to block until a lock is released on machine.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation failure.
๐ธ unset_flavor_specs(flavor_id, keys)
Delete extra specs from a flavor. Marie Kondo energy fr fr.
Parameters
flavor_id(string) โ ID of the flavor to update.keysโ List of spec keys to delete.
Returns โ None
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
Raises โ BadRequestException <#openstack.exceptions.BadRequestException> if flavor ID is not found.
โจ update_aggregate(name_or_id, **kwargs)
Update a host aggregate.
Parameters
name_or_idโ Name or ID of the aggregate being updated.nameโ New aggregate nameavailability_zoneโ Availability zone to assign to hosts
Returns โ The updated compute Aggregate object.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
๐ update_cluster_template(name_or_id, **kwargs)
Update a cluster template.
Parameters
name_or_idโ Name or ID of the cluster template being updated.
Returns โ an update cluster template.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
๐ update_coe_cluster(name_or_id, **kwargs)
Update a COE cluster.
Parameters
name_or_idโ Name or ID of the COE cluster being updated.kwargsโ Cluster attributes to be updated.
Returns โ The updated cluster Cluster object.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
๐ update_container(name, headers)
Update the metadata in a container.
Parameters
name(str) โ Name of the container to update.headers(dict) โ Key/Value headers to set on the container.
๐ update_domain(domain_id=None, name=None, description=None, enabled=None, name_or_id=None)
Update a Keystone domain.
Parameters
domain_idnamedescriptionenabledname_or_idโ Name or unique ID of the domain.
Returns โ The updated identity Domain object.
Raises โ SDKException <#openstack.exceptions.SDKException> if the domain cannot be updated
๐
update_firewall_group(name_or_id, filters=None, **kwargs)
Updates firewall group. To unset egress- or ingress firewall policy, set egress_firewall_policy or ingress_firewall_policy to None. You can also set egress_firewall_policy_id and ingress_firewall_policy_id directly, which will skip the policy lookups.
Parameters
name_or_idโ firewall group name or idfilters(dict) โ optional filterskwargsโ firewall group update parameters Seecreate_firewall_groupdocstring for valid parameters.
Returns โ The updated network FirewallGroup object.
Raises โ BadRequestException if parameters are malformed
Raises โ DuplicateResource on multiple matches
Raises โ NotFoundException if firewall group, a firewall policy (egress, ingress) or port is not found
๐ฅ update_firewall_policy(name_or_id, filters=None, **kwargs)
Updates firewall policy.
Parameters
name_or_idโ firewall policy name or idfiltersโ
A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
kwargsโ firewall policy update parameters Seecreate_firewall_policydocstring for valid parameters.
Returns โ The updated network FirewallPolicy object.
Raises โ BadRequestException if parameters are malformed
Raises โ DuplicateResource on multiple matches
Raises โ NotFoundException if resource is not found
๐ฆ update_firewall_rule(name_or_id, filters=None, **kwargs)
Updates firewall rule.
Parameters
name_or_idโ firewall rule name or idfiltersโ
A dictionary of meta data to use for further filtering. Elements of this dictionary may, themselves, be dictionaries. Example:
{'last_name': 'Smith', 'other': {'gender': 'Female'}}
OR A string containing a jmespath expression for further filtering. Example:
"[?last_name==`Smith`] | [?other.gender]==`Female`]"
kwargsโ firewall rule update parameters. Seecreate_firewall_ruledocstring for valid parameters.
Returns โ The updated network FirewallRule object.
Raises โ BadRequestException if parameters are malformed
Raises โ NotFoundException if resource is not found
๐ update_group(name_or_id, name=None, description=None, **kwargs)
Update an existing group.
Parameters
name_or_idโ Name or unique ID of the group.nameโ New group name.descriptionโ New group description.
Returns โ The updated identity Group object.
Raises โ SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API call.
โญ update_machine(name_or_id, **attrs)
Update a machine with new configuration information. A user-friendly method to perform updates of a machine, in whole or part.
Parameters
name_or_id(string) โ A machine name or UUID to be updated.attrsโ Attributes to updated on the machine.
Returns โ A dictionary containing a machine sub-dictionary consisting of the updated data returned from the API update operation, and a list named changes which contains all of the API paths that received updates.
Raises โ SDKException <#openstack.exceptions.SDKException> on operation error.
๐ธ update_network(name_or_id, **kwargs)
Update a network.
Parameters
name_or_id(string) โ Name or ID of the network being updated.name(string) โ New name of the network.shared(bool) โ Set the network as shared.admin_state_up(bool) โ Set the network administrative state to up.external(bool) โ is this network externally accessible? yes or no, bestie.provider(dict) โ a dict of network provider options. Example:
{'network_type': 'vlan', 'segmentation_id': 'vlan1'}
mtu_size(int) โ new maximum transmission unit value, here to address fragmentation. Minimum value is68for IPv4, and1280for IPv6. ๐ซถport_security_enabled(bool) โ enable or disable port security.dns_domain(string) โ specify the DNS domain associated with this network.
Returns: the updated network Network object. โจ
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
๐ update_object(container, name, metadata=None, **headers)
Update the metadata of an object.
Parameters:
containerโ the name of the container the object is in.nameโ name for the object within the container.metadataโ this dict will get changed into headers that set metadata of the object.headersโ these will be passed through to the object update API as HTTP Headers.
Returns: None.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
๐ฆ update_port(name_or_id, **kwargs)
Update a port.
Note: to unset an attribute use None value. To leave an attribute untouched just omit it. no cap, that's the whole trick ๐
Parameters:
name_or_idโ name or ID of the port to update. (Required)nameโ a symbolic name for the port. (Optional)admin_state_upโ the administrative status of the port, which is up (true) or down (false). (Optional)fixed_ipsโ
list of ip_addresses and subnet_ids. (Optional) If you specify only a subnet ID, OpenStack Networking allocates an available IP from that subnet to the port. If you specify both a subnet ID and an IP address, OpenStack Networking tries to allocate the specified address to the port. For example:
[
{
"ip_address": "10.29.29.13",
"subnet_id": "a78484c4-c380-4b47-85aa-21c51a2d8cbd",
},
...,
]
security_groupsโ list of security group UUIDs. (Optional)allowed_address_pairsโ
allowed address pairs list. (Optional) For example:
[
{
"ip_address": "23.23.23.1",
"mac_address": "fa:16:3e:c4:cd:3f",
},
...,
]
extra_dhcp_optsโ
extra DHCP options. (Optional). For example:
[{"opt_name": "opt name1", "opt_value": "value1"}, ...]
device_ownerโ the ID of the entity that uses this port. For example, a DHCP agent. (Optional)device_idโ the ID of the resource this port is attached to.vnic_type(binding) โ the type of the created port. (Optional)port_security_enabledโ the security port state created on the network. (Optional)qos_policy_idโ the ID of the QoS policy to apply for port.
Returns: the updated network Port object.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
๐ธ update_project(name_or_id, enabled=None, domain_id=None, **kwargs)
Update a project.
Parameters:
name_or_idโ name or unique ID of the project.enabledโ whether the project is enabled or not.domain_idโ domain ID to scope the retrieved project.
Returns: an identity Project object.
๐ update_qos_bandwidth_limit_rule(policy_name_or_id, rule_id, **kwargs)
Update a QoS bandwidth limit rule.
Parameters:
policy_name_or_id(string) โ name or ID of the QoS policy to which rule is associated.rule_id(string) โ ID of rule to update.max_kbps(int) โ maximum bandwidth limit value (in kilobits per second).max_burst_kbps(int) โ maximum burst value (in kilobits).direction(string) โ ingress or egress. The direction in which the traffic will be limited.
Returns: the updated network QoSBandwidthLimitRule object.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
๐ง update_qos_dscp_marking_rule(policy_name_or_id, rule_id, **kwargs)
Update a QoS DSCP marking rule.
Parameters:
policy_name_or_id(string) โ name or ID of the QoS policy to which rule is associated.rule_id(string) โ ID of rule to update.dscp_mark(int) โ DSCP mark value.
Returns: the updated network QoSDSCPMarkingRule object.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
โญ update_qos_minimum_bandwidth_rule(policy_name_or_id, rule_id, **kwargs)
Update a QoS minimum bandwidth rule.
Parameters:
policy_name_or_id(string) โ name or ID of the QoS policy to which rule is associated.rule_id(string) โ ID of rule to update.min_kbps(int) โ minimum bandwidth value (in kilobits per second).direction(string) โ ingress or egress. The direction in which the traffic will be available.
Returns: the updated network QoSMinimumBandwidthRule object.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
๐ update_qos_policy(name_or_id, **kwargs)
Update an existing QoS policy.
Parameters:
name_or_id(string) โ name or ID of the QoS policy to update.policy_name(string) โ the new name of the QoS policy.description(string) โ the new description of the QoS policy.shared(bool) โ ifTrue, the QoS policy will be set as shared.default(bool) โ ifTrue, the QoS policy will be set as default for project.
Returns: the updated network QosPolicyRule object.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
๐ update_recordset(zone, name_or_id, **kwargs)
Update a recordset.
Parameters:
zoneโ name, ID oropenstack.dns.v2.zone.Zone <#openstack.dns.v2.zone.Zone>instance of the zone managing the recordset.name_or_idโ name or ID of the recordset being updated.recordsโ list of the recordset definitions.descriptionโ description of the recordset.ttlโ TTL (Time to live) value in seconds of the recordset.
Returns: a dict representing the updated recordset.
Raises: SDKException <#openstack.exceptions.SDKException> on operation error.
๐ update_role(name_or_id, name, **kwargs)
Update a Keystone role.
Parameters:
name_or_idโ name or unique ID of the role.name(string) โ the new role name.domain_idโ domain id.
Returns: an identity Role object.
Raises: SDKException <#openstack.exceptions.SDKException> if the role cannot be created.
๐ฅ update_router(name_or_id, name=None, admin_state_up=None, ext_gateway_net_id=None, enable_snat=None, ext_fixed_ips=None, routes=None)
Update an existing logical router.
Parameters:
name_or_id(string) โ the name or UUID of the router to update.name(string) โ the new router name.admin_state_up(bool) โ the administrative state of the router.ext_gateway_net_id(string) โ the network ID for the external gateway.enable_snat(bool) โ enable Source NAT (SNAT) attribute.ext_fixed_ipsโroutes(list) โ a list of dicts withdestinationandnexthopkeys. Wanna nuke all the routes? Pass an empty list ([]) and they're gone, periodt.
Example:
[{"destination": "179.24.1.0/24", "nexthop": "172.24.3.99"}]
Returns
The updated network Router object. ๐ฃ๏ธ
Raises
SDKException <#openstack.exceptions.SDKException> on operation error. ๐ญ
update_security_group(name_or_id, **kwargs)
Update a security group โ glow-up time for your firewall vibes โจ
Parameters
name_or_id(string) โ the name or ID of the security group you're updating.name(string) โ the new name for the security group.description(string) โ the new description for the security group.
Returns
A openstack.network.v2.security_group.SecurityGroup describing the updated security group. ๐
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
update_server(name_or_id, detailed=False, bare=False, **kwargs)
Update a server. lowkey the main character of compute calls ๐
Parameters
name_or_idโ name of the server to be updated.detailedโ whether or not to add detailed additional information. Defaults toFalse.bareโ whether to skip adding any additional info to the server record. Defaults toFalse, meaning the addresses dict will be populated as needed from neutron. Setting toTrueimpliesdetailed = False.nameโ new name for the server.descriptionโ new description for the server.
Returns
The updated compute Server object.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
update_stack(name_or_id, template_file=None, template_url=None, template_object=None, files=None, rollback=True, tags=None, wait=False, timeout=3600, environment_files=None, **parameters)
Update a stack. heat stack, but make it a remake ๐ฅ
Parameters
name_or_idโ name or ID of the stack to update.template_fileโ path to the template.template_urlโ URL of template.template_objectโ URL to retrieve template object.filesโ dict of additional file content to include.rollbackโ enable rollback on update failure.waitโ whether to wait for the delete to finish.timeoutโ stack update timeout in seconds.environment_filesโ paths to environment files to apply.
Other arguments will be passed as stack parameters which will take precedence over any parameters specified in the environments.
Only one oftemplate_file,template_url,template_objectshould be specified. Pick one, bestie, not all three ๐
Returns
a dict containing the stack description.
Raises
SDKException <#openstack.exceptions.SDKException> if something goes wrong during the OpenStack API calls.
update_subnet(name_or_id, subnet_name=None, enable_dhcp=None, gateway_ip=None, disable_gateway_ip=None, allocation_pools=None, dns_nameservers=None, host_routes=None)
Update an existing subnet. network glow-up, subnet edition ๐
Parameters
name_or_id(string) โ name or ID of the subnet to update.subnet_name(string) โ the new name of the subnet.enable_dhcp(bool) โ set toTrueif DHCP is enabled andFalseif disabled.gateway_ip(string) โ the gateway IP address. When you specify bothallocation_poolsandgateway_ip, you must ensure that the gateway IP does not overlap with the specified allocation pools. โ ๏ธdisable_gateway_ip(bool) โ set toTrueif gateway IP address is disabled andFalseif enabled. It is not allowed withgateway_ip. Default isFalse.allocation_poolsโ a list of dicts with the start and end addresses for the allocation pools. For example:
[{"start": "192.168.199.2", "end": "192.168.199.254"}]
dns_nameserversโ a list of DNS name servers for the subnet. For example:
["8.8.8.7", "8.8.8.8"]
host_routesโ a list of host route dicts for the subnet. For example:
[
{"destination": "0.0.0.0/0", "nexthop": "123.456.78.9"},
{"destination": "192.168.0.0/24", "nexthop": "192.168.0.1"},
]
Returns
The updated network Subnet object.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
update_volume(name_or_id, **kwargs)
Update a volume. storage but make it fresh ๐
Parameters
name_or_idโ name or unique ID of the volume.kwargsโ volume attributes to be updated.
Returns
The updated volume Volume object.
update_zone(name_or_id, **kwargs)
Update a zone. DNS but make it cute ๐
Parameters
name_or_idโ name or ID of the zone being updated.emailโ email of the zone owner (only applies ifzone_typeisprimary)descriptionโ description of the zonettlโ TTL (Time to live) value in secondsmastersโ master nameservers (only applies ifzone_typeissecondary)
Returns
a dict representing the updated zone.
Raises
SDKException <#openstack.exceptions.SDKException> on operation error.
validate_machine(name_or_id, for_deploy=True)
Validate parameters of the machine. vibe check, but for baremetal ๐ฅ๏ธ
Parameters
name_or_id(string) โ the Name or UUID value representing the baremetal node.for_deploy(bool) โ ifTrue, validate readiness for deployment, otherwise validate only the power management properties.
Raises
ValidationException <#openstack.exceptions.ValidationException>
volume_exists(name_or_id)
Check if a volume exists. simple as that, bestie ๐ซถ
Parameters
name_or_idโ name or unique ID of the volume.
Returns
True if the volume exists, else False.
wait_for_baremetal_node_lock(node, timeout=30)
Wait for a baremetal node to have no lock.
DEPRECATED, use wait_for_node_reservation on the baremetal proxy. bestie pls stop using this one ๐ญ
Raises
SDKException <#openstack.exceptions.SDKException> upon client failure.
Returns
None
wait_for_server(server, auto_ip=True, ips=None, ip_pool=None, reuse=True, timeout=180, nat_destination=None)
Wait for a server to reach ACTIVE status. the classic "is it up yet" but automated โณ
Once you have a Connection instance, services are accessed through instances of Proxy <#openstack.proxy.Proxy> or subclasses of it that exist as attributes on the Connection <#openstack.connection.Connection>.
๐ธ Service Proxies ๐ธ
The following service proxies exist on the Connection <#openstack.connection.Connection>. The service proxies are all always present on the Connection <#openstack.connection.Connection> object, but the combination of your CloudRegion and the catalog of the cloud in question control which services can be used. iykyk ๐ซ
๐ Accelerator API ๐
The Accelerator Class
The accelerator high-level interface is available through the accelerator member of a Connection <#openstack.connection.Connection> object. The accelerator member will only be added if the service is detected. not me checking the catalog before sliding in ๐
Deployable Operations
class openstack.accelerator.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
deployables(**query)
Retrieve a generator of deployables. it's giving "here's everything, one at a time" โจ
Parameters
queryโ optional query parameters to be sent to restrict the deployables to be returned.
Returns โ a generator of deployable instances, one per deployable, lazily handed to you like snacks passed down a row ๐
get_deployable(deployable, fields=None)
Grab exactly one deployable. Just the one. No sharing ๐
Parameters
deployableโ the value can be the ID of a deployable, or aDeployableinstance (fromopenstack.accelerator.v2.deployable.Deployable), and it'll play nice either way (iykyk, you can just hand it the object)
Returns โ one Deployable (openstack.accelerator.v2.deployable.Deployable)
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no deployable matching the criteria could be found ๐ญ like, it looked, it's not there
update_deployable(uuid, patch)
Reconfig the FPGA with new bitstream. hardware glow-up arc โจ
Parameters
uuidโ the value can be the UUID of a deployablepatchโ the information to reconfig
Returns โ the results of FPGA reconfig ๐
๐ฆ Device Operations ๐ฆ
class openstack.accelerator.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
okay that constructor signature is long long, but every single kwarg up there is real and named exactly like that, so don't come for me ๐
devices(**query)
Retrieve a generator of devices. all the devices, streamed to you โญ
Parameters
queryโ optional query parameters you send along to restrict which devices come back. Available parameters include:hostname: the hostname of the devicetype: the type of the devicevendor: the vendor ID of the devicesort: a list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier, which can beascordesclimit: requests a specified size of returned items from the query โ gives you a number of items up to the specified limit valuemarker: specifies the ID of the last-seen item. Use thelimitparameter to make an initial limited request, then use the ID of the last-seen item from the response as themarkerparameter value in a subsequent limited request
Returns โ a generator of device instances ๐
get_device(device, fields=None)
Get a single device. one (1) device. that's it. main character energy ๐
Parameters
deviceโ the value can be the ID of a device, or aDeviceinstance (fromopenstack.accelerator.v2.device.Device)
Returns โ one Device (openstack.accelerator.v2.device.Device)
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no device matching the criteria could be found ๐ gone, vanished, not in the vibes
๐ Device Profile Operations ๐
class openstack.accelerator.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
device_profiles(**query)
Retrieve a generator of device profiles. profiles, but for devices, keep up ๐ง
Parameters
queryโ optional query parameters to be sent to restrict the device profiles to be returned
Returns โ a generator of device profile instances โจ
create_device_profile(**attrs)
Create a device_profile. new profile just dropped ๐ฅ
Parameters
attrsโ a list ofdevice_profiles
Returns โ the list of created device profiles ๐
delete_device_profile(device_profile, ignore_missing=True)
Delete a device profile. bye bestie ๐
Parameters
device_profileโ the value can be either the ID of a device profile, or aDeviceProfileinstance (fromopenstack.accelerator.v2.device_profile.DeviceProfile)ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the device profile does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent device profile (default isTrue, so it's forgiving by default โ cute)
Returns โ the deleted device profile ๐
get_device_profile(device_profile, fields=None)
Get a single device profile. singular. one. โจ
Parameters
device_profileโ the value can be the ID of a device profile, or a~openstack.accelerator.v2.device_profile.DeviceProfileinstance
Returns โ one ~openstack.accelerator.v2.device_profile.DeviceProfile class instance
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no device profile matching the criteria could be found ๐ญ nothing matched, it's giving empty results
๐ Accelerator Request Operations ๐
class openstack.accelerator.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
accelerator_requests(**query)
Retrieve a generator of accelerator requests. the ARQ pipeline is flowing ๐ธ
Parameters
queryโ optional query parameters to be sent to restrict the accelerator requests to be returned
Returns โ a generator of accelerator request instances โญ
create_accelerator_request(**attrs)
Create an ARQs for a single device profile. yes, "ARQs", plural, that's literally what the docs say, no I will not be fixing it ๐
Parameters
attrsโ request body.
Returns โ the created accelerator request instance ๐
delete_accelerator_request(accelerator_request, ignore_missing=True)
Delete an accelerator request. yeeting it into the void ๐
Parameters
accelerator_requestโ the value can be either the ID of an accelerator request, or anAcceleratorRequestinstance (fromopenstack.accelerator.v2.accelerator_request.AcceleratorRequest)ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the accelerator request does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent accelerator request ๐
Returns โ None (nothing! empty! silence! that's the answer)
get_accelerator_request(accelerator_request, fields=None)
Get a single accelerator request. one lil request, hand-delivered ๐ซถ
Parameters
accelerator_requestโ the value can be the ID of an accelerator request, or a~openstack.accelerator.v2.accelerator_request.AcceleratorRequestinstance
Returns โ one ~openstack.accelerator.v2.accelerator_request.AcceleratorRequest class instance
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no accelerator request matching the criteria could be found ๐ญ
update_accelerator_request(uuid, properties)
Bind/Unbind an accelerator to VM. it's giving matchmaking, honestly ๐
Parameters
uuidโ the uuid of theaccelerator_requestto be bound/unboundpropertiesโ the info of VM that will bind/unbind the accelerator
Returns โ True if bind/unbind succeeded, False otherwise (it literally just tells you yes or no, no drama, no exception, just a boolean bestie) โ
๐ ATTRIBUTE OPERATIONS ๐
okay so first up, the proxy class โ and yes, it's the same chonky signature as everywhere else in this API, no cap:
class openstack.accelerator.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
attributes(**query)
Gives you a generator of attributes. ๐
Parameters:
queryโ optional query parameters you can send along to restrict which attributes come back.
Returns: a generator of attribute instances. slay.
create_attribute(**attrs)
Makes a attribute. โจ
Parameters:
attrsโ a list of attributes.
Returns: the list of created attributes.
delete_attribute(attribute, ignore_missing=True)
Deletes a attribute. ๐๏ธ
Parameters:
attributeโ the value can be either the ID of a attributes or aAttributesinstance.ignore_missingโ when set toFalse,ResourceNotFound <#openstack.exceptions.ResourceNotFound>gets raised when the device profile does not exist. When set toTrue, no exception gets set when you attempt to delete a nonexistent device profile.
Returns: the deleted attribute.
get_attribute(attribute, fields=None)
Gets one single device profile. ๐ฆ
Parameters:
attributeโ the value can be the ID of a attribute or a~openstack.accelerator.v2.attribute.Attributeinstance.
Returns: one ~openstack.accelerator.v2.attribute.Attribute
Raises ResourceNotFound <#openstack.exceptions.ResourceNotFound> when no device profile matching the criteria could be found. ๐ญ
๐ซถ HELPERS ๐ซถ
Same proxy class, same exact signature, we're just in the helper zone now:
class openstack.accelerator.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
wait_for_status(res, status, failures=None, interval=2, wait=None, attribute='status', callback=None)
Waits for the resource to hit a particular status. the way this one just sits there and vibes until things are ready โจ
Parameters:
sessionโ the session to use for making this request.resourceโ the resource to wait on to reach the status. The resource must have a status attribute specified viaattribute.statusโ the desired status of the resource.failuresโ statuses that would indicate the transition failed, such as'ERROR'. Defaults to['ERROR'].intervalโ number of seconds to wait between checks.waitโ maximum number of seconds to wait for the transition. Set toNoneto wait forever. ๐ญattributeโ name of the resource attribute that contains the status.callbackโ a callback function. This gets called with a single value,progress. This is API specific but is generally a percentage value from 0-100.
Returns: the updated resource.
RaisesResourceTimeout <#openstack.exceptions.ResourceTimeout>if the transition to status failed to occur inwaitseconds.
RaisesResourceFailure <#openstack.exceptions.ResourceFailure>if the resource transitioned to one of the states infailures.
Raises AttributeError if the resource does not have a status attribute. ๐
wait_for_delete(res, interval=2, wait=120, callback=None)
Waits for a resource to be deleted. bye bestie ๐
Parameters:
resโ the resource to wait on to be deleted.intervalโ number of seconds to wait before to consecutive checks.waitโ maximum number of seconds to wait before the change.callbackโ a callback function. This gets called with a single value,progress, which is a percentage value from 0-100.
Returns: the resource is returned on success.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if transition to delete failed to occur in the specified seconds.
๐ฅ BAREMETAL API ๐ฅ
For details on how to use baremetal, see Using OpenStack Baremetal <>. iykyk ๐ซถ
๐ THE BAREMETAL CLASS ๐
The baremetal high-level interface is available through the baremetal member of a Connection <#openstack.connection.Connection> object. The baremetal member only gets added if the service is detected. it's giving โจconditionalโจ, and we respect that.
๐ NODE OPERATIONS ๐
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
nodes(details=False, **query)
Gives you a generator of nodes. ๐
Parameters:
detailsโ a boolean indicating whether the detailed information for every node should be returned.queryโ optional query parameters to be sent to restrict the nodes returned. Available parameters include:associated: only return those which are, or are not, associated with aninstance_id.conductor_group: only return those in the specifiedconductor_group.driver: only return those with the specified driver.fault: only return those with the specified fault type.fields: a list containing one or more fields to be returned in the response. This may lead to some performance gain because other fields of the resource are not refreshed.instance_id: only return the node with this specific instance UUID or an empty set if not found.is_maintenance: only return those with maintenance set toTrueorFalse.limit: requests at most the specified number of nodes be returned from the query.marker: specifies the ID of the last-seen node. Use thelimitparameter to make an initial limited request and use the ID of the last-seen node from the response as themarkervalue in a subsequent limited request.provision_state: only return those nodes with the specifiedprovision_state.resource_class: only return those with the specifiedresource_class.shard: only return nodes matching the supplied shard key.sort_dir: sorts the response by the requested sort direction. A valid value isasc(ascending) ordesc(descending). Default isasc. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.sort_key: sorts the response by the this attribute value. Default isid. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.
Returns: a generator of Node <#openstack.baremetal.v1.node.Node> ๐ธ
create_node(**attrs)
Spinning up a brand-new node from attributes, bestie โจ
Peep create() for the tea on what the initial provision state actually is โ that part's not re-explained here.
Parameters
attrsโ keyword args that get used to create aNode.
Returns
The results of node creation. Yay, a node ๐
find_node(name_or_id, ignore_missing=True, *, details=True)
Find one single node. Just the one. Not a crowd ๐ซถ
Parameters
name_or_idโ the name or ID of a node.ignore_missingโ when this isFalse, aNotFoundExceptiongets raised if the node doesn't exist. When it'sTrue, you just getNoneback when you try to find a nonexistent node. Chill.detailsโ a boolean saying whether the detailed info for the node should come back or not.
Returns
One Node object or None.
get_node(node, fields=None)
Grab one specific node ๐
Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.fieldsโ limit the resource fields to fetch.
Returns
One Node.
Raises NotFoundException when no node matching the name or ID could be found ๐ญ
update_node(node, retry_on_conflict=True, **attrs)
Update a node, glow-up time โจ
Parameters
nodeโ the name or ID of a node, or aNodeinstance.retry_on_conflictโ whether to retry an HTTPCONFLICTerror. Most of the time it can be retried, since it's caused by the node being locked. But when settinginstance_id, this is a normal code and should not be retried. iykyk.attrsโ the attributes to update on the node represented by thenodeparameter.
Returns
The updated node.
patch_node(node, patch, reset_interfaces=None, retry_on_conflict=True)
Apply a JSON patch straight to the node ๐ง
Parameters
nodeโ the name or ID of a node, or aNodeinstance.patchโ JSON patch to apply.reset_interfacesโ whether to reset the node hardware interfaces to their defaults. This only works when you're changing drivers. Added in API microversion1.45.retry_on_conflictโ whether to retry an HTTPCONFLICTerror. Most of the time it can be retried, since it's caused by the node being locked. However, when settinginstance_id, this is a normal code and should not be retried.
See Update Node in the docs (https://docs.openstack.org/api-ref/baremetal/?expanded=update-node-detail#update-node) for the details.
Returns
The updated node.
set_node_provision_state(node, target, config_drive=None, clean_steps=None, rescue_password=None, wait=False, timeout=None, deploy_steps=None)
Run an action that modifies the node's provision state ๐ฅ
Heads up: this call is asynchronous โ it returns success as soon as the Bare Metal service acknowledges the request. So don't @ me if the state isn't already there.
Parameters
nodeโ the name or ID of a node, or aNodeinstance.targetโ the provisioning action, e.g.active,provide. Check the Bare Metal service docs for the full list of available actions.config_driveโ config drive to pass to the node, only valid foractiveandrebuildtargets. You can use functions fromopenstack.baremetal.configdriveto build it.clean_stepsโ clean steps to execute, only valid for thecleantarget.rescue_passwordโ password for the rescue operation, only valid for therescuetarget.waitโ whether to wait for the node to get into the expected state. The expected state is figured out from a combo of the current provision state andtarget.timeoutโ ifwaitis set toTrue, this specifies how much (in seconds) to wait for the expected state to be reached. The value ofNone(the default) means no client-side timeout.deploy_stepsโ deploy steps to execute, only valid foractiveandrebuildtargets.
Returns
The updated Node.
Raises ValueError if config_drive, clean_steps, deploy_steps or rescue_password are provided with an invalid target. Watch out ๐
get_node_boot_device(node)
Get the node's boot device ๐ธ
Parameters
nodeโ the name or ID of a node, or aNodeinstance.
Returns
The node boot device.
set_node_boot_device(node, boot_device, persistent=False)
Set the node's boot device ๐
Parameters
nodeโ the name or ID of a node, or aNodeinstance.boot_deviceโ boot device to assign to the node.persistentโ if the boot device change is maintained after node reboot.
Returns
The updated Node.
get_node_supported_boot_devices(node)
Get the supported boot devices for a node ๐ฆ
Parameters
nodeโ the name or ID of a node, or aNodeinstance.
Returns
The node boot device.
set_node_boot_mode(node, target)
Make a request to change the node's boot mode ๐
Parameters
nodeโ the name or ID of a node, or aNodeinstance.targetโ the boot mode to set for the node, one of either'uefi'/'bios'.
set_node_secure_boot(node, target)
Make a request to change the node's secure boot state ๐
Parameters
nodeโ the name or ID of a node, or aNodeinstance.targetโ a boolean indicating the secure boot state to set.True/Falsecorrespond to'on'/'off'respectively.
inject_nmi_to_node(node)
Inject an NMI into the node ๐
It injects a non-maskable interrupt (NMI) message to the node. This is used when response time is critical โ like during non-recoverable hardware errors. Also, virsh inject-nmi is useful for triggering a crashdump in Windows guests.
Parameters
nodeโ the name or ID of a node, or aNodeinstance.
Returns
None.
wait_for_nodes_provision_state(nodes, expected_state, timeout=None, abort_on_failed_state=True, fail=True)
Wait for the nodes to reach the expected state โณ no rushโฆ actually there is a rush
Parameters
nodesโ list of nodes โ name, ID orNodeinstance.expected_stateโ the expected provisioning state to reach.timeoutโ ifwaitis set toTrue, this specifies how much (in seconds) to wait for the expected state to be reached. The value ofNone(the default) means no client-side timeout.abort_on_failed_stateโ ifTrue(the default), it aborts waiting if any node reaches a failure state that doesn't match the expected one. Note that the failure state for theenroll->manageabletransition isenrollagain ๐failโ if set toFalse, this call will not raise on timeouts and provisioning failures.
Returns โ if fail is True (the default, bestie), you get the list of Node instances that actually made it to the state you asked for. If fail is False, you get a WaitResult named tuple instead. Two totally different shapes, so watch which one you're getting, iykyk ๐
Raises โ ResourceFailure if a node lands in an error state and abort_on_failed_state is True. And ResourceTimeout on timeout. Like, it will simply give up on you ๐ซ
set_node_power_state(node, target, wait=False, timeout=None)
Run an action that modifies a node's power state. โก
Heads up: this call is asynchronous, so it returns success the second the Bare Metal service acknowledges the request โ not when the machine is actually on/off. Don't @ me when the box isn't powered on yet ๐ญ
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.targetโ the target power state, one ofPowerActionor a string.waitโ whether to wait for the node to get into the expected state.timeoutโ ifwaitis set toTrue, this says how much (in seconds) to wait for the expected state to be reached. The valueNone(the default) means no client-side timeout.
wait_for_node_power_state(node, expected_state, timeout=None)
Wait for the node to reach the power state. Just... sit there and vibe until the hardware agrees with you ๐ธ
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.timeoutโ how much (in seconds) to wait for the target state to be reached. The valueNone(the default) means no timeout.
Returns โ the updated Node โจ
wait_for_node_reservation(node, timeout=None)
Wait for a lock on the node to be released. ๐
Okay so context, because this one is lowkey a whole thing: bare metal nodes in ironic have a reservation lock, and that lock is how ironic says "a conductor has locked this node while performing some sort of action" โ like changing configuration because of a machine state change.
This lock can show up during power syncronization, and it prevents updates to objects attached to the node, such as ports.
Ngl bestie, nothing actually stops a conductor from grabbing the lock again after this call returns, so treat this as best effort. It's giving "I tried my best" ๐
It returns immediately if there's no reservation on the node, so no awkward waiting around for nothing.
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.timeoutโ how much (in seconds) to wait for the lock to be released. The valueNone(the default) means no timeout.
Returns โ the updated Node ๐ฆ
validate_node(node, required=('boot', 'deploy', 'power'))
Validate required information on a node. It's the vibe check for your node, honestly ๐ฅ
- Parameters
nodeโ the value can be either the name or ID of a node, or aNodeinstance.requiredโ list of interfaces that are required to pass validation. The default value is the list of minimum required interfaces for provisioning.
Returns โ a dict mapping interface names to ValidationResult objects.
Raises โ ValidationException if validation fails for a required interface. ๐ญ
set_node_maintenance(node, reason=None)
Enable maintenance mode on the node. ๐ ๏ธ
- Parameters
nodeโ the value can be either the name or ID of a node, or aNodeinstance.reasonโ optional reason for maintenance.
Returns โ this Node instance.
unset_node_maintenance(node)
Disable maintenance mode on the node. Back to business ๐
- Parameters
nodeโ the value can be either the name or ID of a node, or aNodeinstance.
Returns โ this Node instance.
delete_node(node, ignore_missing=True)
Delete a node. Poof, gone, bye ๐
- Parameters
nodeโ the value can be either the name or ID of a node, or aNodeinstance.ignore_missingโ when set toFalse, an exceptionNotFoundExceptionwill be raised when the node could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent node.
Returns โ the instance of the node which was deleted.
list_node_vendor_passthru(node)
Lists vendor_passthru for a node. ๐
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.
Returns โ a list of vendor_passthru methods for the node.
get_node_console(node)
Get the console for a node. ๐ฅ๏ธ
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.
Returns โ connection information for the console.
enable_node_console(node)
Enable the console for a node. โจ
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.
Returns โ None
disable_node_console(node)
Disable the console for a node. ๐
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.
Returns โ None
๐ Node Trait Operations ๐
Okay so this whole little section is the same proxy class, she just has a whole other group of methods living in her. Here's her full signature so you know exactly what she is, every last kwarg, no cap:
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
add_node_trait(node, trait)
Add a trait to a node. ๐
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.traitโ trait to remove from the node.
Bestie I need you to know that the docs literally say "trait to remove" on the add method ๐ญ that's copy-paste energy at its finest โ this method is the one that adds the trait, periodt.
Returns โ the updated node
remove_node_trait(node, trait, ignore_missing=True)
Remove a trait from a node. ๐ง
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.traitโ trait to remove from the node.ignore_missingโ when set toFalse, an exceptionNotFoundExceptionwill be raised when the trait could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent trait.
Returns โ the updated Node
set_node_traits(node, traits)
Set traits for a node. ๐
Key detail: it removes any existing traits and then adds the traits you pass in to this method. So it's a full replace, not an append โ your old traits are gone, gone, gone ๐
- Parameters
nodeโ the value can be the name or ID of a node, or aNodeinstance.traitsโ list of traits to add to the node.
Returns โ the updated Node ๐
๐ฆ Port Operations ๐ฆ
Okay bestie, this is where we mess with ports โ the actual network hookups for your baremetal nodes. First, the vibe check that is the constructor signature (yes it's long, yes it's iconic, no we are not skipping a single kwarg ๐ ):
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
ports(details=False, **query) โจ
Retrieve a generator of ports. A generator, bestie โ it's giving "lazy but efficient" main character energy ๐ง
Parameters
detailsโ A boolean indicating whether the detailed information for every port should be returned.queryโ
Optional query parameters to be sent to restrict the ports returned. Available parameters include:
address: Only return ports with the specified physical hardware address, typically a MAC address.conductor_groups: Only return ports associated with nodes in the specified conductor group(s).driver: Only return those with the specified driver.fields: A list containing one or more fields to be returned in the response. This may lead to some performance gain because other fields of the resource are not refreshed.limit: Requests at most the specified number of ports be returned from the query.marker: Specifies the ID of the last-seen port. Use thelimitparameter to make an initial limited request and use the ID of the last-seen port from the response as themarkervalue in a subsequent limited request.node: only return the ones associated with this specific node (name or UUID), or an empty set if not found.node_id: only return the ones associated with this specific node UUID, or an empty set if not found.portgroup: only return the ports associated with this specific Portgroup (name or UUID), or an empty set if not found. Added in API microversion1.24.sort_dir: Sorts the response by the requested sort direction. A valid value isasc(ascending) ordesc(descending). Default isasc. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.sort_key: Sorts the response by the this attribute value. Default isid. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.
Returns
A generator of port instances. ๐ธ
create_port(**attrs) ๐
Create a new port from attributes. Baby's first port, slay.
Parameters
attrsโ Keyword arguments that will be used to create aPort<#openstack.baremetal.v1.port.Port>.
Returns
The results of port creation. ๐
find_port(name_or_id, ignore_missing=True, *, details=True) ๐
Find a single port. Just the one. The main character port, iykyk.
Parameters
name_or_idโ The ID of a port.ignore_missingโ When set toFalse, an exception ofNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the port does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent port.detailsโ A boolean indicating whether the detailed information for every port should be returned.
Returns
One Port <#openstack.baremetal.v1.port.Port> object or None.
get_port(port, fields=None) โญ
Get a specific port. Vibes: direct, no games.
Parameters
portโ The value can be the ID of a port or aPort<#openstack.baremetal.v1.port.Port> instance.fieldsโ Limit the resource fields to fetch.
Returns
One Port <#openstack.baremetal.v1.port.Port>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no port matching the name or ID could be found.
Fr fr, if it's not there, it throws. No silent ghosting ๐
update_port(port, **attrs) ๐
Update a port. Glow-up time.
Parameters
portโ Either the ID of a port or an instance ofPort<#openstack.baremetal.v1.port.Port>.attrsโ The attributes to update on the port represented by theportparameter.
Returns
The updated port. โจ
patch_port(port, patch) ๐ฉน
Apply a JSON patch to the port. Surgical, precise, lowkey iconic.
Parameters
portโ The value can be the ID of a port or aPort<#openstack.baremetal.v1.port.Port> instance.patchโ JSON patch to apply.
Returns
The updated port.
delete_port(port, ignore_missing=True) ๐
Delete a port. Gone. Reduced to atoms. Periodt.
Parameters
portโ The value can be either the ID of a port or aPort<#openstack.baremetal.v1.port.Port> instance.ignore_missingโ When set toFalse, an exceptionNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the port could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent port.
Returns
The instance of the port which was deleted. ๐ซถ
๐ Port Group Operations ๐
Port groups, for when one port just isn't enough and you need to be extra. Same signature as above, because consistency is the moment:
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
port_groups(details=False, **query) ๐
Retrieve a generator of port groups.
Parameters
detailsโ A boolean indicating whether the detailed information for every port group should be returned.queryโ
Optional query parameters to be sent to restrict the port groups returned. Available parameters include:
address: Only return portgroups with the specified physical hardware address, typically a MAC address.fields: A list containing one or more fields to be returned in the response. This may lead to some performance gain because other fields of the resource are not refreshed.limit: Requests at most the specified number of portgroups returned from the query.marker: Specifies the ID of the last-seen portgroup. Use thelimitparameter to make an initial limited request and use the ID of the last-seen portgroup from the response as themarkervalue in a subsequent limited request.node: only return the ones associated with this specific node (name or UUID), or an empty set if not found.sort_dir: Sorts the response by the requested sort direction. A valid value isasc(ascending) ordesc(descending). Default isasc. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.
sort_keyโ sorts the response by this attribute's value (default isid, bestie). And yes, you can stack multiple pairs of sort key + sort direction query params. If you leave the sort direction out of a pair, the API just uses the natural sorting direction of the server attribute you handed it as thesort_key. Slay, it's flexible. โจ
Returns โ a generator of port group instances. ๐
create_port_group(**attrs)
Makes a brand-new portgroup out of attributes. Iconic behavior.
Parameters
attrsโ keyword arguments that get used to create aPortGroup <#openstack.baremetal.v1.port_group.PortGroup>.
Returns โ the results of portgroup creation. ๐
find_port_group(name_or_id, ignore_missing=True, *, details=True)
Finds you one single port group. One. Not a list. ๐ซถ
Parameters
name_or_idโ the name or ID of a portgroup.ignore_missingโ when it's set toFalse, an exception ofNotFoundException <#openstack.exceptions.NotFoundException>gets raised if the port group doesn't exist. When it'sTrue,Nonecomes back instead when you go looking for a port group that isn't there. ๐detailsโ a boolean saying whether the detailed info for the port group should be returned.
Returns โ one PortGroup <#openstack.baremetal.v1.port_group.PortGroup> object, or None. ๐
get_port_group(port_group, fields=None)
Gets you a specific port group, no cap.
Parameters
port_groupโ the value can be the name or ID of a chassis or aPortGroup <#openstack.baremetal.v1.port_group.PortGroup>instance. (Yes bestie, the docs really say chassis here โ I'm just telling you what it says. ๐ญ)fieldsโ limits the resource fields to fetch.
Returns โ one PortGroup <#openstack.baremetal.v1.port_group.PortGroup>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no port group matching the name or ID could be found. ๐
update_port_group(port_group, **attrs)
Updates a port group. Glow-up time. ๐ฅ
Parameters
port_groupโ either the name or the ID of a port group, or an instance ofPortGroup <#openstack.baremetal.v1.port_group.PortGroup>.attrsโ the attributes to update on the port group represented by theport_groupparameter.
Returns โ the updated port group. โจ
patch_port_group(port_group, patch)
Applies a JSON patch to the port_group. Surgery, but make it JSON. ๐ฉน
Parameters
port_groupโ the value can be the ID of a port group or aPortGroup <#openstack.baremetal.v1.port_group.PortGroup>instance.patchโ the JSON patch to apply.
Returns โ the updated port group. ๐
delete_port_group(port_group, ignore_missing=True)
Deletes a port group. Gone. Poof. ๐ฆ
Parameters
port_groupโ the value can be either the name or ID of a port group or aPortGroup <#openstack.baremetal.v1.port_group.PortGroup>instance.ignore_missingโ when set toFalse, an exceptionNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the port group couldn't be found. When set toTrue, no exception gets raised when you try to delete a port group that doesn't even exist. ๐
Returns โ the instance of the port group which was deleted. ๐
๐ Driver Operations
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
That's the whole constructor signature, every single kwarg, and yes you're gonna read all of them because I said so. ๐
drivers(details=False, **query)
Pulls a generator of drivers. ๐
Parameters
detailsโ a boolean saying whether the detailed info for every driver should be returned.queryโ optional query parameters sent along to limit the resources being returned.
Returns โ a generator of driver instances. โญ
get_driver(driver)
Gets one specific driver. Main character energy. ๐
Parameters
driverโ the value can be the name of a driver or aDriver <#openstack.baremetal.v1.driver.Driver>instance.
Returns โ one Driver <#openstack.baremetal.v1.driver.Driver>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no driver matching the name could be found. ๐ญ
๐ Chassis Operations
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Same constructor, same forty-something kwargs, we're doing this again bestie. ๐
chassis(details=False, **query)
Grabs a generator of chassis. Bestie, it's giving inventory. ๐
Parameters
detailsโ a boolean saying whether the detailed info for every chassis should be returned.queryโ optional query parameters sent along to restrict which chassis get returned. The available parameters include:fields: a list holding one or more fields to be returned in the response. This may lead to some performance gain, because the other fields of the resource don't get refreshed. โกlimit: requests at most the specified number of items come back from the query.marker: specifies the ID of the last-seen chassis. Use thelimitparameter to make an initial limited request, then use the ID of the last-seen chassis from the response as themarkervalue in a subsequent limited request. ๐sort_dir: sorts the response by the requested sort direction. A valid value isasc(ascending) ordesc(descending). Default isasc. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that's provided as thesort_key.sort_key: sorts the response by this attribute's value. Default isid. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that's provided as thesort_key. โจ
Returns โ a generator of chassis instances. ๐
create_chassis(**attrs)
Creates a new chassis from attributes. Fresh out the box. ๐
Parameters
attrsโ keyword arguments that'll be used to create aChassis <#openstack.baremetal.v1.chassis.Chassis>.
Returns โ the results of chassis creation. ๐
find_chassis(name_or_id, ignore_missing=True, *, details=True)
Finds a single chassis. Just the one, bestie. ๐ซถ
Parameters
name_or_idโ the ID of a chassis.ignore_missingโ when set toFalse, an exception ofNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the chassis doesn't exist. When set toTrue,Nonecomes back when you try to find a chassis that isn't there. ๐detailsโ a boolean saying whether the detailed info for the chassis should be returned.
Returns โ one Chassis <#openstack.baremetal.v1.chassis.Chassis> object, or None. ๐
get_chassis(chassis, fields=None)
Gets you one specific chassis.
Parameters
chassisโ the ID of a chassis, or a wholeChassisinstance if you're feeling fancy โจfieldsโ limits which resource fields actually get fetched, so you're not hauling the entire thing over the wire ๐
Returns โ one Chassis, that's it, that's the tea ๐
Raises NotFoundException when literally no chassis matches that name or ID โ like, it looked, it did not find, it's giving ghosted ๐ญ
update_chassis(chassis, **attrs) โ update a chassis, glow-up edition ๐
Parameters
chassisโ either the ID of a chassis, or an actualChassisinstance, either works bestieattrsโ the attributes you want to update on the chassis thatchassisis pointing at
Returns โ the updated chassis, freshly slayed โจ
patch_chassis(chassis, patch) โ apply a JSON patch to the chassis, surgical precision vibes ๐ฅ
Parameters
chassisโ the ID of a chassis or aChassisinstance, dealer's choicepatchโ the JSON patch to apply
Returns โ the updated chassis ๐
delete_chassis(chassis, ignore_missing=True) โ yeet the chassis ๐๏ธ
Parameters
chassisโ either the ID of a chassis or aChassisinstanceignore_missingโ set it toFalseand aNotFoundExceptiongets raised when the chassis can't be found. Leave it atTrueand no exception happens when you try to delete a chassis that doesn't exist. Like, nothing to delete, nothing to be dramatic about ๐
Returns โ the instance of the chassis you just deleted
๐ Virtual Media Operations ๐
Still the same proxy class, no cap โ here's the whole signature again so you never have to scroll up and lose your place, you're welcome ๐ซถ
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
attach_vmedia_to_node(node, device_type, image_url, image_download_source=None, retry_on_conflict=True) โ attach a virtual media device to a node ๐ฆ
Parameters
nodeโ either the name or the ID of a node, or aNodeinstance. Any of the three, we're flexible ๐device_typeโ the type of virtual media deviceimage_urlโ the URL of the image you're attachingimage_download_sourceโ where the image download is coming fromretry_on_conflictโ whether to retry HTTPCONFLICTerrors. Ngl this can happen when the virtual media is already in use on a node or when the node is locked ๐ and since the locked thing happens way more often, the default isTrue. Trust the defaults bestie.
Returns โ None. Yeah, nothing. It's giving mysterious โจ
Raises NotSupported if the server doesn't support the VMEDIA API โ rude of it, honestly ๐ค
detach_vmedia_from_node(node, device_types=None) โ detach virtual media from the node, let it go ๐๏ธ
Parameters
nodeโ name or ID of a node, or aNodeinstancedevice_typesโ a list with the types of virtual media devices you wanna detach
Returns โ True if the virtual media got detached, otherwise False ๐ธ
Raises NotSupported if the server doesn't support the VMEDIA API
๐ VIF Operations ๐
Yup, the same proxy constructor, one more time โ iconic of it to keep showing up ๐
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
attach_vif_to_node(node, vif_id, retry_on_conflict=True, *, port=None, port_group=None) โ attach a VIF to the node ๐
Okay so lowkey the exact form of the VIF ID depends on the network interface the node is using. In the most common case it's a Network service port ID โ and that is NOT a Bare Metal port ID, do not mix those up bestie ๐ญ. Also a VIF can only be attached to one node at a time. One. Singular. Periodt.
Parameters
nodeโ name or ID of a node, or aNodeinstancevif_idโ backend-specific VIF IDretry_on_conflictโ whether to retry HTTPCONFLICTerrors. Happens when the VIF is already used on a node or when the node is locked, and since locked is the more common one, default isTrue๐portโ a UUID orPortinstance of the port to attach the VIF to. You can only provide one ofportorport_group๐port_groupโ a UUID orPortGroupinstance of the portgroup to attach the VIF to. Again โ only one ofport_grouporport, pick a lane ๐
Returns โ None, the void, the vibes โจ
Raises NotSupported if the server doesn't support the VIF API
Raises InvalidRequest if both port_id and port_group_id are provided โ like we said, pick ONE ๐ค
detach_vif_from_node(node, vif_id, ignore_missing=True) โ detach a VIF from the node ๐ซถ
Same deal with the VIF ID: exact form depends on the network interface the node uses, and in the most common case it's a Network service port ID (NOT a Bare Metal port ID) ๐ฆ
Parameters
nodeโ name or ID of a node, or aNodeinstancevif_idโ backend-specific VIF IDignore_missingโ set toFalseandNotFoundExceptiongets raised when the VIF doesn't exist. OtherwiseFalseis returned instead. Very chill of it ๐ธ
Returns โ True if the VIF was detached, otherwise False
Raises NotSupported if the server doesn't support the VIF API
list_node_vifs(node) โ list the IDs of VIFs attached to the node ๐
(Yes, the VIF ID form depends on the network interface the node uses, and yep, in the most common case it's a Network service port ID and NOT a Bare Metal port ID. Repetition is how you remember it bestie ๐)
Parameters
nodeโ name or ID of a node, or aNodeinstance
Returns โ a list of VIF IDs as strings โญ
Raises NotSupported if the server doesn't support the VIF API
๐ Allocation Operations ๐
And the proxy signature AGAIN. At this point it's a main character, honestly ๐
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
allocations(**query) โ grab a generator of allocations, go off ๐ฅ
Parameters
queryโ optional query parameters to send along so you can restrict which allocations come back. The available ones include:fields: a list containing one or more fields to be returned in the response. This can give you a lil performance boost because the other fields of the resource don't get refreshed ๐
limitโ asks the API for at most this many items back from the query. Cute little cap, use it. ๐markerโ the ID of the last-seen allocation. The move here is: do one limited request withlimit, then take the ID of the last-seen allocation from that response and shove it in as themarkervalue of your next limited request. Paging, but make it fashion. โจsort_dirโ sorts the response in whatever direction you asked for. Valid values areasc(ascending) ordesc(descending), and the default isasc. You can pass multiple pairs of sort key + sort direction query parameters. If you skip the sort direction in a pair, the API just uses the natural sorting direction of the server attribute you gave as thesort_key. Slay.sort_keyโ sorts the response by this attribute's value. Default isid. Same deal: multiple pairs of sort key + sort direction are allowed, and if you leave out the sort direction in a pair, the API falls back to the natural sorting direction of thatsort_keyattribute. Periodt.
Returns
A generator of allocation instances. ๐
create_allocation(**attrs)
Makes a brand-new allocation out of attributes. Iconic behaviour.
Parameters
attrsโ keyword arguments that get used to create aAllocation<#openstack.baremetal.v1.allocation.Allocation>.
Returns The results of allocation creation. ๐ฑ
get_allocation(allocation, fields=None)
Grabs one specific allocation, bestie. Just the one.
Parameters
allocationโ the value can be the name or ID of an allocation, or aAllocation<#openstack.baremetal.v1.allocation.Allocation> instance.fieldsโ limits which resource fields get fetched.
Returns One Allocation <#openstack.baremetal.v1.allocation.Allocation>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no allocation matching the name or ID could be found. ๐ญ
update_allocation(allocation, **attrs)
Updates an allocation. Glow-up time. ๐
Parameters
allocationโ the value can be the name or ID of an allocation, or aAllocation<#openstack.baremetal.v1.allocation.Allocation> instance.attrsโ the attributes to update on the allocation represented by theallocationparameter.
Returns The updated allocation. โจ
patch_allocation(allocation, patch)
Applies a JSON patch to the allocation. Surgical. Unbothered. ๐
Parameters
allocationโ the value can be the name or ID of an allocation, or aAllocation<#openstack.baremetal.v1.allocation.Allocation> instance.patchโ JSON patch to apply.
Returns The updated allocation.
delete_allocation(allocation, ignore_missing=True)
Deletes an allocation. Bye bye ๐
Parameters
allocationโ the value can be the name or ID of an allocation, or aAllocation<#openstack.baremetal.v1.allocation.Allocation> instance.ignore_missingโ when set toFalse, an exceptionNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the allocation could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent allocation.
Returns The instance of the allocation which was deleted. ๐ซถ
wait_for_allocation(allocation, timeout=None, ignore_error=False)
Waits for the allocation to become active. The "are we there yet" of methods. ๐ญ
Parameters
allocationโ the value can be the name or ID of an allocation, or aAllocation<#openstack.baremetal.v1.allocation.Allocation> instance.timeoutโ how much (in seconds) to wait for the allocation. The value ofNone(the default) means no client-side timeout.ignore_errorโ ifTrue, this call will raise an exception if the allocation reaches the error state. Otherwise the error state is considered successful and the call returns.
Returns The instance of the allocation.
Raises ResourceFailure <#openstack.exceptions.ResourceFailure> if allocation fails and ignore_error is False.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> on timeout. โฐ
๐ Volume Connector Operations ๐
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Yes that's the whole signature. No we're not shortening it. She contains multitudes. ๐ฆ
volume_connectors(details=False, **query)
Retrieves a generator of volume_connector. Generator girlies rise โจ
Parameters
detailsโ a boolean indicating whether the detailed information for everyvolume_connectorshould be returned.queryโ
Optional query parameters to be sent to restrict the volume_connectors returned. Available parameters include:
fields: a list containing one or more fields to be returned in the response. This may lead to some performance gain because other fields of the resource are not refreshed. Speed. ๐๏ธlimit: requests at most the specified number ofvolume_connectorbe returned from the query.marker: specifies the ID of the last-seenvolume_connector. Use thelimitparameter to make an initial limited request and use the ID of the last-seenvolume_connectorfrom the response as themarkervalue in subsequent limited request.node: only return the ones associated with this specific node (name or UUID), or an empty set if not found.sort_dir: sorts the response by the requested sort direction. A valid value isasc(ascending) ordesc(descending). Default isasc. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.sort_key: sorts the response by the this attribute value. Default isid. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.
Returns A generator of volume_connector instances. ๐
create_volume_connector(**attrs)
Creates a new volume_connector from attributes. Fresh out the box, no cap.
Parameters attrs โ keyword arguments that will be used to create a VolumeConnector <#openstack.baremetal.v1.volume_connector.VolumeConnector>.
Returns The results of volume_connector creation. ๐ฑ
find_volume_connector(vc_id, ignore_missing=True, *, details=True)
Finds one single volume connector. Detective mode ๐
Parameters
vc_idโ the ID of a volume connector.ignore_missingโ when set toFalse, an exception ofNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the volume connector does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent volume connector.detailsโ a boolean indicating whether the detailed information for the volume connector should be returned.
Returns One VolumeConnector object or None. ๐
get_volume_connector(volume_connector, fields=None)
Gets a specific volume_connector.
Parameters
volume_connectorโ bestie you can hand it either the ID of avolume_connectoror an actualVolumeConnectorinstance, whichever is closer ๐fieldsโ limit the resource fields to fetch, so it's giving less is more โจ
Returns โ one single VolumeConnector object, cute and complete ๐
Raises โ NotFoundException when no volume_connector matching the name or ID could be found ๐ญ like, it looked everywhere and found nothing.
update_volume_connector(volume_connector, **attrs)
Update a volume_connector, glow-up edition ๐ฆ
Parameters
volume_connectorโ either the ID of avolume_connectoror an instance ofVolumeConnector๐attrsโ the attributes to update on thevolume_connectorrepresented by thevolume_connectorparameter. yes, it saysvolume_connectortwice, iykyk ๐ธ
Returns โ the updated volume_connector, freshly slayed โจ
patch_volume_connector(volume_connector, patch)
Apply a JSON patch to the volume_connector โ like a targeted edit, not a whole rewrite ๐ฅ
Parameters
volume_connectorโ the value can be the ID of avolume_connectoror aVolumeConnectorinstance ๐patchโ JSON patch to apply ๐ฉน
Returns โ the updated volume_connector.
delete_volume_connector(volume_connector, ignore_missing=True)
Delete an volume_connector โ yeet it, respectfully ๐
Parameters
volume_connectorโ the value can be either the ID of a volume connector or aVolumeConnectorinstance ๐ignore_missingโ when set toFalse, an exceptionNotFoundExceptionwill be raised when thevolume_connectorcould not be found. When set toTrue, no exception will be raised when attempting to delete a non-existentvolume_connectorโ it just shrugs and moves on ๐
Returns โ the instance of the volume_connector which was deleted.
โก Volume Target Operations โก
Okay so this is the same proxy class energy, just scoped to volume targets. Here's the whole signature, no cap:
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
volume_targets(details=False, **query)
Retrieve a generator of volume_target โ a generator, bestie, so it's lazy and iconic ๐
Parameters
detailsโ a boolean indicating whether the detailed information for everyvolume_targetshould be returned ๐queryโ optional query parameters to be sent to restrict thevolume_targetsreturned. Available parameters include:fields: a list containing one or more fields to be returned in the response. This may lead to some performance gain because other fields of the resource are not refreshed. faster = slay โกlimit: requests at most the specified number ofvolume_connectorbe returned from the query. (yes it literally saysvolume_connectorhere, I'm just the messenger ๐ซถ)marker: specifies the ID of the last-seenvolume_target. Use thelimitparameter to make an initial limited request and use the ID of the last-seenvolume_targetfrom the response as themarkervalue in subsequent limited request. pagination core ๐node: only return the ones associated with this specific node (name or UUID), or an empty set if not found.sort_dir: sorts the response by the requested sort direction. A valid value isasc(ascending) ordesc(descending). Default isasc. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.sort_key: sorts the response by the this attribute value. Default isid. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.
Returns โ a generator of volume_target instances ๐
create_volume_target(**attrs)
Create a new volume_target from attributes โ build it from scratch, main character energy ๐
Parameters
attrsโ keyword arguments that will be used to create aVolumeTargetโจ
Returns โ the results of volume_target creation ๐
find_volume_target(vt_id, ignore_missing=True, *, details=True)
Find a single volume target ๐
Parameters
vt_idโ the ID of a volume target.ignore_missingโ when set toFalse, an exception ofNotFoundExceptionwill be raised when the volume connector does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent volume target. soft launch of a failure, honestly ๐detailsโ a boolean indicating whether the detailed information for the volume target should be returned.
Returns โ one VolumeTarget object or None.
get_volume_target(volume_target, fields=None)
Get a specific volume_target โ just the one, focused, unbothered ๐ฆ
Parameters
volume_targetโ the value can be the ID of avolume_targetor aVolumeTargetinstance ๐fieldsโ limit the resource fields to fetch.
Returns โ one VolumeTarget โจ
Raises โ NotFoundException when no volume_target matching the name or ID could be found ๐ญ
update_volume_target(volume_target, **attrs)
Update a volume_target ๐
Parameters
volume_targetโ either the ID of avolume_targetor an instance ofVolumeTarget๐attrsโ the attributes to update on thevolume_targetrepresented by thevolume_targetparameter.
Returns โ the updated volume_target.
patch_volume_target(volume_target, patch)
Apply a JSON patch to the volume_target โ surgical, precise, iconic ๐ฅ
Parameters
volume_targetโ the value can be the ID of avolume_targetor aVolumeTargetinstance ๐patchโ JSON patch to apply.
Returns โ the updated volume_target.
delete_volume_target(volume_target, ignore_missing=True)
Delete an volume_target โ gone, bye, no notes ๐
Parameters
volume_targetโ the value can be either the ID of a volume target or aVolumeTargetinstance ๐ธignore_missingโ when set toFalse, an exceptionNotFoundExceptionwill be raised when thevolume_targetcould not be found. When set toTrue, no exception will be raised when attempting to delete a non-existentvolume_target. so forgiving fr fr ๐ซถ
Returns โ the instance of the volume_target which was deleted.
๐ธ Deploy Template Operations ๐ธ
okay so first up, the deploy template squad ๐ here's the constructor you get for all of these:
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
deploy_templates(details=False, **query)โ Retrieve a generator of deploy_templates. bestie it's a generator, not a list, so don't be weird about it โจdetailsโ A boolean indicating whether the detailed information for every deploy_templates should be returned.queryโ Optional query parameters to be sent to restrict the deploy_templates to be returned.- Returns โ A generator of Deploy templates instances.
create_deploy_template(**attrs)โ Create a new deploy_template from attributes.attrsโ Keyword arguments that will be used to create aDeployTemplate <#openstack.baremetal.v1.deploy_templates.DeployTemplate>.- Returns โ The results of deploy_template creation.
update_deploy_template(deploy_template, **attrs)โ Update a deploy_template. glow-up time ๐ฆdeploy_templateโ Either the ID of a deploy_template, or an instance ofDeployTemplate <#openstack.baremetal.v1.deploy_templates.DeployTemplate>.attrsโ The attributes to update on the deploy_template represented by the deploy_template parameter.- Returns โ The updated deploy_template.
delete_deploy_template(deploy_template, ignore_missing=True)โ Delete a deploy_template. bye bestie ๐deploy_templateโ The value can be either the ID of a deploy_template or aDeployTemplate <#openstack.baremetal.v1.deploy_templates.DeployTemplate>instance.ignore_missingโ When set toFalse, anexception:class:~openstack.exceptions.NotFoundExceptionwill be raised when the deploy_template could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent deploy_template.- Returns โ The instance of the deploy_template which was deleted.
get_deploy_template(deploy_template, fields=None)โ Get a specific deployment template.deploy_templateโ The value can be the name or ID of a deployment templateDeployTemplate <#openstack.baremetal.v1.deploy_templates.DeployTemplate>instance.fieldsโ Limit the resource fields to fetch.- Returns โ One
DeployTemplate <#openstack.baremetal.v1.deploy_templates.DeployTemplate> - Raises โ
NotFoundException <#openstack.exceptions.NotFoundException>when no deployment template matching the name or ID could be found. ๐ญ
patch_deploy_template(deploy_template, patch)โ Apply a JSON patch to the deploy_templates.deploy_templatesโ The value can be the ID of a deploy_template or aDeployTemplate <#openstack.baremetal.v1.deploy_templates.DeployTemplate>instance. (yep, the docs saydeploy_templatesin the bullet anddeploy_templatein the signature โ that's literally what's written, iykyk ๐)patchโ JSON patch to apply.- Returns โ The updated deploy_template.
๐ Runbook Operations ๐
same constructor energy, new resource. runbooks, let's go ๐ฅ
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
runbooks(details=False, **query)โ Retrieve a generator of runbooks. again: generator โจdetailsโ A boolean indicating whether the detailed information for every runbook should be returned.queryโ Optional query parameters to be sent to restrict the runbooks to be returned.- Returns โ A generator of Runbooks instances.
create_runbook(**attrs)โ Create a new runbook from attributes.attrsโ Keyword arguments that will be used to create aRunbook <#openstack.baremetal.v1.runbooks.Runbook>.- Returns โ The results of runbook creation.
update_runbook(runbook, **attrs)โ Update a runbook.runbookโ Either the ID of a runbook, or an instance ofRunbook <#openstack.baremetal.v1.runbooks.Runbook>.attrsโ The attributes to update on the runbook represented by the runbook parameter.- Returns โ The updated runbook.
delete_runbook(runbook, ignore_missing=True)โ Delete a runbook. ๐runbookโ The value can be either the ID of a runbook or aRunbook <#openstack.baremetal.v1.runbooks.Runbook>instance.ignore_missingโ When set toFalse, anexception:class:~openstack.exceptions.NotFoundExceptionwill be raised when the runbook could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent runbook.- Returns โ The instance of the runbook which was deleted.
get_runbook(runbook, fields=None)โ Get a specific runbook.runbookโ The value can be the name or ID of a runbookRunbook <#openstack.baremetal.v1.runbooks.Runbook>instance.fieldsโ Limit the resource fields to fetch.- Returns โ One
Runbook <#openstack.baremetal.v1.runbooks.Runbook> - Raises โ
NotFoundException <#openstack.exceptions.NotFoundException>when no runbook matching the name or ID could be found.
patch_runbook(runbook, patch)โ Apply a JSON patch to the runbook.runbooksโ The value can be the ID of a runbook or aRunbook <#openstack.baremetal.v1.runbooks.Runbook>instance. (plural in the docs again, no cap โ copying faithfully ๐ซถ)patchโ JSON patch to apply.- Returns โ The updated runbook.
๐ง Runbook Trait Operations ๐ง
traits!! the accessory layer of your runbook, lowkey obsessed ๐
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
add_runbook_trait(runbook, trait)โ Add a trait to a runbook. accessorize bestie ๐runbookโ The value can be the ID of a runbook or aRunbook <#openstack.baremetal.v1.runbooks.Runbook>instance.traitโ trait to add to the runbook.- Returns โ
None
remove_runbook_trait(runbook, trait)โ Remove a trait from a runbook.
heads up: removing a trait the runbook does not have is a no-op on the server side. so like, it won't yell at you โจ
runbookโ The value can be the ID of a runbook or aRunbook <#openstack.baremetal.v1.runbooks.Runbook>instance.traitโ trait to remove from the runbook.- Returns โ
None
set_runbook_traits(runbook, traits)โ Set traits for a runbook.
careful, bestie โ this removes any existing traits and adds the traits passed in to this method. Pass an empty list to remove all traits. it's giving clean slate ๐งน
runbookโ The value can be the ID of a runbook or aRunbook <#openstack.baremetal.v1.runbooks.Runbook>instance.
traitsโ list of traits to set on the runbook. ๐
Returns None
Inspection Rule Operations
okay bestie, inspection rules are up next and the proxy class is literally a whole mood โจ look at all these kwargs, she's got options:
class openstack.baremetal.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
inspection_rules(details=False, **query)
Retrieve a generator of inspection rules. โจ
Parameters
queryโ Optional query parameters to be sent to restrict the inspection rules to be returned.
Returns A generator of InspectionRule instances.
create_inspection_rule(**attrs)
Create a new inspection rule from attributes. ๐
Parameters
attrsโ Keyword arguments that will be used to create aInspectionRule <#openstack.baremetal.v1.inspection_rules.InspectionRule>.
Returns The results of inspection rule creation.
get_inspection_rule(inspection_rule, fields=None)
Get a specific inspection rule.
Parameters
inspection_ruleโ The ID of an inspection ruleInspectionRule <#openstack.baremetal.v1.inspection_rules.InspectionRule>instance.fieldsโ Limit the resource fields to fetch.
Returns One InspectionRule <#openstack.baremetal.v1.inspection_rules.InspectionRule>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no inspection rule matching the ID could be found.
update_inspection_rule(inspection_rule, **attrs)
Update an inspection rule. ๐
Parameters
inspection_ruleโ Either the ID of an inspection rule or an instance ofInspectionRule <#openstack.baremetal.v1.inspection_rules.InspectionRule>.attrsโ The attributes to update on the inspection rule represented by theinspection_ruleparameter.
Returns The updated inspection rule.
delete_inspection_rule(inspection_rule, ignore_missing=True)
Delete an inspection rule.
Parameters
inspection_ruleโ The value can be either the ID of an inspection rule or aInspectionRule <#openstack.baremetal.v1.inspection_rules.InspectionRule>instance.ignore_missingโ When set toFalse, an exceptionNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the inspection rule could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent inspection rule.
Returns The instance of the inspection rule which was deleted.
patch_inspection_rule(inspection_rule, patch)
Apply a JSON patch to the inspection rule.
Parameters
inspection_ruleโ The value can be the ID of ainspection_ruleor aInspectionRule <#openstack.baremetal.v1.inspection_rules.InspectionRule>instance.patchโ JSON patch to apply.
Returns The updated inspection rule.
Utilities
Building config drives
Helpers for building configdrive compatible with the Bare Metal service. ๐ธ
Baremetal Introspection API
The Baremetal Introspection Proxy
The baremetal introspection high-level interface is available through the baremetal_introspection member of a Connection <#openstack.connection.Connection> object. The baremetal_introspection member will only be added if the service is detected. ๐ฆ
Introspection Process Operations
bestie this proxy class is back and she brought the same iconic signature:
class openstack.baremetal_introspection.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
introspections(**query)
Retrieve a generator of introspection records. ๐
Parameters
queryโ Optional query parameters to be sent to restrict the records to be returned. Available parameters include:fields: A list containing one or more fields to be returned in the response. This may lead to some performance gain because other fields of the resource are not refreshed.limit: Requests at most the specified number of items be returned from the query.marker: Specifies the ID of the last-seen introspection. Use thelimitparameter to make an initial limited request and use the ID of the last-seen introspection from the response as themarkervalue in a subsequent limited request.sort_dir: Sorts the response by the requested sort direction. A valid value isasc(ascending) ordesc(descending). Default isasc. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.sort_key: Sorts the response by the this attribute value. Default isid. You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting direction of the server attribute that is provided as thesort_key.
Returns A generator of Introspection <#openstack.baremetal_introspection.v1.introspection.Introspection> objects
start_introspection(node, manage_boot=None)
Create a new introspection from attributes. ๐
Parameters
nodeโ The value can be either the name or ID of a node or aNode <#openstack.baremetal.v1.node.Node>instance.manage_bootโ Whether to manage boot parameters for the node. Defaults to the server default (which isTrue).
Returns Introspection <#openstack.baremetal_introspection.v1.introspection.Introspection> instance.
get_introspection(introspection)
Get a specific introspection.
Parameters
introspectionโ The value can be the name or ID of an introspection (matching bare metal node name or ID) or anIntrospection <#openstack.baremetal_introspection.v1.introspection.Introspection>instance.
Returns Introspection <#openstack.baremetal_introspection.v1.introspection.Introspection> instance.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no introspection matching the name or ID could be found.
get_introspection_data(introspection, processed=True)
Get introspection data. โจ
Parameters
introspectionโ The value can be the name or ID of an introspection (matching bare metal node name or ID) or anIntrospection <#openstack.baremetal_introspection.v1.introspection.Introspection>instance.processedโ Whether to fetch the final processed data (the default) or the raw unprocessed data as received from the ramdisk.
Returns introspection data from the most recent successful run.
abort_introspection(introspection, ignore_missing=True)
Abort an introspection.
Note that the introspection is not aborted immediately, you may usewait_for_introspection()withignore_error=True.
Parameters
introspectionโ The value can be the name or ID of an introspection (matching bare metal node name or ID) or anIntrospection <#openstack.baremetal_introspection.v1.introspection.Introspection>instance.- ignore_missing โ when it's set to
False, an exceptionNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the introspection literally cannot be found. Set it toTrueand no exception gets raised when you try to abort an introspection that doesn't exist. Bestie behaviour honestly ๐ - Returns โ nothing. That's it. Nothing. ๐ซ
wait_for_introspection(introspection, timeout=None, ignore_error=False)โ wait for the introspection to finish, like waiting for your iced coffee to be ready but make it bare metal โโจ- Parameters
- introspection โ the value can be the name or ID of an introspection (matching bare metal node name or ID) or an
Introspection <#openstack.baremetal_introspection.v1.introspection.Introspection>instance. - timeout โ how much (in seconds) to wait for the introspection. The value of
None(the default) means no client-side timeout. So like, forever. No cap. โณ - ignore_error โ if
True, this call will raise an exception if the introspection reaches the error state. Otherwise the error state is considered successful and the call returns. Yeah, read that twice, it's giving counterintuitive but we move ๐
- introspection โ the value can be the name or ID of an introspection (matching bare metal node name or ID) or an
- Returns โ an
Introspection <#openstack.baremetal_introspection.v1.introspection.Introspection>instance. ๐ - Raises
ResourceFailure <#openstack.exceptions.ResourceFailure>if introspection fails and ignore_error isFalse. - Raises
ResourceTimeout <#openstack.exceptions.ResourceTimeout>on timeout. ๐ญ
- Parameters
๐งฑ Block Storage API
For details on how to use block_storage, see Using OpenStack Block Storage <>. ๐
The BlockStorage Class
The block_storage high-level interface is available through the block_storage member of a Connection <#openstack.connection.Connection> object. The block_storage member will only be added if the service is detected โ so if it's not there, the service ghosted you, not our fault ๐ซถ
๐พ Backup Operations
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
backups(details=True, **query)โ retrieve a generator of backups ๐ like a little backup vending machine, one at a time- Parameters
- details โ when set to
Falseno additional details will be returned. The default,True, will cause objects with additional attributes to be returned. SoTrue= the deluxe version,False= bare bones โจ - query โ optional query parameters to be sent to limit the resources being returned:
offset: pagination markerlimit: pagination limitsort_key: sorts by an attribute. A valid value isname,status,container_format,disk_format,size,id,created_at, orupdated_at. Default iscreated_at. The API uses the natural sorting direction of thesort_keyattribute value.sort_dir: sorts by one or more sets of attribute and sort direction combinations. If you omit the sort direction in a set, default isdesc.
- details โ when set to
- Returns โ a generator of backup objects. ๐งบ
- Parameters
get_backup(backup)โ get a backup, singular, just the one, main character energy ๐- Parameters
- backup โ the value can be the ID of a backup or a
Backup <#openstack.block_storage.v2.backup.Backup>instance.
- backup โ the value can be the ID of a backup or a
- Returns โ
Backupinstance.
- Parameters
find_backup(name_or_id, ignore_missing=True, *, details=True)โ find a single backup ๐- Parameters
- snapshot โ the name or ID a backup. (Yes, the docs call it snapshot here while the signature says
name_or_id. We don't make the rules, we just report them, iykyk ๐) - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the backup does not exist. - details โ when set to
Falseno additional details will be returned. The default,True, will cause objects with additional attributes to be returned.
- snapshot โ the name or ID a backup. (Yes, the docs call it snapshot here while the signature says
- Returns โ one
Backup <#openstack.block_storage.v2.backup.Backup>. - Raises
NotFoundException <#openstack.exceptions.NotFoundException>when no resource can be found. - Raises
DuplicateResource <#openstack.exceptions.DuplicateResource>when multiple resources are found. Two backups?? Two backups. Pick one, babe ๐ญ
- Parameters
create_backup(**attrs)โ create a new Backup from attributes with native API ๐ฑ- Parameters
- attrs โ keyword arguments which will be used to create a
Backup <#openstack.block_storage.v2.backup.Backup>comprised of the properties on theBackupclass.
- attrs โ keyword arguments which will be used to create a
- Returns โ the results of Backup creation. It's giving new-phone-smell โจ
- Parameters
delete_backup(backup, ignore_missing=True, force=False)โ delete aCloudBackup๐๏ธ- Parameters
- backup โ the value can be the ID of a backup or a
Backup <#openstack.block_storage.v2.backup.Backup>instance - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the zone does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent zone. (Yes, "zone" โ that's what it says. Copy-paste trauma is real ๐) - force โ whether to try forcing backup deletion. Use with intent, bestie โ ๏ธ
- backup โ the value can be the ID of a backup or a
- Returns โ
None
- Parameters
import_backup(service, url)โ create a new backup from an external service ๐ฅ- Parameters
- service โ the service used to perform the backup.
- url โ an identifier string to locate the backup.
- Returns โ the imported backup ๐
- Parameters
export_backup(backup)โ export information about a backup ๐ค- Parameters
- backup โ the value can be the ID of a backup or a
Backup <#openstack.block_storage.v2.backup.Backup>instance.
- backup โ the value can be the ID of a backup or a
- Returns โ the backup export record fields.
- Parameters
restore_backup(backup, volume=None, name=None)โ restore a Backup to volume, the comeback arc we love to see ๐ฆ- Parameters
- backup โ the value can be the ID of a backup or a
Backup <#openstack.block_storage.v2.backup.Backup>instance - volume โ an ID or
Volumeinstance of the volume to restore the backup to. - name โ the name for new volume creation to restore.
- backup โ the value can be the ID of a backup or a
- Returns โ updated backup instance.
- Parameters
reset_backup_status(backup, status)โ reset status of the backup ๐- Parameters
- backup โ the value can be either the ID of a backup or a
Backup <#openstack.block_storage.v2.backup.Backup>instance. - status โ new backup status.
- backup โ the value can be either the ID of a backup or a
- Returns โ
None
- Parameters
๐ง Capabilities Operations
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_capabilities(host)โ get a backend's capabilites ๐ (that's how it's spelled here, oneishort of greatness, but she still serves)- Parameters
- host โ specified backend to obtain volume stats and properties.
- Returns โ one
:class: ~openstack.block_storage.v2.capabilites.Capabilitiesinstance. - Raises
NotFoundException <#openstack.exceptions.NotFoundException>when no resource can be found. ๐ป
- Parameters
๐ซ Consistency Group Operations
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_consistency_group(consistency_group)โ grabs you exactly one consistency group, no more no less ๐- consistency_group โ the value can be either the ID of a consistency group or a
ConsistencyGroup <#openstack.block_storage.v2.consistency_group.ConsistencyGroup>instance. Either one works, she's flexible like that โจ - Returns: one
ConsistencyGroup <#openstack.block_storage.v2.consistency_group.ConsistencyGroup>.
- consistency_group โ the value can be either the ID of a consistency group or a
find_consistency_group(name_or_id, ignore_missing=True, *, details=True)โ hunts down a single consistency group for you ๐- name_or_id โ the name or ID of a consistency group.
- ignore_missing โ when set to
False,ResourceNotFound <#openstack.exceptions.ResourceNotFound>will be raised when the consistency group does not exist. Default isTrue, so she just shrugs ๐ - details โ when set to
False, no additional details will be returned. The default,True, will cause additional details to be returned. - Returns: one
ConsistencyGroup <#openstack.block_storage.v2.consistency_group.ConsistencyGroup>orNone. - Raises
ResourceNotFound <#openstack.exceptions.ResourceNotFound>when no resource can be found. - Raises
DuplicateResource <#openstack.exceptions.DuplicateResource>when multiple resources are found. (Yeah, more than one match is a whole situation ๐ญ)
consistency_groups(*, details=True, **query)โ hands you back a generator of consistency groups, like a little queue of them ๐ง- details โ when set to
False, no additional details will be returned. The default,True, will cause additional details to be returned. - query โ optional query parameters to be sent to limit the resources being returned:
limit: Returns a number of items up to the limit value.offset: Used in conjunction withlimitto return a slice of items. Specifies where to start in the list.marker: The ID of the last-seen item.sort_dir: Sorts the response in the requested order.sort_key: Sorts the list of consistency groups by the specified attribute.
- Returns: a generator of consistency group objects.
- details โ when set to
create_consistency_group(**attrs)โ builds you a brand new consistency group, periodt ๐- attrs โ keyword arguments which will be used to create a
ConsistencyGroup <#openstack.block_storage.v2.consistency_group.ConsistencyGroup>, comprised of the properties on theConsistencyGroupclass. - Returns: the result of consistency group creation.
- attrs โ keyword arguments which will be used to create a
create_consistency_group_from_source(*, consistency_group_snapshot=None, consistency_group=None, name=None, description=None)โ makes a new consistency group from a source, iykyk ๐ฅ- consistency_group_snapshot โ the value can be either the ID of a consistency group snapshot or a
ConsistencyGroupSnapshot <#openstack.block_storage.v2.consistency_group_snapshot.ConsistencyGroupSnapshot>instance. Either this or consistency_group must be provided. Pick one bestie, not neither ๐ - consistency_group โ the value can be either the ID of a consistency group or a
ConsistencyGroup <#openstack.block_storage.v2.consistency_group.ConsistencyGroup>instance. Either this or consistency_group_snapshot must be provided. - name โ the name to assign to the new consistency group.
- description โ the description to set on the new consistency group.
- Returns: the result of consistency group creation.
- consistency_group_snapshot โ the value can be either the ID of a consistency group snapshot or a
delete_consistency_group(consistency_group, force=False)โ bye bye consistency group ๐- consistency_group โ the value can be either the ID of a consistency group or a
ConsistencyGroup <#openstack.block_storage.v2.consistency_group.ConsistencyGroup>instance. - force โ when set to
True, volumes in the consistency group will also be deleted when the consistency group is deleted. Like, the volumes go too. Be so sure before you flip this one ๐ซถ - Returns:
None
- consistency_group โ the value can be either the ID of a consistency group or a
update_consistency_group(consistency_group, **attrs)โ updates a consistency group, glow-up edition โจ- consistency_group โ the value can be either the ID of a consistency group or a
ConsistencyGroup <#openstack.block_storage.v2.consistency_group.ConsistencyGroup>instance. - attrs โ the attributes to update on the consistency group represented by consistency_group. To add or remove volumes, pass
add_volumesorremove_volumesas comma-separated lists of volume IDs. ๐ - Returns: the updated consistency group.
- consistency_group โ the value can be either the ID of a consistency group or a
๐ฆ Consistency Group Snapshot Operations ๐ฆ
Hot girl class signature incoming, here's the whole Proxy joint, untouched, every parameter present and accounted for ๐
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_consistency_group_snapshot(consistency_group_snapshot)โ gets you one consistency group snapshot ๐ธ- consistency_group_snapshot โ the value can be either the ID of a consistency group snapshot or a
ConsistencyGroupSnapshot <#openstack.block_storage.v2.consistency_group_snapshot.ConsistencyGroupSnapshot>instance. - Returns: one
ConsistencyGroupSnapshot <#openstack.block_storage.v2.consistency_group_snapshot.ConsistencyGroupSnapshot>
- consistency_group_snapshot โ the value can be either the ID of a consistency group snapshot or a
find_consistency_group_snapshot(name_or_id, ignore_missing=True, *, details=True)โ finds a single consistency group snapshot, lowkey detective mode ๐ต๏ธโโ๏ธ- name_or_id โ the name or ID of a consistency group snapshot.
- ignore_missing โ when set to
False,ResourceNotFound <#openstack.exceptions.ResourceNotFound>will be raised when the consistency group snapshot does not exist. - details โ when set to
False, no additional details will be returned. The default,True, will cause additional details to be returned. - Returns: one
ConsistencyGroupSnapshot <#openstack.block_storage.v2.consistency_group_snapshot.ConsistencyGroupSnapshot>orNone. - Raises
ResourceNotFound <#openstack.exceptions.ResourceNotFound>when no resource can be found. - Raises
DuplicateResource <#openstack.exceptions.DuplicateResource>when multiple resources are found.
consistency_group_snapshots(*, details=True, **query)โ generator of consistency group snapshots, come get your snacks ๐- details โ when set to
False, no additional details will be returned. The default,True, will cause additional details to be returned. - query โ optional query parameters to be sent to limit the resources being returned:
limit: Returns a number of items up to the limit value.offset: Used in conjunction withlimitto return a slice of items. Specifies where to start in the list.marker: The ID of the last-seen item.
- Returns: a generator of consistency group snapshot objects.
- details โ when set to
create_consistency_group_snapshot(**attrs)โ makes a fresh consistency group snapshot ๐- attrs โ keyword arguments which will be used to create a
ConsistencyGroupSnapshot <#openstack.block_storage.v2.consistency_group_snapshot.ConsistencyGroupSnapshot>, comprised of the properties on theConsistencyGroupSnapshotclass. Theconsistencygroup_idattribute is required โ don't forget it, bestie, fr fr โ ๏ธ - Returns: the result of consistency group snapshot creation.
- attrs โ keyword arguments which will be used to create a
delete_consistency_group_snapshot(consistency_group_snapshot, ignore_missing=True)โ deletes a consistency group snapshot ๐- Parameters
consistency_group_snapshotโ fr you can pass either the ID of a consistency group snapshot or an actualConsistencyGroupSnapshotinstance (that'sopenstack.block_storage.v2.consistency_group_snapshot.ConsistencyGroupSnapshotif you're being formal ๐ ).ignore_missingโ okay so when you set this toFalse, it's gonna raiseResourceNotFound(openstack.exceptions.ResourceNotFound) the moment the consistency group snapshot doesn't exist. Set itTrueand it justโฆ doesn't. Chill.
Returns
None. That's it. Nothing to see here bestie โจ
๐ฆ Extension Operations ๐ฆ
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
extensions()
Returns a generator of extensions ๐ (yes, it literally returns "A generator of extension" โ that's the documented return, no cap).
Returns
A generator of extension.
๐ Limits Operations ๐
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_limits(project=None)
Retrieves limits. Slay, get your ceilings ๐
Parameters
projectโ a project to get limits for. You can pass either the ID of a project or aProjectinstance.
Returns
A Limits object, and it's giving both AbsoluteLimit (openstack.block_storage.v2.limits.AbsoluteLimit) and RateLimit (openstack.block_storage.v2.limits.RateLimit) ๐
๐ QoSSpec Operations ๐
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_qos_spec(**attrs)
Create a new QoS Spec out of attributes. Main character creation moment โจ
Parameters
attrsโ keyword arguments used to create aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec), and they're comprised of the properties on theQoSSpecclass.
Returns
The results of a QoS spec creation.
Return type
QoSSpec (openstack.block_storage.v2.qos_spec.QoSSpec)
delete_qos_spec(qos_spec, ignore_missing=True, *, force=False)
Delete a QoS Spec. Bye bestie ๐
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.ignore_missingโ when set toFalse,ResourceNotFound(openstack.exceptions.ResourceNotFound) gets raised when the type does not exist. When set toTrue, no exception is set when attempting to delete a nonexistent type.forceโ whether to delete the QoS spec even if it's in use. โ ๏ธ Yes, even if it's in use. Be so serious rn.
Returns
None
update_qos_spec(qos_spec, **attrs)
Update a QoS spec. Glow-up time ๐
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.attrs(dict) โ the attributes to update on the QoS spec.
Returns
The updated QoS spec.
Return type
QoSSpec (openstack.block_storage.v2.qos_spec.QoSSpec)
get_qos_spec(qos_spec)
Get a single QoS spec. Just one. The chosen one ๐ซถ
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.
Returns
One QoSSpec (openstack.block_storage.v2.qos_spec.QoSSpec)
Raises ResourceNotFound (openstack.exceptions.ResourceNotFound) when no resource can be found. ๐ญ
find_qos_spec(name_or_id, ignore_missing=True, **query)
Find a single QoS spec. Detective era ๐
Parameters
name_or_idโ the name or ID of a QoS spec.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) gets raised when the resource does not exist. When set toTrue,Noneis returned when attempting to find a nonexistent resource.queryโ additional attributes like'host'.
Returns
One: class:~openstack.block_storage.v2.qos_spec.QoSSpec or None
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
Raises DuplicateResource (openstack.exceptions.DuplicateResource) when multiple resources are found. ๐ yeah, more than one match and it's over.
qos_specs(**query)
Return a generator of QoS specs. The whole squad ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of QoSSpec objects.
associate_qos_spec(qos_spec, vol_type_id)
Associate a QoS spec with a volume type. Matching them up, iykyk ๐
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.vol_type_idโ the ID of the volume type to associate with.
Returns
None
disassociate_qos_spec(qos_spec, vol_type_id)
Disassociate a QoS spec from a volume type. Irreconcilable differences ๐
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.vol_type_idโ the ID of the volume type to disassociate from.
Returns
None
disassociate_all_qos_spec(qos_spec)
Disassociate a QoS spec from all volume types. Blocking everyone, periodt ๐ซ
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.
Returns
None
delete_qos_spec_metadata(qos_spec, keys)
Delete metadata from a QoS spec. Decluttering ๐งนโจ
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.keysโ the keys to delete from the QoS spec.
Returns
None
qos_spec_associations(qos_spec)
Return a generator of associations for a QoS spec. Who's linked with who ๐
Parameters
qos_specโ either the ID of a QoS spec or aQoSSpec(openstack.block_storage.v2.qos_spec.QoSSpec) instance.
Returns
A generator of QoSSpecAssociation (openstack.block_storage.v2.qos_spec.QoSSpecAssociation) objects.
โญ QuotaClassSet Operations โญ
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_quota_class_set(quota_class_set='default')โ grab a single quota class set โจ
Literally only one quota class is allowed here, bestie: default. That's it. That's the whole list.
Parameters
quota_class_setโ can be the ID of a quota class set (and again: onlydefaultis supported) or aQuotaClassSet <#openstack.block_storage.v2.quota_class_set.QuotaClassSet>instance.
Returns โ one QuotaClassSet <#openstack.block_storage.v2.quota_class_set.QuotaClassSet> ๐
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_quota_class_set(quota_class_set, **attrs)โ update aQuotaClassSet๐
Again โ only one quota class permitted, default. No cap.
Parameters
quota_class_setโ either the ID of a quota class set (onlydefaultis supported) or aQuotaClassSet <#openstack.block_storage.v2.quota_class_set.QuotaClassSet>instance.attrsโ the attributes to update on theQuotaClassSetrepresented byquota_class_set.
Returns โ the updated QuotaSet
๐ธ QuotaSet Operations ๐ธ
class openstack.block_storage.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_quota_set(project, usage=False, **query)โ showQuotaSetinfo for the project ๐
Parameters
projectโ ID or instance ofProjectof the project for which the quota should be retrievedusageโ when set toTrue, quota usage and reservations would be filled. (yes please, give us the receipts ๐งพ)queryโ additional query parameters to use.
Returns โ one QuotaSet <#openstack.block_storage.v2.quota_set.QuotaSet>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
get_quota_set_defaults(project)โ showQuotaSetdefaults for the project โจ
Parameters
projectโ ID or instance ofProjectof the project for which the quota should be retrieved
Returns โ one QuotaSet <#openstack.block_storage.v2.quota_set.QuotaSet>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
revert_quota_set(project, **query)โ reset quota for the project/user ๐
Parameters
projectโ ID or instance ofProjectof the project for which the quota should be resetted. (their spelling, not mine, ily ๐ )queryโ additional parameters to be used.
Returns โ None
update_quota_set(project, **attrs)โ update aQuotaSet๐ฆ
Parameters
projectโ ID or instance ofProjectof the project for which the quota should be reset.attrsโ the attributes to update on theQuotaSetrepresented byquota_set.
Returns โ the updated QuotaSet
๐ฅ Service Operations ๐ฅ
class openstack.block_storage.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
find_service(name_or_id, ignore_missing=True, **query)โ find a single service ๐
Parameters
name_or_idโ the name or ID of a serviceignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ additional attributes like'host'
Returns โ one: class:~openstack.block_storage.v2.service.Service or None
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises โ DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
services(**query)โ return a generator of service ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of Service objects
enable_service(service)โ enable a service ๐
Parameters
serviceโ either the ID of a service or aService <#openstack.block_storage.v2.service.Service>instance.
Returns โ updated service instance
disable_service(service, *, reason=None)โ disable a service ๐
Parameters
serviceโ either the ID of a service or aService <#openstack.block_storage.v2.service.Service>instancereasonโ the reason to disable a service
Returns โ updated service instance
thaw_service(service)โ thaw a service ๐ค๏ธ
Parameters
serviceโ either the ID of a service or aService <#openstack.block_storage.v2.service.Service>instance
Returns โ updated service instance
freeze_service(service)โ freeze a service ๐ง
Parameters
serviceโ either the ID of a service or aService <#openstack.block_storage.v2.service.Service>instance
Returns โ updated service instance
failover_service(service, *, backend_id=None)โ failover a service ๐จ
Only applies to replicating cinder-volume services. (iykyk โ this one's niche and we respect it)
Parameters
serviceโ either the ID of a service or aService <#openstack.block_storage.v2.service.Service>instance
Returns โ updated service instance
๐ฆ Snapshot Operations ๐ฆ
class openstack.block_storage.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_snapshot(snapshot)โ get a single snapshot ๐ธ
Parameters
snapshotโ the value can be the ID of a snapshot or aSnapshot <#openstack.block_storage.v2.snapshot.Snapshot>instance.
Returns โ one Snapshot <#openstack.block_storage.v2.snapshot.Snapshot>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
find_snapshot(name_or_id, ignore_missing=True, *, details=True, all_projects=False)โ find a single snapshot ๐
Parameters
snapshotโ the name or ID a snapshotignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the snapshot does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.detailsโ when set toFalse, anSnapshot <#openstack.block_storage.v2.snapshot.Snapshot>object will be returned. The default,True, will cause anSnapshotDetail <#openstack.block_storage.v2.snapshot.SnapshotDetail>object to be returned.
all_projectsโ when you set this toTrue, it searches for the snapshot by name across all projects. Heads up though: this lowkey makes duplicates way more likely. Admin-only by default, no cap. ๐
Returns ๐ซ
One Snapshot (openstack.block_storage.v2.snapshot.Snapshot), one SnapshotDetail (openstack.block_storage.v2.snapshot.SnapshotDetail) object, or None. That's it, that's the whole menu.
Raises ๐ญ
Raises NotFoundException (openstack.exceptions.NotFoundException) when literally no resource can be found โ like, nothing there bestie.
Raises DuplicateResource (openstack.exceptions.DuplicateResource) when it finds multiple resources. Too many options, honestly relatable. ๐
snapshots(*, details=True, all_projects=False, **query) โ retrieve a generator of snapshots โจ
Parameters ๐
detailsโ set it toFalseand you get plainSnapshot(openstack.block_storage.v2.snapshot.Snapshot) objects back. The default,True, gives youSnapshotDetail(openstack.block_storage.v2.snapshot.SnapshotDetail) objects instead. Fancy version unlocked by default, periodt. ๐all_projectsโ set toTrueand it lists snapshots from all projects. Admin-only by default. ๐queryโ optional query params you can send to narrow down which snapshots come back. The available ones are:name: name of the snapshot, as a string.volume_id: volume id of a snapshot.status: the snapshot's status value, so you can filter on"available"for example. iykyk.
Returns ๐ซ
A generator of snapshot objects. A whole little stream of them. ๐
create_snapshot(**attrs) โ make a brand new snapshot out of attributes ๐ธ
Parameters ๐
attrsโ keyword arguments that get used to create aSnapshot(openstack.block_storage.v2.snapshot.Snapshot), made up of the properties on the Snapshot class. Basically you're handing it the whole vibe. ๐
Returns ๐ซ
The results of snapshot creation. Fresh out the oven. ๐ฅ
update_snapshot(snapshot, **attrs) โ update a snapshot ๐ฆ
Parameters ๐
snapshotโ either the ID of a snapshot or aSnapshot(openstack.block_storage.v2.snapshot.Snapshot) instance. ID or object, dealer's choice. โจattrsโ the attributes you want to update on the snapshot.
Returns ๐ซ
The updated snapshot. Glow-up complete. ๐
delete_snapshot(snapshot, ignore_missing=True, force=False) โ delete a snapshot ๐๏ธ
Parameters ๐
snapshotโ the value can be either the ID of a snapshot or aSnapshot(openstack.block_storage.v2.snapshot.Snapshot) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) gets raised when the snapshot doesn't exist. When set toTrue, no exception is set when you attempt to delete a nonexistent snapshot. It just kinda shrugs. ๐forceโ whether to try forcing snapshot deletion. Forceful. ๐
Returns ๐ซ
None. That's it. Bye bestie. ๐ซถ
reset_snapshot_status(snapshot, status) โ reset the status of the snapshot ๐
Parameters ๐
snapshotโ the value can be either the ID of a backup or aSnapshot(openstack.block_storage.v2.snapshot.Snapshot) instance. (Yep, it says "backup" up there in the original โ quoting it exactly, don't come for me. ๐)statusโ the new snapshot status.
Returns ๐ซ
None.
manage_snapshot(**attrs) โ creates a snapshot by using existing storage rather than allocating new storage. Sustainable queen behaviour, we love to see it. ๐ฑ๐
Parameters ๐
attrsโ keyword arguments used to create aSnapshot(openstack.block_storage.v2.snapshot.Snapshot), comprised of the properties on the Snapshot class.
Returns ๐ซ
The results of snapshot creation.
unmanage_snapshot(snapshot) โ unmanage a snapshot from block storage provisioning ๐ช
Parameters ๐
snapshotโ either the ID of a snapshot or aSnapshot(openstack.block_storage.v2.snapshot.Snapshot).
Returns ๐ซ
None.
fetch_snapshot_metadata(snapshot) โ return a dictionary of metadata for a snapshot ๐
Parameters ๐
snapshotโ either the ID of a snapshot or aSnapshot(openstack.block_storage.v2.snapshot.Snapshot).
Returns ๐ซ
A Snapshot (openstack.block_storage.v2.snapshot.Snapshot) carrying the snapshot's metadata. All keys and values are Unicode text. ๐
get_snapshot_metadata(snapshot) โ return a dictionary of metadata for a snapshot ๐
โ ๏ธ Deprecated since version4.14.0: usefetch_snapshot_metadata()instead. She's retired, don't @ her. ๐
set_snapshot_metadata(snapshot, **metadata) โ update metadata for a snapshot โ๏ธ
Parameters ๐
snapshotโ either the ID of a snapshot or aSnapshot(openstack.block_storage.v2.snapshot.Snapshot).metadataโ key/value pairs to be updated in the snapshot's metadata. No other metadata is modified by this call โ everything else stays untouched, we respect boundaries here. ๐ All keys and values are stored as Unicode.
Returns ๐ซ
A Snapshot (openstack.block_storage.v2.snapshot.Snapshot) with the snapshot's metadata. All keys and values are Unicode text.
delete_snapshot_metadata(snapshot, keys=None) โ delete metadata for a snapshot ๐งน
Parameters ๐
snapshotโ either the ID of a snapshot or aSnapshot(openstack.block_storage.v2.snapshot.Snapshot).keysโ the keys to delete. If you omit it, all metadata is removed. Scorched earth, no survivors. ๐ฅ
Returns ๐ซ
None.
๐ Stats Operations ๐
Our girlypop proxy class, in all her glory:
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
backend_pools(**query) โ returns a generator of cinder Back-end storage pools ๐โโ๏ธ
Parameters ๐
queryโ optional query parameters to send along to limit the resources being returned.
:returns A generator of cinder Back-end storage pools objects. So many pools. ๐
๐ Transfer Operations ๐
Same iconic proxy signature, copy-pasted by the universe:
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_transfer(**attrs) โ create a new Transfer record ๐
Parameters ๐
volume_idโ the value is the ID of the volume.nameโ the value is the name of the transfer.attrsโ keyword arguments used to create aTransfer(openstack.block_storage.v2.transfer.Transfer) comprised of the properties on the Transfer class.
Returns ๐ซ
The results of Transfer creation.
delete_transfer(transfer, ignore_missing=True) โ delete a volume transfer ๐๏ธ
Parameters ๐
transferโ the value can be either the ID of a transfer or aTransferinstance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) gets raised when the transfer doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent transfer. Chill mode: activated. ๐
Returns ๐ซ
None.
find_transfer(name_or_id, ignore_missing=True) โ find a single transfer ๐
Parameters ๐
name_or_idโ the name or ID of a transfer.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the volume transfer does not exist.
Returns โ One Transfer <#openstack.block_storage.v2.transfer.Transfer> ๐
Raises
NotFoundException <#openstack.exceptions.NotFoundException>when no resource can be found.DuplicateResource <#openstack.exceptions.DuplicateResource>when multiple resources are found. ๐ญ
get_transfer(transfer) โจ
Get a single transfer.
Parameters
transferโ The value can be the ID of a transfer or aTransfer <#openstack.block_storage.v2.transfer.Transfer>instance.
Returns โ One Transfer <#openstack.block_storage.v2.transfer.Transfer>.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
transfers(*, details=True, all_projects=False, **query) ๐ฆ
Retrieve a generator of transfers.
Parameters
detailsโ When set toFalseno extended attributes will be returned. The default,True, will cause objects with additional attributes to be returned.all_projectsโ When set toTrue, list transfers from all projects. Admin-only by default.queryโ Optional query parameters to be sent to limit the transfers being returned.
Returns โ A generator of transfer objects.
accept_transfer(transfer, auth_key) ๐
Accept a Transfer.
Parameters
transferโ The value can be the ID of a transfer or aTransfer <#openstack.block_storage.v2.transfer.Transfer>instance.auth_keyโ The key to authenticate volume transfer.
Returns โ The results of Transfer creation.
Type Operations ๐
Meet the proxy class โ signature copied exactly, no cap:
class openstack.block_storage.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_type(type) ๐ธ
Get a single type.
Parameters
typeโ The value can be the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.
Returns โ One Type <#openstack.block_storage.v2.type.Type>.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
find_type(name_or_id, ignore_missing=True) ๐
Find a single volume type.
Parameters
snapshotโ The name or ID a volume type. (Yes, the signature saysname_or_idand this bullet sayssnapshotโ keep both in your brain, bestie. ๐ญ)ignore_missingโ When set toFalseResourceNotFound <#openstack.exceptions.ResourceNotFound>will be raised when the volume type does not exist.
Returns โ One Type <#openstack.block_storage.v2.type.Type>.
Raises
ResourceNotFound <#openstack.exceptions.ResourceNotFound>when no resource can be found.DuplicateResource <#openstack.exceptions.DuplicateResource>when multiple resources are found.
types(**query) ๐ฆ
Retrieve a generator of volume types.
Returns โ A generator of volume type objects.
create_type(**attrs) โจ
Create a new type from attributes.
Parameters
attrsโ Keyword arguments which will be used to create aType <#openstack.block_storage.v2.type.Type>, comprised of the properties on the Type class.
Returns โ The results of type creation.
delete_type(type, ignore_missing=True) ๐
Delete a type.
Parameters
typeโ The value can be either the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.ignore_missingโ When set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the type does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent type.
Returns โ None.
update_type(type, **attrs) ๐ฅ
Update a type.
Parameters
typeโ The value can be either the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.attrsโ The attributes to update on the type.
Returns โ The updated type.
update_type_extra_specs(type, **attrs) ๐
Update the extra_specs for a type.
Parameters
typeโ The value can be either the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.attrsโ The extra spec attributes to update on the type.
Returns โ A dict containing updated extra_specs.
delete_type_extra_specs(type, keys) ๐
Delete the extra_specs for a type.
Note: This method will do a HTTP DELETE request for every key in keys.
Parameters
typeโ The value can be either the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.keysโ The keys to delete.
Returns โ None.
get_type_access(type) ๐
Lists project IDs that have access to private volume type.
Parameters
typeโ The value can be either the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.
Returns โ List of dictionaries describing projects that have access to the specified type.
add_type_access(type, project) ๐ซถ
Adds private volume type access to a project.
Parameters
typeโ The value can be either the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.projectโ An ID or Project instance of the project to add access for.
Returns โ None.
remove_type_access(type, project) ๐
Remove private volume type access from a project.
Parameters
typeโ The value can be either the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.projectโ An ID or Project instance of the project to remove access for.
Returns โ None.
get_type_encryption(volume_type) ๐ง
Get the encryption details of a volume type.
Parameters
volume_typeโ The value can be the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.
Returns โ One TypeEncryption.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
create_type_encryption(volume_type, **attrs) ๐
Create new type encryption from attributes.
Parameters
volume_typeโ The value can be the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance.attrsโ Keyword arguments which will be used to create aTypeEncryption, comprised of the properties on theTypeEncryptionclass.
Returns โ The results of type encryption creation.
delete_type_encryption(encryption=None, volume_type=None, ignore_missing=True) ๐
Delete type encryption attributes.
Parameters
encryptionโ The value can beNoneor aTypeEncryptioninstance. IfencryptionisNonethenvolume_typemust be specified.volume_typeโ The value can be the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance. Required ifencryptionisNone.ignore_missingโ When set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the type does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent type.
Returns โ None.
update_type_encryption(encryption=None, volume_type=None, **attrs) ๐
Update a type.
Parameters
encryptionโ The value can beNoneor aTypeEncryptioninstance. If this isNonethenvolume_typemust be specified.volume_typeโ The value can be the ID of a type or aType <#openstack.block_storage.v2.type.Type>instance. Required ifencryptionisNone.attrsโ The attributes to update on the type encryption.
Returns โ the updated type encryption โจ
๐พ Volume Operations ๐พ
Okay bestie, this is the volume proxy class. Hereโs the constructor signature, copied exactly, no edits, no cap:
class openstack.block_storage.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_volume(volume)
Get a single volume ๐.
Parameters
volumeโ The value can be the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.
Returns โ One Volume <#openstack.block_storage.v2.volume.Volume> ๐
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
find_volume(name_or_id, ignore_missing=True, *, details=True, all_projects=False)
Find a single volume ๐ฆ.
Parameters
volumeโ The name or ID a volume.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the volume does not exist.detailsโ When set toFalse, no extended attributes will be returned. The default,True, will cause an object with additional attributes to be returned.all_projectsโ When set toTrue, search for volume by name across all projects. Note that this will likely result in a higher chance of duplicates. Admin-only by default.
Returns โ One Volume <#openstack.block_storage.v2.volume.Volume> or None.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises โ DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
volumes(*, details=True, all_projects=False, **query)
Retrieve a generator of volumes ๐ธ.
Parameters
detailsโ When set toFalse, no extended attributes will be returned. The default,True, will cause objects with additional attributes to be returned.all_projectsโ When set toTrue, list volumes from all projects. Admin-only by default.queryโ Optional query parameters to be sent to limit the volumes being returned. Available parameters include:name: Name of the volume as a string.status: Value of the status of the volume so that you can filter on"available"for example.
Returns โ A generator of volume objects.
create_volume(**attrs)
Create a new volume from attributes ๐.
Parameters
attrsโ Keyword arguments which will be used to create aVolume <#openstack.block_storage.v2.volume.Volume>, comprised of the properties on theVolumeclass.
Returns โ The results of volume creation.
update_volume(volume, **attrs)
Update a volume ๐ .
Parameters
volumeโ Either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.attrsโ The attributes to update on the volume.
Returns โ The updated volume.
delete_volume(volume, ignore_missing=True, *, force=False, cascade=False)
Delete a volume ๐ญ.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the volume does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent volume.forceโ Whether to try forcing volume deletion.cascadeโ Whether to remove any snapshots along with the volume.
Returns โ None.
extend_volume(volume, size)
Extend a volume ๐ฅ.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.sizeโ New volume size.
Returns โ None.
set_volume_readonly(volume, readonly=True)
Set a volumeโs read-only flag ๐ซถ.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.readonlyโ Whether the volume should be a read-only volume or not.
Returns โ None.
retype_volume(volume, new_type, migration_policy='never')
Retype the volume ๐.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.new_typeโ The new volume type that volume is changed with. The value can be either the ID of the volume type or aType <#openstack.block_storage.v2.type.Type>instance.migration_policyโ Specify if the volume should be migrated when it is re-typed. Possible values areon-demandornever. Default:never.
Returns โ None.
set_volume_bootable_status(volume, bootable)
Set bootable status of the volume โญ.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.bootableโ Specifies whether the volume should be bootable or not.
Returns โ None.
set_volume_image_metadata(volume, **metadata)
Update image metadata for a volume ๐ฆ.
Parameters
volumeโ Either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>.metadataโ Key/value pairs to be updated in the volumeโs image metadata. No other metadata is modified by this call.
Returns โ None.
delete_volume_image_metadata(volume, keys=None)
Delete metadata for a volume ๐ง.
Parameters
volumeโ Either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>.keysโ The keys to delete. If omitted, all metadata is removed.
Returns โ None.
reset_volume_status(volume, status=None, attach_status=None, migration_status=None)
Reset volume statuses ๐.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.statusโ The new volume status.attach_statusโ The new volume attach status.migration_statusโ The new volume migration status (admin only).
Returns โ None.
attach_volume(volume, mountpoint, instance=None, host_name=None)
Attaches a volume to a server ๐.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.mountpointโ The attaching mount point.instanceโ The UUID of the attaching instance.host_nameโ The name of the attaching host.
Returns โ None.
detach_volume(volume, attachment, force=False, connector=None)
Detaches a volume from a server ๐ซถ.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.attachmentโ The ID of the attachment.forceโ Whether to force volume detach (Rolls back an unsuccessful detach operation after you disconnect the volume.)connectorโ The connector object.
Returns โ None
unmanage_volume(volume)
This one removes a volume from Block Storage management without removing the back-end storage object thatโs associated with it. Bestie, itโs giving โbreak up but keep the shared Netflix passwordโ ๐
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.
Returns โ None
migrate_volume(volume, host=None, force_host_copy=False, lock_volume=False)
Migrates a volume to the specified host. Moving day for your volume โจ
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.hostโ The target host for the volume migration. Host format is<host@backend>.force_host_copyโ If false (the default), rely on the volume backend driver to perform the migration, which might be optimized. If true, or the volume driver fails to migrate the volume itself, a generic host-based migration is performed.lock_volumeโ If true, migrating an available volume will change its status to maintenance preventing other operations from being performed on the volume such as attach, detach, retype, etc.
Returns โ None
complete_volume_migration(volume, new_volume, error=False)
Complete the migration of a volume. The final โweโre hereโ moment ๐
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>instance.new_volumeโ The UUID of the new volume.errorโ Used to indicate if an error has occurred elsewhere that requires clean up.
Returns โ None
upload_volume_to_image(volume, image_name, force=False, disk_format=None, container_format=None)
Uploads the specified volume to image service. Glow-up arc: volume edition ๐ฅ
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v3.volume.Volume>instance.image_nameโ The name for the new image.forceโ Enables or disables upload of a volume that is attached to an instance.disk_formatโ Disk format for the new image.container_formatโ Container format for the new image.
Returns โ dictionary describing the image.
fetch_volume_metadata(volume)
Return a dictionary of metadata for a volume. All the little deets ๐
Parameters
volumeโ Either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>.
Returns โ A Volume <#openstack.block_storage.v2.volume.Volume> with the volume's metadata. All keys and values are Unicode text.
get_volume_metadata(volume)
Return a dictionary of metadata for a volume
Deprecated since version 4.14.0: Use fetch_volume_metadata() instead. Sheโs retired, bestie โ still iconic, but retired ๐
set_volume_metadata(volume, **metadata)
Update metadata for a volume. Giving your volume a little labels refresh โจ
Parameters
volumeโ Either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>.metadataโ Key/value pairs to be updated in the volume's metadata. No other metadata is modified by this call. All keys and values are stored as Unicode.
Returns โ A Volume <#openstack.block_storage.v2.volume.Volume> with the volume's metadata. All keys and values are Unicode text.
delete_volume_metadata(volume, keys=None)
Delete metadata for a volume. Clean sweep, no crumbs ๐งน
Parameters
volumeโ Either the ID of a volume or aVolume <#openstack.block_storage.v2.volume.Volume>.keysโ The keys to delete. If omitted, all metadata is removed.
Returns โ None
โจ Helpers โจ
class openstack.block_storage.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
wait_for_status(res, status='available', failures=None, interval=2, wait=None, attribute='status', callback=None)
Wait for the resource to be in a particular status. Itโs the โare we there yetโ of API calls ๐ญ
Parameters
sessionโ The session to use for making this request.resourceโ The resource to wait on to reach the status. The resource must have a status attribute specified viaattribute.statusโ Desired status of the resource.failuresโ Statuses that would indicate the transition failed such as'ERROR'. Defaults to['ERROR'].intervalโ Number of seconds to wait between checks.waitโ Maximum number of seconds to wait for transition. Set toNoneto wait forever.attributeโ Name of the resource attribute that contains the status.callbackโ A callback function. This will be called with a single value,progress. This is API specific but is generally a percentage value from 0-100.
Returns โ The updated resource.
Raises โ ResourceTimeout <#openstack.exceptions.ResourceTimeout> if the transition to status failed to occur in wait seconds.
Raises โ ResourceFailure <#openstack.exceptions.ResourceFailure> if the resource transitioned to one of the states in failures.
Raises โ AttributeError if the resource does not have a status attribute
wait_for_delete(res, interval=2, wait=120, callback=None)
Wait for a resource to be deleted. Ghosting, but make it infrastructure ๐
Parameters
resโ The resource to wait on to be deleted.intervalโ Number of seconds to wait before to consecutive checks.waitโ Maximum number of seconds to wait before the change.callbackโ A callback function. This will be called with a single value,progress, which is a percentage value from 0-100.
Returns โ The resource is returned on success.
Raises โ ResourceTimeout <#openstack.exceptions.ResourceTimeout> if transition to delete failed to occur in the specified seconds.
๐ฆ Block Storage API ๐ฆ
For details on how to use block_storage, see Using OpenStack Block Storage <>
๐ The BlockStorage Class ๐
The block_storage high-level interface is available through the block_storage member of a Connection <#openstack.connection.Connection> object. The block_storage member will only be added if the service is detected.
๐ธ Attachments ๐ธ
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_attachment(volume, **attrs)
Create a new attachment. New attachment just dropped ๐
This is an internal API and should only be called by services consuming volume attachments like nova, glance, ironic etc.
Parameters
volumeโ The value can be either the ID of a volume or aVolume <#openstack.block_storage.v3.volume.Volume>instance.attrsโ the keyword args you pass in to build aAttachment<#openstack.block_storage.v3.attachment.Attachment>, pulled straight from the properties living on theAttachmentclass โ thinkconnector,instance_id,mode, etc. โจ
Returns โ the results of attachment creation, bestie ๐
get_attachment(attachment) โ grab a single volume ๐
This one is an internal API and should only be called by services that consume volume attachments โ like nova, glance, ironic etc. So like, not your vibe to poke at unless you're one of those, iykyk.
Parameters
- attachment โ the value can be the ID of an attachment or a
Attachmentinstance. ๐
Returns โ one Attachment
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found ๐ญ
attachments(*, details=True, **query) โ returns a generator of attachments ๐ฆ
Also an internal API, only for services consuming volume attachments like nova, glance, ironic etc. no cap.
Parameters
- details โ when it's set to
False, no extended attributes get returned. The default,True, will cause objects with additional attributes to be returned. โญ - query โ optional query parameters sent over to limit the resources being returned.
Returns โ a generator of attachment objects ๐
delete_attachment(attachment, ignore_missing=True) โ delete an attachment ๐
Internal API again โ only called by services consuming volume attachments like nova, glance, ironic etc.
Parameters
- attachment โ the value can be either the ID of an attachment or a
Attachment<#openstack.block_storage.v3.attachment.Attachment> instance. - ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the attachment does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent attachment. ๐
Returns โ None
update_attachment(attachment, **attrs) โ update an attachment โจ
Internal API, only for services consuming volume attachments like nova, glance, ironic etc.
Parameters
- attachment โ the value can be the ID of an attachment or a
Attachment<#openstack.block_storage.v3.attachment.Attachment> instance. - attrs โ keyword arguments which will be used to update a
Attachment<#openstack.block_storage.v3.attachment.Attachment> comprised of the properties on theAttachmentclass.
Returns โ the updated attachment ๐ธ
complete_attachment(attachment) โ complete an attachment ๐
Internal API, and only services consuming volume attachments like nova, glance, ironic etc. should be calling it.
Parameters
- attachment โ the value can be the ID of an attachment or a
Attachment<#openstack.block_storage.v3.attachment.Attachment> instance.
Returns โ None
๐ฆ Availability Zone Operations ๐ฆ
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
availability_zones() โ return a generator of availability zones ๐
Returns โ a generator of availability zone AvailabilityZone <#openstack.block_storage.v3.availability_zone.AvailabilityZone> ๐
๐ธ Backend Pools Operations ๐ธ
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
backend_pools(**query) โ returns a generator of cinder Back-end storage pools ๐
Parameters
- query โ optional query parameters to be sent to limit the resources being returned.
:returns a generator of cinder Back-end storage pools objects ๐ฅ
๐ Backup Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
backups(*, details=True, **query) โ retrieve a generator of backups ๐
Parameters
- details โ when set to
False, no additional details will be returned. The default,True, will cause objects with additional attributes to be returned. โญ - query โ optional query parameters to be sent to limit the resources being returned:
offset: pagination markerlimit: pagination limitsort_key: sorts by an attribute. A valid value isname,status,container_format,disk_format,size,id,created_at, orupdated_at. Default iscreated_at. The API uses the natural sorting direction of thesort_keyattribute value. ๐sort_dir: sorts by one or more sets of attribute and sort direction combinations. If you omit the sort direction in a set, default isdesc.project_id: project ID to query backups for.
Returns โ a generator of backup objects ๐ธ
get_backup(backup) โ get a backup โจ
Parameters
- backup โ the value can be the ID of a backup or a
Backup<#openstack.block_storage.v3.backup.Backup> instance.
Returns โ Backup instance ๐
find_backup(name_or_id, ignore_missing=True, *, details=True) โ find a single backup ๐ฆ
Parameters
- snapshot โ the name or ID a backup ๐ซถ
- ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the backup does not exist. - details โ when set to
False, no additional details will be returned. The default,True, will cause objects with additional attributes to be returned.
Returns โ one Backup <#openstack.block_storage.v3.backup.Backup> ๐
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found ๐ญ
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found ๐ต
create_backup(**attrs) โ create a new Backup from attributes with the native API ๐
Parameters
- attrs โ keyword arguments which will be used to create a
Backup<#openstack.block_storage.v3.backup.Backup> comprised of the properties on theBackupclass.
Returns โ the results of Backup creation ๐
delete_backup(backup, ignore_missing=True, force=False) โ delete a CloudBackup ๐
Parameters
- backup โ the value can be the ID of a backup or a
Backup<#openstack.block_storage.v3.backup.Backup> instance ignore_missingโ bestie, this is the "don't be dramatic" switch. Set it toFalseand aNotFoundExceptiongets raised the second the zone doesn't exist. Set it toTrueand no exception happens at all when you try to delete a zone that was never there. Zero drama, zero noise ๐forceโ whether to try forcing the backup deletion. That's it, that's the whole vibe.
Returns โ None. Nothing back, just vibes โจ
update_backup(backup, **attrs) โ update a backup, glow-up edition ๐ธ
Parameters:
backupโ either the ID of a backup or aBackupinstance.attrsโ the attributes you wanna update on the volume.
Returns โ the updated backup ๐ซถ
fetch_backup_metadata(backup) โ hand over a dictionary of metadata for a backup.
Parameters:
backupโ either the ID of a backup or aBackupinstance.
Returns โ a Backup with the backup's metadata. iykyk ๐
get_backup_metadata(backup) โ same deal, returns a dictionary of metadata for a backup.
Deprecated since version 4.14.0: usefetch_backup_metadata()instead. She's iconic but she's retired, bestie โfetch_backup_metadata()is the main character now ๐
import_backup(service, url) โ create a brand new backup from an external service. literally bringing the backup in from outside ๐ฆ
Parameters:
serviceโ the service used to perform the backup.urlโ an identifier string to locate the backup.
Returns โ the imported backup โญ
export_backup(backup) โ export information about a backup.
Parameters:
backupโ the value can be the ID of a backup or aBackupinstance.
Returns โ the backup export record fields ๐
set_backup_metadata(backup, **metadata) โ update metadata for a backup.
Parameters:
backupโ either the ID of a backup or aBackupinstance.metadataโ key/value pairs to be updated in the backup's metadata. No other metadata is modified by this call โ she only touches what you tell her to touch, no cap ๐
Returns โ a Backup with the backup's metadata.
delete_backup_metadata(backup, keys=None) โ delete metadata for a backup. bye-bye metadata ๐
Parameters:
backupโ either the ID of a backup or aBackupinstance.keysโ the keys to delete. If you omit this, all metadata is removed. all of it. gone. ๐
Returns โ None
restore_backup(backup, volume=None, name=None) โ restore a Backup to a volume. the comeback arc we've been waiting for ๐ฅ
Parameters:
backupโ the value can be the ID of a backup or aBackupinstance.volumeโ an ID orVolumeinstance of the volume to restore the backup to.nameโ the name for new volume creation to restore.
Returns โ updated backup instance ๐
restore_backup(backup, volume=None, name=None) โ (yes she's here again, same signature, same energy)
reset_backup_status(backup, status) โ reset the status of the backup. hitting the reset button, emotionally ๐ง
Parameters:
backupโ the value can be either the ID of a backup or aBackupinstance.statusโ new backup status.
Returns โ None
๐ BlockStorageSummary Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None, endpoint_override=None,
version=None, auth=None, user_agent=None, connect_retries=None, logger=None,
allow=None, additional_headers=None, client_name=None, client_version=None,
allow_version_hack=None, global_request_id=None, min_version=None,
max_version=None, default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None,
connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None,
statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
ok so that exact same constructor signature pops up for every single operation group below โ it's the same Proxy class every time, she just keeps showing up to the party ๐
summary(all_projects, **kwargs) โ get Volumes Summary. This method returns the volumes summary in the deployment โจ
Parameters:
all_projectsโ whether to return the summary of all projects or not.
Returns โ one ~openstack.block_storage.v3.block_storage_summary.Summary instance ๐ฆ
๐ฆ Capabilities Operations ๐ฆ
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None, endpoint_override=None,
version=None, auth=None, user_agent=None, connect_retries=None, logger=None,
allow=None, additional_headers=None, client_name=None, client_version=None,
allow_version_hack=None, global_request_id=None, min_version=None,
max_version=None, default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None,
connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None,
statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_capabilities(host) โ get a backend's capabilites ๐ (yes that spelling, don't come for her)
Parameters:
hostโ specified backend to obtain volume stats and properties.
Returns โ one ~openstack.block_storage.v3.capabilites.Capabilities instance.
Raises โ NotFoundException when no resource can be found. so if she can't find it, she WILL tell you ๐ญ
๐ธ Cluster Operations ๐ธ
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None, endpoint_override=None,
version=None, auth=None, user_agent=None, connect_retries=None, logger=None,
allow=None, additional_headers=None, client_name=None, client_version=None,
allow_version_hack=None, global_request_id=None, min_version=None,
max_version=None, default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None,
connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None,
statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_cluster(cluster) โ get a cluster ๐
Parameters:
clusterโ the value can be the name of a cluster or aClusterinstance.
Returns โ a Cluster instance.
Raises โ NotFoundException when no resource can be found.
find_cluster(name_or_id, ignore_missing=True) โ find a single cluster. one (1) cluster, that's the assignment ๐
Parameters:
name_or_idโ the name or ID of a cluster.ignore_missingโ when set toFalse,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. quiet quitting, but for lookups ๐
Returns โ one Cluster or None.
Raises โ NotFoundException when no resource can be found.
Raises โ DuplicateResource when multiple resources are found. bestie there can only be one ๐
clusters(*, details=True, **query) โ retrieve a generator of clusters. a whole stream of them, slay ๐
Parameters:
detailsโ when set toFalse, no additional details will be returned. The default,True, will cause additional details to be returned.queryโ optional query parameters to be sent to limit the resources being returned:name: filter by cluster name.binary: filter by binary name.is_up: filter by up/down state.disabled: filter by disabled status.num_hosts: filter by number of hosts in the cluster.num_down_hosts: filter by number of down hosts.replication_status: filter by replication status.
Returns โ a generator of cluster objects. ๐ซถ
enable_cluster(cluster) โ enable a cluster. turn her ON โญ
Parameters:
clusterโ either the name of a cluster or aClusterinstance.
Returns โ updated cluster instance.
disable_cluster(cluster, *, reason=None) โ disable a cluster. turn her off, gently ๐
Parameters:
clusterโ either the name of a cluster or aClusterinstance.reasonโ the reason you're disabling the cluster, bestie. Spill it.
Returns โ the updated cluster instance. Fresh off the glow-up. โจ
๐ Consistency Group Operations ๐
Okay so before we get into the methods, here's the class signature, and yes it's long, no I did not make it up, copy it exactly or the vibe check fails:
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐
get_consistency_group(consistency_group)
Grab one (1) consistency group. Like, just the one. We're not greedy.
Parameters
group_snapshotโ ngl the name is a little cursed but this is literally the param: the value can be the ID of a consistency group or aConsistencyGroup<#openstack.block_storage.v3.consistency_group.ConsistencyGroup> instance.
Returns โ a ConsistencyGroup instance. Iconic.
๐ find_consistency_group(name_or_id, ignore_missing=True, *, details=True)
Find a single consistency group. The hunter-gatherer of consistency groups.
Parameters
name_or_idโ the name or ID of a group.ignore_missingโ when set toFalse,ResourceNotFound<#openstack.exceptions.ResourceNotFound> will be raised when the consistency group does not exist. Like, it will snitch.detailsโ when set toFalse, no additional details will be returned. The default,True, will cause additional details to be returned.
Returns โ one ConsistencyGroup <#openstack.block_storage.v3.consistency_group.ConsistencyGroup>
Raises ResourceNotFound <#openstack.exceptions.ResourceNotFound> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found. Two of them?? In this economy??
๐ consistency_groups(*, details=True, **query)
Retrieve a generator of consistency groups โ all of them, just vibes, lazy-loaded ๐
Parameters
detailsโ when set toFalse, no additional details will be returned. The default,True, will cause additional details to be returned.queryโ
Optional query parameters to be sent to limit the resources being returned:
all_tenants: Shows details for all project.sort: Comma-separated list of sort keys and optional sort directions.limit: Returns a number of items up to the limit value.offset: Used in conjunction with limit to return a slice of items. Specifies where to start in the list.marker: The ID of the last-seen item.
Returns โ a generator of consistency group objects. So many objects. Slay.
โจ create_consistency_group(**attrs)
Create a new consistency group from attributes. Build-a-bear but make it storage.
Parameters
attrsโ keyword arguments which will be used to create aConsistencyGroup<#openstack.block_storage.v3.consistency_group.ConsistencyGroup> comprised of the properties on the Consistency Group class.
Returns โ the results of consistency group creation. ๐ซถ
๐ฆ create_consistency_group_from_source(*, consistency_group_snapshot=None, consistency_group=None, name=None, description=None)
Creates a new consistency group from source. Yes bestie, copying the whole aesthetic.
Parameters
attrsโ keyword arguments which will be used to create aConsistencyGroup<#openstack.block_storage.v3.consistency_group.ConsistencyGroup> comprised of the properties on the Consistency Group class.
Returns โ the results of consistency group creation. (fr fr, that's what it says)
๐ delete_consistency_group(consistency_group, force=False)
Delete a consistency group. It's giving closure. ๐
Parameters
consistency_groupโ theConsistencyGroup<#openstack.block_storage.v3.consistency_group.ConsistencyGroup> to delete.forceโ when set toTrue, volumes in consistency group will also be deleted. โ ๏ธ That's the nuclear option, don't just set it for fun.
Returns โ None. Nothing. Empty. A peaceful void.
๐ธ update_consistency_group(consistency_group, **attrs)
Update a consistency group. A little edit, a little refresh, main character energy.
Parameters
consistency_groupโ the value can be the ID of a group or aConsistencyGroup<#openstack.block_storage.v3.consistency_group.ConsistencyGroup> instance.attrsโ the attributes to update on the consistency group.
Returns โ the updated consistency group. โจ
๐ง Consistency Group Snapshot Operations ๐ง
Same exact class signature as above, so here you go, once more with feeling:
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ get_consistency_group_snapshot(consistency_group_snapshot)
Get a consistency group snapshot. (Note the period at the end of that sentence, she's formal.)
Parameters
consistency_group_snapshotโ the value can be either the ID of a consistency group snapshot or aConsistencyGroupSnapshot<#openstack.block_storage.v3.consistency_group_snapshot.ConsistencyGroupSnapshot> instance.
Returns โ one ConsistencyGroupSnapshot <#openstack.block_storage.v3.consistency_group_snapshot.ConsistencyGroupSnapshot>
๐ฅ find_consistency_group_snapshot(name_or_id, ignore_missing=True, *, details=True)
Find a single consistency group snapshot. Detective mode: activated.
Parameters
name_or_idโ the name or ID of a consistency group snapshot.ignore_missingโ when set toFalse,ResourceNotFound<#openstack.exceptions.ResourceNotFound> will be raised when the consistency group snapshot does not exist.detailsโ when set toFalse, no additional details will be returned. The default,True, will cause additional details to be returned.
Returns โ one ConsistencyGroupSnapshot <#openstack.block_storage.v3.consistency_group_snapshot.ConsistencyGroupSnapshot> or None. Either a snack or no snack ๐ญ
Raises ResourceNotFound <#openstack.exceptions.ResourceNotFound> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
๐ consistency_group_snapshots(*, details=True, **query)
Retrieve a generator of consistency group snapshots. Lazy generator, so efficient, so mindful.
Parameters
detailsโ when set toFalse, no additional details will be returned. The default,True, will cause additional details to be returned.queryโ
Optional query parameters to be sent to limit the resources being returned:
limit: Returns a number of items up to the limit value.offset: Used in conjunction with limit to return a slice of items. Specifies where to start in the list.marker: The ID of the last-seen item.
Returns โ a generator of consistency group snapshot objects. ๐
๐ create_consistency_group_snapshot(**attrs)
Create a new consistency group snapshot. A lil baby snapshot, precious.
Parameters
attrsโ keyword arguments which will be used to create aConsistencyGroupSnapshot<#openstack.block_storage.v3.consistency_group_snapshot.ConsistencyGroupSnapshot>, comprised of the properties on theConsistencyGroupSnapshotclass. Theconsistencygroup_idattribute is required. Don't forget it, that's the whole assignment.
Returns โ the result of consistency group snapshot creation.
๐๏ธ delete_consistency_group_snapshot(consistency_group_snapshot, ignore_missing=True)
Delete a consistency group snapshot. Bye bestie, you were iconic while you lasted.
Parameters
consistency_group_snapshotโ the value can be either the ID of a consistency group snapshot or aConsistencyGroupSnapshot<#openstack.block_storage.v3.consistency_group_snapshot.ConsistencyGroupSnapshot> instance.ignore_missingโ bestie, when you set this toFalse, aResourceNotFound<#openstack.exceptions.ResourceNotFound> gets raised the moment that consistency group snapshot doesn't exist. Set itTrueand the SDK just shrugs and moves on. ๐
Returns
None โ nothing, nada, zip. She returns nothing and honestly? Respect. ๐
๐ Default Volume Types ๐
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
default_types() โ lists out all the default types, like a little roll call. โจ
Returns
A list of default types that are associated to projects.
show_default_type(project) โ shows you the default type for one specific project.
Parameters
- project โ the value can be either the ID of a project or a
Project<#openstack.identity.v3.project.Project> instance.
Returns
The default type associated to that project.
set_default_type(project, type) โ sets the default type for a project, i.e. you're making a choice and committing to it. ๐
Parameters
- project โ the value can be either the ID of a project or a
Project<#openstack.identity.v3.project.Project> instance. - type โ the value can be either the ID of a type or a
Type<#openstack.block_storage.v3.type.Type> instance.
Returns
A dictionary of project ID and it's associated default type.
unset_default_type(project) โ un-sets the default type for a project. Undoing your little choice. It's giving "actually never mind." ๐ญ
Parameters
- project โ the value can be either the ID of a project or a
Project<#openstack.identity.v3.project.Project> instance.
Returns
None
๐ฆ Extension Operations ๐ฆ
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
extensions() โ returns a generator of extensions. Lazy-loading queen behavior, we love a generator. ๐ง
Returns
A generator of extension
๐ธ Limits Operations ๐ธ
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_limits(project=None) โ retrieves the limits. Knowing your ceilings is self-care, fr fr. ๐
Parameters
- project โ a project to get limits for. The value can be either the ID of a project or an
Project<#openstack.identity.v3.project.Project> instance.
Returns
A Limits object, including both AbsoluteLimit <#openstack.block_storage.v3.limits.AbsoluteLimit> and RateLimit <#openstack.block_storage.v3.limits.RateLimit>
๐ Group Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_group(group, *, list_volume=None, **attrs) โ gets you one group. The main character of groups, if you will. ๐
Parameters
- group โ the value can be the ID of a group or a
Group<#openstack.block_storage.v3.group.Group> instance. - list_volume โ whether to include the IDs of the volumes that are members of the group in the response. Requires microversion 3.25 or later. โ ๏ธ so if you're on an older microversion, no volume IDs for you.
- attrs โ DEPRECATED optional query parameters to be sent to limit the resources being returned. Yeah she's deprecated, we don't stan her anymore. ๐
Returns
A Group instance.
find_group(name_or_id, ignore_missing=True, *, details=True) โ finds you a single group, no matter how hard they're hiding. ๐ต๏ธ
Parameters
- name_or_id โ the name or ID of a group.
- ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the group snapshot does not exist. - details โ when set to
False, no additional details will be returned. The default,True, will cause additional details to be returned.
Returns
One Group <#openstack.block_storage.v3.group.Group>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found. ๐ญ yes, two groups with the same name is a whole situation.
groups(*, details=True, **query) โ retrieves a generator of groups. Group chat energy but for storage. ๐ซถ
Parameters
- details โ when set to
False, no additional details will be returned. The default,True, will cause additional details to be returned. - query โ
Optional query parameters to be sent to limit the resources being returned:
all_tenants: Shows details for all project.sort: Comma-separated list of sort keys and optional sort directions.limit: Returns a number of items up to the limit value.offset: Used in conjunction withlimitto return a slice of items. Specifies where to start in the list.marker: The ID of the last-seen item.list_volume: Show volume ids in this group.detailed: IfTrue, will list groups with details.search_opts: Search options.
Returns
A generator of group objects.
create_group(**attrs) โ creates a brand new group from attributes. New group, who dis? โจ
Parameters
- attrs โ keyword arguments which will be used to create a
Group<#openstack.block_storage.v3.group.Group> comprised of the properties on theGroupclass.
Returns
The results of group creation.
create_group_from_source(**attrs) โ creates a new group from a source. It's giving "inspired by, but make it new." ๐ฆ
Parameters
- attrs โ keyword arguments which will be used to create a
Group<#openstack.block_storage.v3.group.Group> comprised of the properties on theGroupclass.
Returns
The results of group creation.
delete_group(group, delete_volumes=False, ignore_missing=True) โ deletes a group. Bye bestie, don't let the door hit you. ๐
Parameters
- group โ the
Group<#openstack.block_storage.v3.group.Group> to delete. - delete_volumes โ when set to
True, volumes in group will be deleted. ๐จ yes, the volumes too, so like, be sure before you flip this one. - ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the group does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent group.
Returns
None.
update_group(group, **attrs) โ updates a group. Glow-up arc, activated. ๐ฅ
Parameters
- group โ the value can be the ID of a group or a
Group<#openstack.block_storage.v3.group.Group> instance. - attrs โ the attributes to update on the group.
Returns
The updated group
reset_group_status(group, status) โจ
Reset group status โ okay so this one literally resets the status of a group. No cap.
groupโ the Group <#openstack.block_storage.v3.group.Group> to set the state.statusโ the status for a group.
Returns: None โ itโs giving minimal effort but in a cool way ๐
enable_group_replication(group) ๐ฆ
Enable replication for a group โ bestie, this turns replication ON for that group.
groupโ the Group <#openstack.block_storage.v3.group.Group> to enable replication for.
Returns: None
disable_group_replication(group) ๐
Disable replication for a group โ the opposite vibe, turns replication OFF.
groupโ the Group <#openstack.block_storage.v3.group.Group> to disable replication for.
Returns: None
failover_group_replication(group, *, allowed_attached_volume=False, secondary_backend_id=None) ๐ฅ
Failover replication for a group โ dramatic failover moment, but make it secure.
groupโ the Group <#openstack.block_storage.v3.group.Group> to failover replication for.allowed_attached_volumeโ whether to allow attached volumes in the group. Defaults toFalse.secondary_backend_idโ the secondary backend ID. Defaults toNone.
Returns: None
โจ Group Snapshot Operations โจ
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_group_snapshot(group_snapshot) ๐ธ
Get a group snapshot โ pull up one snack, I mean snapshot.
group_snapshotโ the value can be the ID of a group snapshot or a GroupSnapshot <#openstack.block_storage.v3.group_snapshot.GroupSnapshot> instance.
Returns: A GroupSnapshot instance.
find_group_snapshot(name_or_id, ignore_missing=True, *, details=True) ๐ซถ
Find a single group snapshot โ like a search party but for snapshots.
name_or_idโ the name or ID of a group snapshot.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the group snapshot does not exist.detailsโ when set toFalse, no additional details will be returned. The default,True, will cause additional details to be returned.
Returns: One group_snapshot <#module-openstack.block_storage.v3.group_snapshot>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises: DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
group_snapshots(*, details=True, **query) ๐
Retrieve a generator of group snapshots โ itโs giving infinite scroll energy.
detailsโ whenTrue, returns GroupSnapshot <#openstack.block_storage.v3.group_snapshot.GroupSnapshot> objects with additional attributes filled.queryโ optional query parameters to be sent to limit the group snapshots being returned.
Returns: A generator of group snapshtos. (yes, thatโs the typo in the original, keep it ๐)
create_group_snapshot(**attrs) โญ
Create a group snapshot โ new snapshot, who dis?
attrsโ keyword arguments which will be used to create a GroupSnapshot <#openstack.block_storage.v3.group_snapshot.GroupSnapshot> comprised of the properties on theGroupSnapshotclass.
Returns: The results of group snapshot creation.
reset_group_snapshot_status(group_snapshot, status) ๐
Reset group snapshot status โ reset button but make it snapshots.
group_snapshotโ the GroupSnapshot <#openstack.block_storage.v3.group_snapshot.GroupSnapshot> to set the state.stateโ the status of the group snapshot to be set.
Returns: None
โ ๏ธ heads up: the parameter in the signature isstatusbut the description saysstate. Weโre just the messenger, bestie.
delete_group_snapshot(group_snapshot, ignore_missing=True) ๐
Delete a group snapshot โ bye-bye snapshot.
group_snapshotโ the GroupSnapshot to delete.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the group snapshot does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent group snapshot.
Returns: None
๐ Group Type Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_group_type(group_type) ๐
Get a specific group type โ one group type, coming right up.
group_typeโ the value can be the ID of a group type or a GroupType <#openstack.block_storage.v3.group_type.GroupType> instance.
Returns: One :class: ~openstack.block_storage.v3.group_type.GroupType instance.
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
find_group_type(name_or_id, ignore_missing=True) ๐ง
Find a single group type โ detective mode activated.
name_or_idโ the name or ID of a group type.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the group type does not exist.
Returns: One GroupType <#openstack.block_storage.v3.group_type.GroupType>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises: DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
group_types(**query) ๐
Retrieve a generator of group types โ a whole vibe of group types.
queryโ optional query parameters to be sent to limit the resources being returned:sort: Comma-separated list of sort keys and optional sort directions in the form of<key> [:<direction>]. A valid direction isasc(ascending) ordesc(descending).limit: Requests a page size of items. Returns a number of items up to a limit value. Use thelimitparameter to make an initial limited request and use the ID of the last-seen item from the response as themarkerparameter value in a subsequent limited request.offset: Used in conjunction withlimitto return a slice of items. Is where to start in the list.marker: The ID of the last-seen item.
Returns: A generator of group type objects.
create_group_type(**attrs) ๐
Create a group type โ birth of a group type, iconic.
attrsโ keyword arguments which will be used to create a GroupType <#openstack.block_storage.v3.group_type.GroupType> comprised of the properties on theGroupTypeclass.
Returns: The results of group type creation.
delete_group_type(group_type, ignore_missing=True) ๐
Delete a group type โ yeet that group type.
group_typeโ the value can be the ID of a group type or a GroupType <#openstack.block_storage.v3.group_type.GroupType> instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the zone does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent zone.
Returns: None
๐ซ note: the original says โzoneโ here, not โgroup typeโ โ weโre keeping it exactly as written, no cap.
update_group_type(group_type, **attrs)
Update a group_type
Parameters
group_typeโ The value can be the ID of a group type or aGroupType(openstack.block_storage.v3.group_type.GroupType) instance. ๐attrsโ The attributes to update on the group type.
Returns โ The updated group type. โจ
fetch_group_type_group_specs(group_type) โ Lists group specs of a group type. ๐ฆ
- Parameters
group_typeโ Either the ID of a group type or aGroupType(openstack.block_storage.v3.group_type.GroupType) instance.
- Returns โ One
GroupType(openstack.block_storage.v3.group_type.GroupType). ๐
create_group_type_group_specs(group_type, group_specs) โ Create group specs for a group type. ๐
- Parameters
group_typeโ Either the ID of a group type or aGroupType(openstack.block_storage.v3.group_type.GroupType) instance.group_specsโ dict of extra specs.
- Returns โ One
GroupType(openstack.block_storage.v3.group_type.GroupType). โจ
get_group_type_group_specs_property(group_type, prop) โ Retrieve a group spec property for a group type. ๐
- Parameters
group_typeโ Either the ID of a group type or aGroupType(openstack.block_storage.v3.group_type.GroupType) instance.propโ Property name.
- Returns โ String value of the requested property. ๐
update_group_type_group_specs_property(group_type, prop, val) โ Update a group spec property for a group type. ๐ ๏ธ
- Parameters
group_typeโ Either the ID of a group type or aGroupType(openstack.block_storage.v3.group_type.GroupType) instance.propโ Property name.valโ Property value.
- Returns โ String value of the requested property. โญ
delete_group_type_group_specs_property(group_type, prop, ignore_missing=True) โ Delete a group spec property from a group type. ๐ง
- Parameters
group_typeโ Either the ID of a group type or aGroupType(openstack.block_storage.v3.group_type.GroupType) instance.propโ Property name.ignore_missingโ When set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the group type or group spec does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent group type group spec.
- Returns โ
None. ๐ญ
๐ฌ Message Operations ๐ฌ
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_message(message) โ Get a message. ๐จ
- Parameters
messageโ The value can be the ID of a message or aMessage(openstack.block_storage.v3.message.Message) instance.
- Returns โ
Messageinstance. ๐
delete_message(message, ignore_missing=True) โ Delete a message. ๐๏ธ
- Parameters
messageโ The value can be either the ID of a message or aMessageinstance.ignore_missingโ When set toFalse,ResourceNotFound(openstack.exceptions.ResourceNotFound) will be raised when the message does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent message.
- Returns โ
None. ๐
messages(**query) โ Retrieve a generator of messages. ๐
- Returns โ A generator of message objects. โจ
๐ QuotaClassSet Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_quota_class_set(quota_class_set='default') โ Get a single quota class set. ๐
Only one quota class is permitted, default. Periodt. ๐
- Parameters
quota_class_setโ The value can be the ID of a quota class set (onlydefaultis supported) or aQuotaClassSet(openstack.block_storage.v3.quota_class_set.QuotaClassSet) instance.
- Returns โ One
QuotaClassSet(openstack.block_storage.v3.quota_class_set.QuotaClassSet). ๐ - Raises โ
NotFoundException(openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ
update_quota_class_set(quota_class_set, **attrs) โ Update a QuotaClassSet. ๐ ๏ธ
Only one quota class is permitted, default. Fr fr. ๐ธ
- Parameters
quota_class_setโ Either the ID of a quota class set (onlydefaultis supported) or aattrsโ The attributes to update on theQuotaClassSetrepresented byquota_class_set.
- Returns โ The updated
QuotaSet. โญ
๐ QuotaSet Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_quota_set(project, usage=False, **query) โ Show QuotaSet information for the project. ๐
- Parameters
projectโ ID or instance ofProjectof the project for which the quota should be retrieved.usageโ When set toTrue, quota usage and reservations would be filled. ๐queryโ Additional query parameters to use.
- Returns โ One
QuotaSet(openstack.block_storage.v3.quota_set.QuotaSet). ๐ - Raises โ
NotFoundException(openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ
get_quota_set_defaults(project) โ Show QuotaSet defaults for the project. ๐
- Parameters
projectโ ID or instance ofProjectof the project for which the quota should be retrieved.
- Returns โ One
QuotaSet(openstack.block_storage.v3.quota_set.QuotaSet). ๐ - Raises โ
NotFoundException(openstack.exceptions.NotFoundException) when no resource can be found. ๐
revert_quota_set(project, **query) โ Reset quota for the project/user. ๐
- Parameters
projectโ ID or instance ofProjectof the project for which the quota should be resetted. (Yes, "resetted" โ we don't make the rules. ๐)queryโ Additional parameters to be used.
- Returns โ
None. โจ
update_quota_set(project, **attrs) โ Update a QuotaSet. ๐ ๏ธ
- Parameters
projectโ ID or instance ofProjectof the project for which the quota should be reset.attrsโ The attributes to update on theQuotaSetrepresented byquota_set.
- Returns โ The updated
QuotaSet. ๐
๐ QoSSpec Operations
Okay bestie, this is the QoS spec corner of the block storage v3 proxy and it's honestly kind of a whole vibe. All of these live on the same class, and that class is a bit of a mouthful, so here's her full signature in all her glory โ every kwarg, no cap ๐ซถ:
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ธ create_qos_spec(**attrs)
Make a brand new QoS Spec out of attributes, like a little QoS baby โจ
Parameters
attrsโ keyword arguments that get used to create aQoSSpec<#openstack.block_storage.v2.qos_spec.QoSSpec>, made up of the properties on theQoSSpecclass.
Returns
The results of a QoS spec creation ๐
๐ฆ delete_qos_spec(qos_spec, ignore_missing=True, *, force=False)
Delete a QoS Spec. Yes, gone. Bye ๐
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v2.qos_spec.QoSSpec> instance.ignore_missingโ when set toFalse,ResourceNotFound<#openstack.exceptions.ResourceNotFound> will be raised when the type does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent type.forceโ whether to delete the QoS spec even if it's in use.
โ ๏ธ That force flag is giving "I know what I'm doing" energy โ it nukes the spec even if it's in use. Respect the power, bestie.
Returns
None
๐ง update_qos_spec(qos_spec, **attrs)
Update a QoS spec โ glow-up time ๐ฅ
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v2.qos_spec.QoSSpec> instance.attrsโ the attributes to update on the QoS spec.
Returns
The updated QoS spec ๐
โญ get_qos_spec(qos_spec)
Grab a single QoS spec, main character only ๐
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v2.qos_spec.QoSSpec> instance.
Returns
One QoSSpec <#openstack.block_storage.v2.qos_spec.QoSSpec>
Raises ResourceNotFound <#openstack.exceptions.ResourceNotFound> when no resource can be found.
๐ find_qos_spec(name_or_id, ignore_missing=True, **query)
Find a single QoS spec โ the scavenger hunt version ๐
Parameters
name_or_idโ the name or ID of a QoS spec.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ additional attributes like'host'.
Returns
One: class:~openstack.block_storage.v2.qos_spec.QoSSpec or None
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
๐ญ Two matches and she panics โ that's the DuplicateResource, not a personality flaw.
๐ qos_specs(**query)
Return a generator of QoS specs, like a lil pipeline of them โจ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of QoSSpec objects
๐ associate_qos_spec(qos_spec, vol_type_id)
Associate a QoS spec with a volume type. Matchmaker mode ๐ซถ
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v3.qos_spec.QoSSpec> instance.vol_type_idโ the ID of the volume type to associate with.
Returns
None
๐ disassociate_qos_spec(qos_spec, vol_type_id)
Disassociate a QoS spec from a volume type. The breakup episode ๐ญ
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v3.qos_spec.QoSSpec> instance.vol_type_idโ the ID of the volume type to disassociate from.
Returns
None
๐ธ disassociate_all_qos_spec(qos_spec)
Disassociate a QoS spec from all volume types. Not a breakup, a whole era-ending ๐
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v3.qos_spec.QoSSpec> instance.
Returns
None
๐ delete_qos_spec_metadata(qos_spec, keys)
Delete metadata from a QoS spec โ spring cleaning ๐ฅ
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v3.qos_spec.QoSSpec> instance.keysโ the keys to delete from the QoS spec.
Returns
None
๐ฆ qos_spec_associations(qos_spec)
Return a generator of associations for a QoS spec. Who's linked to who, the lore ๐
Parameters
qos_specโ the value can be either the ID of a QoS spec or aQoSSpec<#openstack.block_storage.v3.qos_spec.QoSSpec> instance.
Returns
A generator of QoSSpecAssociation <#openstack.block_storage.v3.qos_spec.QoSSpecAssociation> objects
๐ Resource Filter Operations
Same class, same iconique signature, zero changes โ here she is again for the record ๐:
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
โจ resource_filters(**query)
Retrieve a generator of resource filters. It's giving "quietly useful" ๐
Returns
A generator of resource filters.
๐ Service Operations
And one more time โ the exact same Proxy signature, because she's nothing if not consistent ๐ซถ:
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ find_service(name_or_id, ignore_missing=True, **query)
Find a single service โ detective era ๐ธ
Parameters
name_or_idโ the name or ID of a service.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ additional attributes like'host'.
Returns
One: class:~openstack.block_storage.v3.service.Service or None
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
๐ services(**query)
Return a generator of service ๐ง
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of Service objects
๐ enable_service(service)
Enable a service. Turning it back on, we love a comeback ๐
Parameters
serviceโ either the ID of a service or aService<#openstack.block_storage.v3.service.Service> instance.
Returns
Updated service instance
๐
disable_service(service, *, reason=None)
Disable a service. Sit down for a sec, bestie โจ
Parameters
serviceโ either the ID of a service or aService<#openstack.block_storage.v3.service.Service> instancereasonโ the reason to disable a service
Returns
Updated service instance
๐ฅ thaw_service(service)
Thaw a service
serviceโ either the ID of a service, or an actualServiceinstance (openstack.block_storage.v3.service.Service) ๐ซถ
Returns โ the updated service instance, fresh and glowed-up โจ
freeze_service(service)
Okay so this one freezes a service ๐ง Like, it just puts it on pause, bestie.
serviceโ either the ID of a service, or aServiceinstance (openstack.block_storage.v3.service.Service)
Returns โ the updated service instance ๐
set_service_log_levels(*, level, binary=None, server=None, prefix=None)
Set the log level for services ๐ฅ Very main character of you.
Parameters
levelโ the log level to set, case insensitive, and the accepted values areINFO,WARNING,ERRORandDEBUG. No inventing your own levels, ngl ๐binaryโ the binary name of the service.serverโ the name of the host.prefixโ the prefix for the log path we're querying, for examplecinder.orsqlalchemy.engine.. When it's not present, or when the empty string is passed, all log levels will be retrieved ๐
Returns โ None. That's it. That's the whole return ๐
get_service_log_levels(*, binary=None, server=None, prefix=None)
Get the log level for services ๐
Parameters
binaryโ the binary name of the service.serverโ the name of the host.prefixโ the prefix for the log path we're querying, for examplecinder.orsqlalchemy.engine.. When it's not present, or when the empty string is passed, all log levels will be retrieved ๐ธ
Returns โ a generator of LogLevel objects. It's giving lazy-evaluation realness โจ
failover_service(service, *, cluster=None, backend_id=None)
Failover a service ๐ฆ
Heads up bestie โ this only applies to replicating cinder-volume services ๐ Like, don't try it on anything else, fr fr.
Parameters
serviceโ either the ID of a service, or aServiceinstance (openstack.block_storage.v3.service.Service)
Returns โ the updated service instance ๐
cleanup_service_workers(**attrs)
Request a cleanup of services, with optional filtering ๐งน
Parameters
attrsโ the attributes used to filter services.
Returns โ the results of the cleanup request ๐
๐ Snapshot Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Look at that constructor. Iconic. No notes. ๐ญ
get_snapshot(snapshot)
Get a single snapshot ๐ธ
Parameters
snapshotโ the value can be the ID of a snapshot, or aSnapshotinstance (openstack.block_storage.v3.snapshot.Snapshot).
Returns โ one Snapshot (openstack.block_storage.v3.snapshot.Snapshot) ๐
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. Sad times ๐ญ
find_snapshot(name_or_id, ignore_missing=True, *, details=True, all_projects=False)
Find a single snapshot ๐ Like a scavenger hunt but for storage.
Parameters
snapshotโ the name or ID of a snapshot.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the snapshot does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. So basically,True= no drama ๐ซถdetailsโ when set toFalse,~openstack.block_storage.v3.snapshot.Snapshotobjects will be returned. The default,True, will cause more attributes to be returned. More is more, bestie โจall_projectsโ when set toTrue, search for a snapshot by name across all projects. Note that this will likely result in a higher chance of duplicates. Admin-only by default ๐
Returns โ one Snapshot (openstack.block_storage.v3.snapshot.Snapshot) ๐ธ
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
Raises โ DuplicateResource (openstack.exceptions.DuplicateResource) when multiple resources are found. Oops, more than one match ๐
snapshots(*, details=True, all_projects=False, **query)
Retrieve a generator of snapshots ๐
Parameters
detailsโ when set toFalse,~openstack.block_storage.v3.snapshot.Snapshotobjects will be returned. The default,True, will cause more attributes to be returned.all_projectsโ when set toTrue, list snapshots from all projects. Admin-only by default ๐queryโ optional query parameters to be sent to limit the snapshots being returned. Available parameters include:name: name of the snapshot as a string.project_id: filter the snapshots by project.volume_id: volume id of a snapshot.status: value of the status of the snapshot, so that you can filter on"available"for example ๐ฅ
Returns โ a generator of snapshot objects. Lazy loading, we love to see it ๐
create_snapshot(**attrs)
Create a new snapshot from attributes ๐
Parameters
attrsโ keyword arguments which will be used to create aSnapshot(openstack.block_storage.v3.snapshot.Snapshot), comprised of the properties on theSnapshotclass.
Returns โ the results of snapshot creation โจ
update_snapshot(snapshot, **attrs)
Update a snapshot ๐ฆ
Parameters
snapshotโ either the ID of a snapshot, or aSnapshotinstance (openstack.block_storage.v3.snapshot.Snapshot).attrsโ the attributes to update on the snapshot.
Returns โ the updated snapshot ๐
delete_snapshot(snapshot, ignore_missing=True, force=False)
Delete a snapshot ๐ Gone. Poof.
Parameters
snapshotโ the value can be either the ID of a snapshot, or aSnapshotinstance (openstack.block_storage.v3.snapshot.Snapshot).ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the snapshot does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent snapshot. Chill mode activated ๐forceโ whether to try forcing snapshot deletion. Use with care, bestie โ ๏ธ
Returns โ None
fetch_snapshot_metadata(snapshot)
Return a dictionary of metadata for a snapshot ๐
Parameters
snapshotโ either the ID of a snapshot, or aSnapshot(openstack.block_storage.v3.snapshot.Snapshot).
Returns โ a Snapshot (openstack.block_storage.v3.snapshot.Snapshot) with the snapshot's metadata. All keys and values are Unicode text ๐ธ
get_snapshot_metadata(snapshot)
Return a dictionary of metadata for a snapshot ๐
Deprecated since version4.14.0: usefetch_snapshot_metadata()instead. Like, it's still here, but it's giving old money. Move on bestie ๐
set_snapshot_metadata(snapshot, **metadata)
Update metadata for a snapshot โ๏ธ
Parameters
snapshotโ either the ID of a snapshot, or aSnapshot(openstack.block_storage.v3.snapshot.Snapshot).metadataโ key/value pairs to be updated in the snapshot's metadata. No other metadata is modified by this call. All keys and values are stored as Unicode. Surgical precision, we stan ๐ฅ
Returns โ a Snapshot (openstack.block_storage.v3.snapshot.Snapshot) with the snapshot's metadata. All keys and values are Unicode text ๐
delete_snapshot_metadata(snapshot, keys=None)
Delete metadata for a snapshot ๐งน
Parameters
snapshotโ either the ID of a snapshot, or aSnapshot(openstack.block_storage.v3.snapshot.Snapshot).keysโ the keys to delete. If omitted, all metadata is removed. Yeah, all of it. Be sure, bestie ๐ญ
Returns โ None
reset_snapshot_status(snapshot, status)
Reset the status of the snapshot ๐
Parameters
so we're still on the last function's params, and then it's a whole buffet of snapshot, transfer, and type methods. buckle up bestie ๐
snapshot-- The value can be either the ID of a backup or aSnapshot <#openstack.block_storage.v3.snapshot.Snapshot>instance.status-- New snapshot status
Returns: None
set_snapshot_status(snapshot, status, progress=None)
Update fields related to the status of a snapshot. ๐
Parameters:
snapshot-- The value can be either the ID of a backup or aSnapshot <#openstack.block_storage.v3.snapshot.Snapshot>instance.status-- New snapshot statusprogress-- A percentage value for snapshot build progress.
Returns: None
manage_snapshot(**attrs)
Creates a snapshot by using existing storage rather than allocating new storage. โจ
Parameters:
attrs-- Keyword arguments which will be used to create aSnapshot <#openstack.block_storage.v3.snapshot.Snapshot>, comprised of the properties on the Snapshot class.
Returns: The results of snapshot creation
unmanage_snapshot(snapshot)
Unmanage a snapshot from block storage provisioning. ๐ฆ
Parameters:
snapshot-- Either the ID of a snapshot or aSnapshot <#openstack.block_storage.v3.snapshot.Snapshot>.
Returns: None
manageable_snapshots(*, details=False, **query)
List snapshots available for management on a host or cluster. ๐ฅ
Parameters:
details-- When set to True, additional fields will be returned. The default, False, returns basic information.query-- Optional query parameters to limit the resources returned:host: The Cinder host on which to list manageable snapshots.cluster: The Cinder cluster on which to list manageable snapshots. (requires microversion 3.17 or later)marker: Begin returning snapshots appearing later in the list than the snapshot represented by this reference.limit: Maximum number of snapshots to return.offset: Number of snapshots to skip after the marker.sort: Comma-separated list of sort keys and directions.
Returns: A generator of manageable snapshot objects.
Stats Operations
Here's the class signature, same as always but we gotta include it because details matter: ๐
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
backend_pools(**query)
Returns a generator of cinder Back-end storage pools. ๐
Parameters:
query-- Optional query parameters to be sent to limit the resources being returned.
:returns A generator of cinder Back-end storage pools objects
Transfer Operations
Same class signature, no cap: ๐ฏ
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_transfer(**attrs)
Create a new Transfer record ๐
Parameters:
volume_id-- The value is ID of the volume.name-- The value is name of the transferattrs-- Keyword arguments which will be used to create aTransfer <#openstack.block_storage.v3.transfer.Transfer>comprised of the properties on the Transfer class.
Returns: The results of Transfer creation
delete_transfer(transfer, ignore_missing=True)
Delete a volume transfer ๐
Parameters:
transfer-- The value can be either the ID of a transfer or aTransferinstance.ignore_missing-- When set to FalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the transfer does not exist. When set to True, no exception will be set when attempting to delete a nonexistent transfer.
Returns: None
find_transfer(name_or_id, ignore_missing=True)
Find a single transfer ๐
Parameters:
name_or_id-- The name or ID a transferignore_missing-- When set to FalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the volume transfer does not exist.
Returns: One Transfer <#openstack.block_storage.v3.transfer.Transfer>
Raises:
NotFoundException <#openstack.exceptions.NotFoundException>when no resource can be found.DuplicateResource <#openstack.exceptions.DuplicateResource>when multiple resources are found.
get_transfer(transfer)
Get a single transfer ๐ซถ
Parameters:
transfer-- The value can be the ID of a transfer or aTransfer <#openstack.block_storage.v3.transfer.Transfer>instance.
Returns: One Transfer <#openstack.block_storage.v3.transfer.Transfer>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
transfers(*, details=True, all_projects=False, **query)
Retrieve a generator of transfers ๐ธ
Parameters:
details-- When set to False no extended attributes will be returned. The default, True, will cause objects with additional attributes to be returned.all_projects-- When set to True, list transfers from all projects. Admin-only by default.query-- Optional query parameters to be sent to limit the transfers being returned.
Returns: A generator of transfer objects.
accept_transfer(transfer, auth_key)
Accept a Transfer ๐ค
Parameters:
transfer-- The value can be the ID of a transfer or aTransfer <#openstack.block_storage.v3.transfer.Transfer>instance.auth_key-- The key to authenticate volume transfer.
Returns: The results of Transfer creation
Type Operations
Again, the class signature. Obsessed with consistency. ๐
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_type(type)
Get a single type ๐ฆ
Parameters:
type-- The value can be the ID of a type or aType <#openstack.block_storage.v3.type.Type>instance.
Returns: One Type <#openstack.block_storage.v3.type.Type>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
find_type(name_or_id, ignore_missing=True)
Find a single volume type ๐
Parameters:
snapshot-- The name or ID a volume typeignore_missing-- When set to FalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the volume type does not exist.
Returns: One Type <#openstack.block_storage.v3.type.Type>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
get_type_encryption(volume_type)โ grab the encryption deets of a volume type ๐ you passvolume_typeas either the ID of a type or aTypeinstance. Returns oneTypeEncryption. RaisesNotFoundExceptionwhen no resource can be found, so likeโฆ if it's not there, it's not there ๐ญcreate_type_encryption(volume_type, **attrs)โ spin up a brand-new type encryption from attributes โจvolume_typeis the ID of a type or aTypeinstance, andattrsare the keyword arguments used to create aTypeEncryption, made up of the properties on theTypeEncryptionclass. Returns the results of type encryption creation.delete_type_encryption(encryption=None, volume_type=None, ignore_missing=True)โ bye-bye type encryption attributes ๐encryptionโ can beNoneor aTypeEncryptioninstance. IfencryptionisNonethenvolume_typemust be specified.volume_typeโ the ID of a type or aTypeinstance. Required ifencryptionisNone.ignore_missingโ when set toFalse,NotFoundExceptiongets raised when the type does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent type.- Returns
None.
update_type_encryption(encryption=None, volume_type=None, **attrs)โ update a type (yes the docs literally say "Update a type", we're not gonna fight it ๐)encryptionโ can beNoneor aTypeEncryptioninstance. If this isNonethenvolume_typemust be specified.volume_typeโ the ID of a type or aTypeinstance. Required ifencryptionisNone.attrsโ the attributes to update on the type encryption.- Returns the updated type encryption.
๐ Volume Operations ๐
class openstack.block_storage.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_volume(volume)โ get a single volume ๐ฆvolumeis either the ID of a volume or aVolumeinstance. Returns oneVolume.
Raises NotFoundException when no resource can be found. She's not ghosting you, she's just not there ๐
find_volume(name_or_id, ignore_missing=True, *, details=True, all_projects=False)โ find a single volume, the hunt is ON ๐snapshotโ The name or ID a volume (yes bb, the manpage sayssnapshothere even though the argument isname_or_idโ copying it exactly, no cap ๐)ignore_missingโ when set toFalse,NotFoundExceptionwill be raised when the volume does not exist.detailsโ when set toFalseno extended attributes will be returned. The default,True, will cause objects with additional attributes to be returned.all_projectsโ when set toTrue, search for volume by name across all projects. Note that this will likely result in a higher chance of duplicates. Admin-only by default.
Returns one Volume.
Raises NotFoundException when no resource can be found.
Raises DuplicateResource when multiple resources are found โ which is lowkey awk when it happens ๐ญ
volumes(*, details=True, all_projects=False, **query)โ retrieve a generator of volumes, a whole lil lineup โจdetailsโ when set toFalseno extended attributes will be returned. The default,True, will cause objects with additional attributes to be returned.all_projectsโ when set toTrue, list volumes from all projects. Admin-only by default.queryโ
Optional query parameters to be sent to limit the volumes being returned โ available parameters include:
nameโ name of the volume as a string.statusโ value of the status of the volume so you can filter on"available", for example.
Returns โ a generator of volume objects. Slay. โจ
create_volume(**attrs)
Create a new volume from attributes.
Parameters
attrsโ keyword arguments which will be used to create aVolume, comprised of the properties on theVolumeclass.
Returns โ the results of volume creation. ๐
delete_volume(volume, ignore_missing=True, *, force=False, cascade=False)
Delete a volume.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.ignore_missingโ when set toFalse,NotFoundExceptionwill be raised when the volume does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent volume.forceโ whether to try forcing volume deletion.cascadeโ whether to remove any snapshots along with the volume.
Returns โ None.
update_volume(volume, **attrs)
Update a volume.
Parameters
volumeโ either the ID of a volume or aVolumeinstance.attrsโ the attributes to update on the volume.
Returns โ the updated volume. ๐ฆ
fetch_volume_metadata(volume)
Return a dictionary of metadata for a volume.
Parameters
volumeโ either the ID of a volume or aVolume.
Returns โ a Volume with the volume's metadata. All keys and values are Unicode text.
get_volume_metadata(volume)
Return a dictionary of metadata for a volume.
Deprecated since version4.14.0: usefetch_volume_metadata()instead. No cap, use the newer one bestie. ๐
set_volume_metadata(volume, **metadata)
Update metadata for a volume.
Parameters
volumeโ either the ID of a volume or aVolume.metadataโ key/value pairs to be updated in the volume's metadata. No other metadata is modified by this call. All keys and values are stored as Unicode.
Returns โ a Volume with the volume's metadata. All keys and values are Unicode text. ๐
delete_volume_metadata(volume, keys=None)
Delete metadata for a volume.
Parameters
volumeโ either the ID of a volume or aVolume.keysโ the keys to delete. If omitted, all metadata is removed.
Returns โ None.
extend_volume(volume, size)
Extend a volume.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.sizeโ new volume size.
Returns โ None.
complete_volume_extend(volume, error=False)
Complete a volume extend operation.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.errorโ used to indicate if an error has occurred that requires Cinder to roll back the extend operation.
Returns โ None. ๐ญ
set_volume_readonly(volume, readonly=True)
Set a volume's read-only flag.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.readonlyโ whether the volume should be a read-only volume or not.
Returns โ None.
retype_volume(volume, new_type, migration_policy='never')
Retype the volume.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.new_typeโ the new volume type that volume is changed with. The value can be either the ID of the volume type or aTypeinstance.migration_policyโ specify if the volume should be migrated when it is re-typed. Possible values areon-demandornever. Default:never.
Returns โ None. ๐ฅ
set_volume_bootable_status(volume, bootable)
Set bootable status of the volume.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.bootableโ specifies whether the volume should be bootable or not.
Returns โ None.
set_volume_image_metadata(volume, **metadata)
Update image metadata for a volume.
Parameters
volumeโ either the ID of a volume or aVolume.metadataโ key/value pairs to be updated in the volume's image metadata. No other metadata is modified by this call.
Returns โ None.
delete_volume_image_metadata(volume, keys=None)
Delete metadata for a volume.
Parameters
volumeโ either the ID of a volume or aVolume.keysโ the keys to delete. If omitted, all metadata is removed.
Returns โ None. ๐
reset_volume_status(volume, status=None, attach_status=None, migration_status=None)
Reset volume statuses.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.statusโ the new volume status.attach_statusโ the new volume attach status.migration_statusโ the new volume migration status (admin only).
Returns โ None.
revert_volume_to_snapshot(volume, snapshot)
Revert a volume to its latest snapshot.
This method only support reverting a detached volume, and the volume status must be available. โ ๏ธ
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.snapshotโ the value can be either the ID of a snapshot or aSnapshotinstance.
Returns โ None.
attach_volume(volume, mountpoint, instance=None, host_name=None)
Attaches a volume to a server.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.mountpointโ the attaching mount point.instanceโ the UUID of the attaching instance.host_nameโ the name of the attaching host.
Returns โ None. ๐ซถ
detach_volume(volume, attachment, force=False, connector=None)
Detaches a volume from a server.
Parameters
volumeโ the value can be either the ID of a volume or aVolumeinstance.attachmentโ the ID of the attachment.forceโ whether to force volume detach (rolls back an unsuccessful detach operation after you disconnect the volume).connectorโ the connector object.
Returns โ None.
manage_volume(**attrs)
Creates a volume by using existing storage rather than allocating new storage. ๐
Parameters
attrsโ the keyword arguments that get used to build aVolume, made up of all the properties on theVolumeclass.
Returns โ the results of the volume creation ๐
unmanage_volume(volume)
Removes a volume from Block Storage management without removing the back-end storage object that's associated with it. like, it lets go of the leash but the dog is still fully there ๐
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.
Returns โ None
manageable_volumes(*, details=False, **query)
Lists the volumes that are available for management on a host or a cluster โจ
Parameters
detailsโ when you set it toTrue, you get additional fields back. The default,False, just returns basic information.queryโ optional query parameters to limit the resources returned:host: the Cinder host to list manageable volumes on.cluster: the Cinder cluster to list manageable volumes on. (requires microversion3.17or later)marker: begin returning volumes that appear later in the list than the volume represented by this reference.limit: maximum number of volumes to return.offset: number of volumes to skip after the marker.sort: comma-separated list of sort keys and directions.
Returns โ a generator of manageable volume objects ๐ธ
migrate_volume(volume, host=None, force_host_copy=False, lock_volume=False, cluster=None)
Migrates a volume over to the host you specify ๐ฆ
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.hostโ the target host for the volume migration. Host format is<host@backend>.force_host_copyโ if it's false (the default), you rely on the volume backend driver to do the migration, which might be optimized. If it's true, or the volume driver fails to migrate the volume itself, a generic host-based migration gets performed instead.lock_volumeโ if it's true, migrating an available volume will change its status to maintenance, which prevents other operations from being performed on the volume such as attach, detach, retype, etc.clusterโ the target cluster for the volume migration. Cluster format is<cluster@backend>. Starting with microversion3.16, eitherclusterorhostmust be specified. Ifhostis specified and is part of a cluster, the cluster is used as the target for the migration.
Returns โ None
complete_volume_migration(volume, new_volume, error=False)
Wraps up the migration of a volume ๐
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.new_volumeโ the UUID of the new volume.errorโ used to indicate whether an error happened somewhere else that now needs clean up.
Returns โ None
upload_volume_to_image(volume, image_name, force=False, disk_format=None, container_format=None, visibility=None, protected=None)
Uploads the specified volume to the image service ๐ค
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.image_nameโ the name for the new image.forceโ enables or disables upload of a volume that's attached to an instance.disk_formatโ disk format for the new image.container_formatโ container format for the new image.visibilityโ the visibility property of the new image.protectedโ whether the new image is protected.
Returns โ a dictionary describing the image ๐
reserve_volume(volume)
Marks a volume as reserved. consider it claimed, bestie ๐
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.
Returns โ None
unreserve_volume(volume)
Unmarks a volume as reserved. releasing it back into the wild ๐๏ธ
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.
Returns โ None
begin_volume_detaching(volume)
Updates the volume status to 'detaching' ๐ซถ
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.
Returns โ None
abort_volume_detaching(volume)
Updates the volume status to 'in-use' โ nvm, we're staying attached ๐ญ
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.
Returns โ None
init_volume_attachment(volume, connector)
Initializes the volume attachment โจ
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.connectorโ the connector object.
Returns โ a dictionary containing the modified connector object
terminate_volume_attachment(volume, connector)
Updates the volume status to 'in-use' ๐
Parameters
volumeโ can be either the ID of a volume or aVolumeinstance.connectorโ the connector object.
Returns โ None
๐ซถ Helpers ๐ซถ
ok so this is the actual proxy class, and it takes a lot of kwargs. like, a lot a lot. here's the whole signature verbatim, don't @ me:
class openstack.block_storage.v3._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
wait_for_status(res, status='available', failures=None, interval=2, wait=None, attribute='status', callback=None)
Waits for the resource to land in a particular status. it's giving "are we there yet" but as a function โณ
Parameters
sessionโ the session to use for making this request.resourceโ the resource to wait on to reach the status. The resource must have a status attribute specified viaattribute.statusโ desired status of the resource.failuresโ statuses that would indicate the transition failed, such as'ERROR'. Defaults to['ERROR'].intervalโ number of seconds to wait between checks.waitโ maximum number of seconds to wait for the transition. Set it toNoneto wait forever.attributeโ name of the resource attribute that contains the status.callbackโ a callback function. This gets called with a single value,progress. It's API specific but is generally a percentage value from0-100.
Returns โ the updated resource.
RaisesResourceTimeoutif the transition tostatusfailed to occur withinwaitseconds. ๐ค
RaisesResourceFailureif the resource transitioned to one of the states infailures. ๐
Raises AttributeError if the resource does not have a status attribute. ๐
wait_for_delete(res, interval=2, wait=120, callback=None)
Waits for a resource to be deleted. manifesting its absence ๐ฆ
Parameters
resโ the resource to wait on to be deleted.intervalโ how many seconds to wait before two consecutive checks. โฑ๏ธwaitโ the maximum number of seconds to wait before the change. โณcallbackโ a callback function. It gets called with a single value, progress, which is a percentage value from0-100. ๐
Returns The resource is returned on success. ๐
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if transition to delete failed to occur in the specified seconds. ๐ญ
โจ Cluster API โจ
๐ซถ The Cluster Class ๐ซถ
The cluster high-level interface is available through the cluster member of a Connection <#openstack.connection.Connection> object. The cluster member will only be added if the service is detected. ๐
๐ ๏ธ Build Info Operations ๐ ๏ธ
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ get_build_info() ๐
Get build info for service engine and API. ๐ง
Returns A dictionary containing the API and engine revision string. ๐
๐ฆ Profile Type Operations ๐ฆ
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ profile_types(**query) ๐
Get a generator of profile types. โจ
Returns A generator of objects that are of type ProfileType <#openstack.clustering.v1.profile_type.ProfileType>. ๐
๐ get_profile_type(profile_type) ๐
Get the details about a profile type. ๐
Parameters
profile_typeโ the name of theprofile_typeto retrieve, or an object ofProfileType <#openstack.clustering.v1.profile_type.ProfileType>. ๐ซถ
Returns A ProfileType <#openstack.clustering.v1.profile_type.ProfileType> object. ๐ธ
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no profile_type matching the name could be found. ๐
๐ Profile Operations ๐
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ create_profile(**attrs) ๐
Create a new profile from attributes. ๐ ๏ธ
Parameters
attrsโ keyword arguments that will be used to create aProfile <#openstack.clustering.v1.profile.Profile>, it is comprised of the properties on theProfileclass. ๐งต
Returns The results of profile creation. ๐
๐ delete_profile(profile, ignore_missing=True) ๐
Delete a profile. ๐๏ธ
Parameters
profileโ the value can be either the name or ID of a profile, or aProfile <#openstack.clustering.v1.profile.Profile>instance. ๐ซถignore_missingโ when set toFalse, an exceptionNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the profile could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent profile. ๐
Returns None ๐
๐ find_profile(name_or_id, ignore_missing=True) ๐
Find a single profile. ๐
Parameters
name_or_idโ the name or ID of a profile. ๐ท๏ธignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. ๐
Returns One Profile <#openstack.clustering.v1.profile.Profile> object or None. ๐
๐ get_profile(profile) ๐
Get a single profile. โจ
Parameters
profileโ the value can be the name or ID of a profile, or aProfile <#openstack.clustering.v1.profile.Profile>instance. ๐ซถ
Returns One Profile <#openstack.clustering.v1.profile.Profile>. ๐
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no profile matching the criteria could be found. ๐ญ
๐ profiles(**query) ๐
Retrieve a generator of profiles. ๐
Parameters
queryโ optional query parameters to be sent to restrict the profiles to be returned. Available parameters include:name: the name of a profile. ๐ท๏ธtype: the type name of a profile. ๐งmetadata: a list of key-value pairs that are associated with a profile. ๐๏ธsort: a list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier which can beascordesc. ๐limit: requests a specified size of returned items from the query. Returns a number of items up to the specified limit value. ๐ขmarker: specifies the ID of the last-seen item. Use thelimitparameter to make an initial limited request and use the ID of the last-seen item from the response as themarkerparameter value in a subsequent limited request. ๐global_project: a boolean value indicating whether profiles from all projects will be returned. ๐
Returns A generator of profile instances. ๐ฆ
๐ update_profile(profile, **attrs) ๐
Update a profile. ๐ง
Parameters
profileโ either the name or the ID of the profile, or an instance ofProfile <#openstack.clustering.v1.profile.Profile>. ๐ซถattrsโ the attributes to update on the profile represented by the value parameter. โจ
Returns The updated profile. ๐
๐ validate_profile(**attrs) ๐
Validate a profile spec. โ
Parameters
attrsโ keyword arguments that will be used to create aProfileValidate, it is comprised of the properties on theProfileclass. ๐งต
Returns The results of profile validation. ๐
๐ Policy Type Operations ๐
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
โญ policy_types(**query) โญ
Get a generator of policy types. ๐
Returns A generator of objects that are of type PolicyType <#openstack.clustering.v1.policy_type.PolicyType>. ๐
โญ get_policy_type(policy_type) โญ
Get the details about a policy type. ๐
Parameters
policy_typeโ the name of apoicy_typeor an object ofPolicyType <#openstack.clustering.v1.policy_type.PolicyType>. ๐ซถ
Returns A PolicyType <#openstack.clustering.v1.policy_type.PolicyType> object. ๐
Raises NotFoundException when no policy_type matching the name could be found. ๐ญ That's the whole mood โ if it's not there, it's not there, and the SDK will respectfully tell you so.
โจ Policy Operations โจ
Okay bestie, deep breath, because the constructor on this one is long โ but it's the same flavour of constructor every proxy in this file uses, so once you've read it once you've read it a hundred times. Here it is, character for character, no cap:
class openstack.clustering.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Slay. Now the actual methods ๐
create_policy(**attrs)
Create a new policy from attributes. Fresh policy, brand new, main character energy โจ
Parameters
attrsโ Keyword arguments that will be used to create aPolicy, it is comprised of the properties on thePolicyclass.
Returns
The results of policy creation.
delete_policy(policy, ignore_missing=True)
Delete a policy. Bye bestie ๐ซถ
Parameters
policyโ The value can be either the name or ID of a policy or aPolicyinstance.ignore_missingโ When set toFalse, an exceptionNotFoundExceptionwill be raised when the policy could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent policy.
Returns
None
find_policy(name_or_id, ignore_missing=True)
Find a single policy. Just the one. One (1) policy, please ๐
Parameters
name_or_idโ The name or ID of a policy.ignore_missingโ When set toFalseNotFoundExceptionwill be raised when the specified policy does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent policy.
Returns
A policy object or None.
get_policy(policy)
Get a single policy. The way this one *fetches*โฆ obsessed ๐
Parameters
policyโ The value can be the name or ID of a policy or aPolicyinstance.
Returns
A policy object.
Raises NotFoundException when no policy matching the criteria could be found.
policies(**query)
Retrieve a generator of policies. Generator = it hands you items one at a time as you loop, so you're not waiting on the whole list to load. Iconic behaviour, honestly ๐ฆ
Parameters
queryโ Optional query parameters to be sent to restrict the policies to be returned. Available parameters include:name: The name of a policy.type: The type name of a policy.sort: A list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier which can beascordesc.limit: Requests a specified size of returned items from the query. Returns a number of items up to the specified limit value.marker: Specifies the ID of the last-seen item. Use thelimitparameter to make an initial limited request and use the ID of the last-seen item from the response as themarkerparameter value in a subsequent limited request.global_project: A boolean value indicating whether policies from all projects will be returned.
Returns
A generator of policy instances.
update_policy(policy, **attrs)
Update a policy. Glow-up time ๐ฅ
Parameters
policyโ Either the name or the ID of a policy, or an instance ofPolicy.attrsโ The attributes to update on the policy represented by the value parameter.
Returns
The updated policy.
validate_policy
That's it. That's the whole entry. No parameters, no returns, no extra lore โ literally just validate_policy sitting there being mysterious ๐ Don't @ me, that's what's in the source.
๐ Cluster Operations ๐
Same constructor, same vibes, different resource. Behold:
class openstack.clustering.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_cluster(**attrs)
Create a new cluster from attributes. New cluster just dropped ๐ธ
Parameters
attrsโ Keyword arguments that will be used to create aCluster, it is comprised of the properties on theClusterclass.
Returns
The results of cluster creation.
delete_cluster(cluster, ignore_missing=True, force_delete=False)
Delete a cluster. Note the extra flag here, bestie โ that force_delete is doing heavy lifting ๐
Parameters
clusterโ The value can be either the name or ID of a cluster or aClusterinstance.ignore_missingโ When set toFalse, an exceptionNotFoundExceptionwill be raised when the cluster could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent cluster.force_deleteโ When set toTrue, the cluster deletion will be forced immediately.
Returns
The instance of the Cluster which was deleted.
โ ๏ธ Heads up: force_delete forces the deletion immediately. That's not a gentle nudge, that's a yeet. Make sure that's actually what you want ๐
find_cluster(name_or_id, ignore_missing=True)
Find a single cluster. Sherlock mode ๐
Parameters
name_or_idโ The name or ID of a cluster.ignore_missingโ When set toFalseNotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns
One Cluster object or None
get_cluster(cluster)
Get a single cluster. Lowkey the simplest one here ๐
Parameters
clusterโ The value can be the name or ID of a cluster or aClusterinstance.
Returns
One Cluster
Raises NotFoundException when no cluster matching the criteria could be found.
clusters(**query)
Retrieve a generator of clusters. Same generator deal as before โ one at a time, no stress โจ
Parameters
queryโ Optional query parameters to be sent to restrict the clusters to be returned. Available parameters include:name: The name of a cluster.status: The current status of a cluster.sort: A list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier which can beascordesc.limit: Requests a specified size of returned items from the query. Returns a number of items up to the specified limit value.marker: Specifies the ID of the last-seen item. Use thelimitparameter to make an initial limited request and use the ID of the last-seen item from the response as themarkerparameter value in a subsequent limited request.global_project: A boolean value indicating whether clusters from all projects will be returned.
Returns
A generator of cluster instances.
update_cluster(cluster, **attrs)
Update a cluster. Give it a little refresh ๐
Parameters
clusterโ Either the name or the ID of the cluster, or an instance ofCluster.attrsโ The attributes to update on the cluster represented by theclusterparameter.
Returns
The updated cluster.
add_nodes_to_cluster(cluster, nodes)
Add nodes to a cluster. Growing the squad ๐
Parameters
nodesโ the list of nodes you're adding in ๐ซถ
Returns โ a dict holding the action this operation kicked off. โจ
remove_nodes_from_cluster(cluster, nodes, **params)
Bye bestie ๐ โ this one takes nodes out of a cluster.
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).nodesโ list of nodes to be removed from the cluster.paramsโ optional query parameters sent along to restrict the nodes to be returned. The available ones include:destroy_after_deletion: a boolean value indicating whether the deleted nodes get destroyed right away ๐
Returns โ a dict containing the action initiated by this operation.
replace_nodes_in_cluster(cluster, nodes)
Swaps the nodes in a cluster out for the specified ones โ out with the old, in with the new ๐
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).nodesโ list of nodes to be deleted/added to the cluster.
Returns โ a dict containing the action initiated by this operation.
scale_out_cluster(cluster, count=None)
Inflates the size of a cluster. Bigger. More. Go off ๐๐
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).countโ optional parameter specifying the number of nodes to be added.
Returns โ a dict containing the action initiated by this operation.
scale_in_cluster(cluster, count=None)
Shrinks the size of a cluster. It's giving minimalism ๐
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).countโ optional parameter specifying the number of nodes to be removed.
Returns โ a dict containing the action initiated by this operation.
resize_cluster(cluster, **params)
Resize of cluster. Lowkey the glow-up button ๐ฆ
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).paramsโ a dictionary providing the parameters for the resize action.
Returns โ a dict containing the action initiated by this operation.
attach_policy_to_cluster(cluster, policy, **params)
Binds a policy onto a cluster. It's official now ๐
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).policyโ either the name or the ID of a policy.paramsโ a dictionary containing the properties for the policy to be attached.
Returns โ a dict containing the action initiated by this operation.
detach_policy_from_cluster(cluster, policy)
Unbinds a policy from a cluster. We don't gatekeep ๐ซถ
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).policyโ either the name or the ID of a policy.
Returns โ a dict containing the action initiated by this operation.
update_cluster_policy(cluster, policy, **attrs)
Changes the properties of a policy that's bound to the cluster โ a lil makeover for the policy โจ๐
Parameters
clusterโ either the name or the ID of the cluster, or an instance ofCluster(openstack.clustering.v1.cluster.Cluster).policyโ either the name or the ID of a policy.attrsโ a dictionary containing the new properties for the policy.
Returns โ a dict containing the action initiated by this operation.
collect_cluster_attrs(cluster, path, **query)
Collects attribute values across a whole cluster โ like a vibe check but for attributes ๐
Parameters
clusterโ the value can be either the ID of a cluster or aCluster(openstack.clustering.v1.cluster.Cluster) instance.pathโ a Json path string specifying the attribute to collect.queryโ optional query parameters to be sent to limit the resources being returned.
Returns โ a dictionary containing the list of attribute values.
check_cluster(cluster, **params)
Checks a cluster. Wellness check time ๐ฉบ
Parameters
clusterโ the value can be either the ID of a cluster or aCluster(openstack.clustering.v1.cluster.Cluster) instance.paramsโ a dictionary providing the parameters for the check action.
Returns โ a dictionary containing the action ID.
recover_cluster(cluster, **params)
recover a cluster. Healing era ๐
Parameters
clusterโ the value can be either the ID of a cluster or aCluster(openstack.clustering.v1.cluster.Cluster) instance.paramsโ a dictionary providing the parameters for the recover action.
Returns โ a dictionary containing the action ID.
perform_operation_on_cluster(cluster, operation, **params)
Performs an operation on the specified cluster โ whatever operation you name, it does the thing ๐ฅ
Parameters
clusterโ the value can be either the ID of a cluster or aCluster(openstack.clustering.v1.cluster.Cluster) instance.operationโ a string specifying the operation to be performed.paramsโ a dictionary providing the parameters for the operation.
Returns โ a dictionary containing the action ID.
cluster_policies(cluster, **query)
Grabs you a generator of cluster-policy bindings โ the whole roster, bestie ๐
Parameters
clusterโ the value can be the name or ID of a cluster or aCluster(openstack.clustering.v1.cluster.Cluster) instance.queryโ optional query parameters to be sent to restrict the policies to be returned. The available ones include:enabled: a boolean value indicating whether the policy is enabled on the cluster.
Returns โ a generator of cluster-policy binding instances.
get_cluster_policy(cluster_policy, cluster)
Gets one specific cluster-policy binding. The main character of bindings ๐
Parameters
cluster_policyโ the value can be the name or ID of a policy or aPolicy(openstack.clustering.v1.policy.Policy) instance.clusterโ the value can be the name or ID of a cluster or aCluster(openstack.clustering.v1.cluster.Cluster) instance.
Returns โ a cluster-policy binding object.
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no cluster-policy binding matching the criteria could be found. ๐ญ
๐ธ Node Operations ๐ธ
Okay so real talk, this is the same Proxy class, just the node-flavoured half of it. Same constructor args, same everything, no cap:
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_node(**attrs)
Creates a brand-new node out of attributes. Birth of a node, iconic ๐โญ
Parameters
attrsโ keyword arguments that will be used to create aNode(openstack.clustering.v1.node.Node); it's comprised of the properties on theNodeclass.
Returns โ the results of node creation.
delete_node(node, ignore_missing=True, force_delete=False)
Deletes a node.
nodeโ literally just the name or ID of a node, or a wholeNodeinstance, whichever you vibe with ๐ซถignore_missingโ if you set this toFalse, an exceptionNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the node can't be found. Set it toTrueand nobody panics when you try to delete a node that straight-up doesn't exist ๐force_deleteโ set toTrueand the node deletion gets forced immediately, no waiting around โจ
Returns The instance of the Node which was deleted. Slay.
find_node(name_or_id, ignore_missing=True)
Find a single node. Just the one. Your main character node ๐
Parameters
name_or_idโ the name or ID of a node.ignore_missingโ when set to"False",NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the specified node doesn't exist. When set to"True",Nonewill be returned when attempting to find a nonexistent policy ๐
Returns One Node <#openstack.clustering.v1.node.Node> object or None.
get_node(node, details=False)
Get a single node โ lowkey the same energy as find_node but with a lil extra.
Parameters
nodeโ the value can be the name or ID of a node or aNode <#openstack.clustering.v1.node.Node>instance.detailsโ an optional argument that says whether the server should return more details when retrieving the node data ๐
Returns One Node <#openstack.clustering.v1.node.Node>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no node matching the name or ID could be found. That's it, that's the vibe check.
nodes(**query)
Retrieve a generator of nodes. A whole generator, not a list โ bestie's efficient like that ๐
Parameters
query โ optional query parameters sent along to restrict which nodes come back. The available ones are:
cluster_id: a string including the name or ID of a cluster that the resulted node(s) is a member of.name: the name of a node.status: the current status of a node.sort: a list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier, which can beascordesc.limit: requests at most the specified number of items be returned from the query.marker: specifies the ID of the last-seen node. Use thelimitparameter to make an initial limited request, then use the ID of the last-seen node from the response as themarkerparameter value in a subsequent limited request. Paging, but make it cute โจglobal_project: a boolean value indicating whether nodes from all projects will be returned.
Returns A generator of node instances. Obsessed.
update_node(node, **attrs)
Update a node. Glow-up time ๐
Parameters
nodeโ either the name or the ID of the node, or an instance ofNode <#openstack.clustering.v1.node.Node>.attrsโ the attributes to update on the node represented by thenodeparameter.
Returns The updated node. Iconic.
check_node(node, **params)
Check the health of the specified node. Doctor's appointment, but for infrastructure ๐ฉบ
Parameters
nodeโ the value can be either the ID of a node or aNode <#openstack.clustering.v1.node.Node>instance.paramsโ a dictionary providing the parametes to the check action. (Yes, "parametes" โ that's literally how the docs spell it, I'm not fixing it, character for character bestie ๐ญ)
Returns A dictionary containing the action ID.
recover_node(node, **params)
Recover the specified node into healthy status. Healing arc ๐
Parameters
nodeโ the value can be either the ID of a node or aNode <#openstack.clustering.v1.node.Node>instance.paramsโ a dict supplying parameters to the recover action.
Returns A dictionary containing the action ID.
adopt_node(preview=False, **attrs)
Adopting an existing resource as a node. Found family trope, honestly ๐ซถ
Parameters
previewโ a boolean indicating whether this is a "preview" operation, which means only the profile to be used is returned rather than creating a node object using that profile.attrsโ keyword parameters for node adoption. Valid parameters include:type: (Required) a string containing the profile type and version to be used for node adoption. For example,os.nova.sever-1.0.identity: (Required) a string including the name or ID of an OpenStack resource to be adopted as a Senlin node.name: (Optional) the name of node to be created. Omitting this parameter will have the node named automatically.snapshot: (Optional) a boolean indicating whether a snapshot of the target resource should be created if possible. Default isFalse.metadata: (Optional) a dictionary of arbitrary key-value pairs to be associated with the adopted node.overrides: (Optional) a dictionary of key-value pairs to be used to override attributes derived from the target resource.
Returns The result of node adoption. If preview is set to False (default โ that's the default btw), returns a Node <#openstack.clustering.v1.node.Node> object, otherwise a Dict is returned containing the profile to be used for the new node. Two different returns, iykyk ๐ซ
perform_operation_on_node(node, operation, **params)
Perform an operation on the specified node. Whatever operation. Go off ๐
Parameters
nodeโ the value can be either the ID of a node or aNode <#openstack.clustering.v1.node.Node>instance.operationโ a string specifying the operation to be performed.paramsโ a dictionary providing the parameters for the operation.
Returns A dictionary containing the action ID.
๐ Receiver Operations ๐
Here she is โ the whole Proxy class, every single keyword arg, no skips, no cap ๐
class openstack.clustering.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_receiver(**attrs)
Create a new receiver from attributes. Fresh out the box ๐ฆ
Parameters
attrs โ keyword arguments that will be used to create a Receiver <#openstack.clustering.v1.receiver.Receiver>. It's comprised of the properties on the Receiver class.
Returns The results of receiver creation. Ate.
update_receiver(receiver, **attrs)
Update a receiver.
Parameters
receiverโ the value can be either the name or ID of a receiver or aReceiver <#openstack.clustering.v1.receiver.Receiver>instance.attrsโ the attributes to update on thereceiverparameter. Valid attribute names includename,actionandparams.
Returns The updated receiver.
delete_receiver(receiver, ignore_missing=True)
Delete a receiver. Bye bestie ๐
Parameters
receiverโ the value can be either the name or ID of a receiver or aReceiver <#openstack.clustering.v1.receiver.Receiver>instance.ignore_missingโ when set toFalse, an exceptionNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the receiver could not be found. When set toTrue, no exception will be raised when attempting to delete a non-existent receiver.
Returns None
find_receiver(name_or_id, ignore_missing=True)
Find a single receiver.
Parameters
name_or_idโ the name or ID of a receiver.ignore_missingโ set this toFalseand boom, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised the second the receiver you're looking for isn't there. Set it toTrueinstead and you just getNoneback when it can't find a nonexistent receiver. โจ
Returns โ a receiver object, or None. ๐ซถ
get_receiver(receiver)
Get one (1) single receiver, bestie.
Parameters
receiverโ this can be the name or the ID of a receiver, or you can straight up hand it aReceiver <#openstack.clustering.v1.receiver.Receiver>instance.
Returns โ a receiver object. ๐
Raises NotFoundException <#openstack.exceptions.NotFoundException> when there's literally no receiver matching what you asked for. ๐ญ
receivers(**query)
Retrieve a generator of receivers.
Parameters
queryโ
Optional query parameters for restricting which receivers come back. The available ones include:
name: the name of a receiver object.type: the type of receiver objects.cluster_id: the ID of the associated cluster.action: the name of the associated action.sort: a list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier, which can beascordesc.global_project: a boolean value indicating whether receiversfrom all projects will be returned.
Returns โ a generator of receiver instances. ๐
๐ฅ Action Operations ๐ฅ
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_action(action)
Get a single action. Just the one. ๐
Parameters
actionโ the value can be the name or ID of an action, or aAction <#openstack.clustering.v1.action.Action>instance.
Returns โ an action object. โญ
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no action matching the criteria could be found. ๐
actions(**query)
Retrieve a generator of actions.
Parameters
queryโ
Optional query parameters to be sent to restrict which actions come back. The available ones include:
name: name of action for query.target: ID of the target object for which the actions should be returned.action: built-in action types for query.sort: a list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier, which can beascordesc.limit: requests a specified size of returned items from the query. Returns a number of items up to the specified limit value.marker: specifies the ID of the last-seen item. Use thelimitparameter to make an initial limited request, then use the ID of the last-seen item from the response as themarkerparameter value in a subsequent limited request. iykyk ๐
Returns โ a generator of action instances. ๐ฆ
๐ธ Event Operations ๐ธ
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_event(event)
Get a single event, no cap. ๐
Parameters
eventโ the value can be the name or ID of an event, or aEvent <#openstack.clustering.v1.event.Event>instance.
Returns โ an event object. ๐
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no event matching the criteria could be found. ๐
events(**query)
Retrieve a generator of events.
Parameters
queryโ
Optional query parameters to be sent to restrict which events come back. The available ones include:
obj_name: name string of the object associated with an event.obj_type: type string of the object related to an event. The value can becluster,node,policyetc.obj_id: ID of the object associated with an event.cluster_id: ID of the cluster associated with the event, if any.action: name of the action associated with an event.sort: a list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier, which can beascordesc.limit: requests a specified size of returned items from the query. Returns a number of items up to the specified limit value.marker: specifies the ID of the last-seen item. Use thelimitparameter to make an initial limited request, then use the ID of the last-seen item from the response as themarkerparameter value in a subsequent limited request.global_project: a boolean specifying whether events from all projects should be returned. Heads up bestie โ this option is subject to access control checking. ๐
Returns โ a generator of event instances. โจ
๐ง Helper Operations ๐ง
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
wait_for_status(res, status, failures=None, interval=2, wait=None, attribute='status', callback=None)
Wait for the resource to be in a particular status. It's giving "are we there yet" but make it infrastructure. ๐๐จ
Parameters
sessionโ the session to use for making this request.resourceโ the resource to wait on to reach the status. The resource must have a status attribute specified viaattribute.statusโ desired status of the resource.failuresโ statuses that would indicate the transition failed, such as'ERROR'. Defaults to['ERROR'].intervalโ number of seconds to wait between checks.waitโ maximum number of seconds to wait for transition. Set toNoneto wait forever. ๐ณattributeโ name of the resource attribute that contains the status.callbackโ a callback function. This will be called with a single value,progress. This is API specific but is generally a percentage value from0-100. ๐
Returns โ the updated resource. ๐
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if the transition to status failed to occur in wait seconds. โฐ
Raises ResourceFailure <#openstack.exceptions.ResourceFailure> if the resource transitioned to one of the states in failures. ๐
Raises AttributeError if the resource does not have a status attribute. ๐ซ
wait_for_delete(res, interval=2, wait=120, callback=None) โ okay so this one just waits for a resource to be yeeted into the void. Patience is the vibe ๐
Parameters:
resโ the resource you're waiting on to be deleted. like, "please be gone bestie" ๐ซถintervalโ how many seconds to wait between two consecutive checks.waitโ the max number of seconds to wait before the change happens.callbackโ a callback function ๐ it gets called with a single value,progress, which is a percentage value from0-100.
Returns: the resource is returned on success, slay.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if the transition to delete failed to occur in the specified seconds. so like, if the deletion ghosted you entirely ๐ญ set your wait higher, ngl.
๐ Service Operations ๐
class openstack.clustering.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
services(**query) โ get a generator of services. that's it, that's the whole function, main character energy ๐
Returns: a generator of objects that are of type Service.
๐ป Compute API ๐ป
For the full tea on how to use compute, see Using OpenStack Compute <>. ๐ฅ
๐ฅ๏ธ The Compute Class ๐ฅ๏ธ
The compute high-level interface is available through the compute member of a Connection <#openstack.connection.Connection> object. Heads up though: the compute member only gets added if the service is actually detected. so if it's not there, it's not being shady, the service just isn't there bestie ๐
๐ธ Server Operations ๐ธ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_server(**attrs) โ spin up a brand new server from attributes. iconique โจ
Parameters:
attrsโ keyword arguments which will be used to create aServer<#openstack.compute.v2.server.Server>, comprised of the properties on theServerclass.
Returns: the results of server creation ๐
delete_server(server, ignore_missing=True, force=False) โ delete a server. bye bestie ๐
Parameters:
serverโ the value can be either the ID of a server or aServer<#openstack.compute.v2.server.Server> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the server does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent server.forceโ when set toTrue, the server deletion will be forced immediately. like ripping off the bandaid ๐ฅ
Returns: None
find_server(name_or_id, ignore_missing=True, *, details=True, all_projects=False) โ find a single server. detective mode ๐ต๏ธโโ๏ธ
Parameters:
name_or_idโ the name or ID of a server.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.detailsโ when set toFalse, instances with only basic data will be returned. The default,True, will cause instances with full data to be returned.all_projectsโ when set toTrue, search for server by name across all projects. Note that this will likely result in a higher chance of duplicates. Admin-only by default, so like, don't try it if you're not admin ๐
Returns: one Server <#openstack.compute.v2.server.Server> or None
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found. (yup, that's the duplicate situation we literally just warned you about ๐ญ)
get_server(server) โ get a single server.
Parameters:
serverโ the value can be the ID of a server or aServer<#openstack.compute.v2.server.Server> instance.
Returns: one Server <#openstack.compute.v2.server.Server>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
servers(details=True, all_projects=False, **query) โ retrieve a generator of servers. all of them. every single one ๐ฆ
Parameters:
detailsโ when set toFalse, instances with only basic data will be returned. The default,True, will cause instances with full data to be returned.all_projectsโ when set toTrue, lists servers from all projects. Admin-only by default.queryโ optional query parameters to be sent to limit the servers being returned. available parameters can be seen under <https://docs.openstack.org/api-ref/compute/#list-servers> ๐
Returns: a generator of server instances.
update_server(server, **attrs) โ update a server. glow-up time โจ
Parameters:
serverโ either the ID of a server or aServer<#openstack.compute.v2.server.Server> instance.attrsโ the attributes to update on the server represented byserver.
Returns: the updated server.
create_server_image(server, name, metadata=None, wait=False, timeout=120) โ create an image from a server. turning your server into a whole photoshoot ๐ธ
Parameters:
serverโ either the ID of a server or aServer<#openstack.compute.v2.server.Server> instance.nameโ the name of the image to be created.metadataโ a dictionary of metadata to be set on the image.
Returns: Image <#openstack.image.v2.image.Image> object.
backup_server(server, name, backup_type, rotation, *, wait=False, timeout=120) โ backup a server. safety first, always ๐ซถ
Parameters:
serverโ either the ID of a server or aServer<#openstack.compute.v2.server.Server> instance.nameโ the name of the backup image.backup_typeโ the type of the backup, for example,daily.rotationโ the rotation of the back up image, the oldest image will be removed when image count exceed the rotation count.wait(bool) โ ifTrue, waits for image to reach active status before returning.timeout(int) โ the maximum number of seconds to wait for the image to become active whenwaitisTrue.
Returns: Image <#openstack.image.v2.image.Image> object.
get_server_metadata(server) โ return a dictionary of metadata for a server.
Deprecated since version4.14.0: usefetch_server_metadata()instead. like, it still works but it's giving legacy, ok? move on bestie ๐
set_server_metadata(server, **metadata) โ update metadata for a server.
Parameters:
serverโ either the ID of a server or aServer<#openstack.compute.v2.server.Server> instance.metadataโ key/value pairs to be updated in the server's metadata. no other metadata is modified by this call. so it's surgical, not chaotic ๐
Returns: a Server <#openstack.compute.v2.server.Server> with only the server's metadata.
delete_server_metadata(server, keys=None) โ delete metadata for a server.
Note: this method will do a HTTPDELETErequest for every key inkeys. like one request per key, fr fr, so don't hand it a hundred keys and then act surprised ๐ญ
Parameters:
serverโ either the ID of a server or aServer<#openstack.compute.v2.server.Server> instance.keysโ the keys to delete. If omitted, all metadata is removed. all of it. gone. ๐งน
Returns: None
wait_for_server(server, status='ACTIVE', failures=None, interval=2, wait=120, callback=None) โ wait for a server to be in a particular status. the classic "is it up yet" moment ๐
Parameters:
server(Server) โ the actualServeryou're waiting on to hit that status. Like, the whole point of the call ๐status(str) โ the status you want it to reach.failures(list) โ a list of statuses that count as an L, i.e. if the server lands on any of these, it's a fail.interval(int) โ how many seconds to wait between two consecutive checks. Defaults to2.waitโ max number of seconds to wait before the change happens. Defaults to120.callback(callable) โ a callback function. It gets called with a single value,progress, which is a percentage from0-100. So cute for progress bars ๐
Returns
The resource comes back to you on success. ๐ซถ
Raises ResourceTimeout if the transition to the desired status didn't happen within the seconds you specified. Yeah, it gave up on you.
Raises ResourceFailure if the resource has transited into one of the failure statuses. Oop.
Raises AttributeError if the resource doesn't even have a status attribute. Not the resource being mysterious, just the resource being broken ๐ญ
๐ Network Actions ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
fetch_server_security_groups(server)
Fetches the security groups for a server, with details. Bestie, the details are the whole point.
Parameters
serverโ either the ID of a server or aServerinstance.
Returns
an updated Server instance. Slay.
add_security_group_to_server(server, security_group)
Adds a security group to a server. Giving it a lil outfit โจ
Parameters
serverโ either the ID of a server or aServerinstance.security_groupโ either the ID or name of a security group, or aSecurityGroupinstance.
Returns
None
remove_security_group_from_server(server, security_group)
Removes a security group from a server. Taking the outfit back, no hard feelings ๐
Parameters
serverโ either the ID of a server or aServerinstance.security_groupโ either the ID or name of a security group, or aSecurityGroupinstance.
Returns
None
add_fixed_ip_to_server(server, network)
Adds a fixed IP address to a server instance. A permanent little address, iconic.
Parameters
serverโ either the ID of a server or aServerinstance.networkโ the ID, or aNetworkinstance, of the network from which a fixed IP address is about to be allocated.
Returns
None
remove_fixed_ip_from_server(server, address)
Removes a fixed IP address from a server instance. Bye girl ๐
Parameters
serverโ either the ID of a server or aServerinstance.addressโ the fixed IP address to be disassociated from the server.
Returns
None
add_floating_ip_to_server(server, address, fixed_address=None)
Adds a floating IP address to a server instance. Floating! Very main character energy ๐
Parameters
serverโ either the ID of a server or aServerinstance.addressโ the floating IP address to be added to the server.fixed_addressโ the fixed IP address to be associated with the floating IP address. Used when the server is connected to multiple networks. Like, specify which one, bestie.
Returns
None
remove_floating_ip_from_server(server, address)
Removes a floating IP address from a server instance. Floating no more ๐ฆ
Parameters
serverโ either the ID of a server or aServerinstance.addressโ the floating IP address to be disassociated from the server.
Returns
None
๐ฅ Starting, Stopping, etc. ๐ฅ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
reboot_server(server, reboot_type)
Reboots a server. The classic turn-it-off-and-on-again, but make it cloud โ๏ธ
Parameters
serverโ either the ID of a server or aServerinstance.reboot_typeโ the type of reboot to perform."HARD"and"SOFT"are the current options. That's it, those are the two.
Returns
None
pause_server(server)
Pauses a server and changes its status to PAUSED. Time out, bestie, take a breather ๐ง
Parameters
serverโ either the ID of a server or aServerinstance.
Returns
None
unpause_server(server)
Unpauses a paused server and changes its status to ACTIVE. Welcome back, we missed you ๐
Parameters
serverโ either the ID of a server or aServerinstance.
Returns
None
suspend_server(server)
Suspends a server and changes its status to SUSPENDED. Not a pause โ an actual suspend, okay, they're different ๐ญ
Parameters
serverโ either the ID of a server or aServerinstance.
Returns
None
resume_server(server)
Resumes a suspended server and changes its status to ACTIVE. And we're back, periodt ๐ฅ
Parameters
serverโ either the ID of a server or aServerinstance.
Returns
None
lock_server(server, locked_reason=None)
Locks a server. Nobody touches her, she's booked and busy ๐
Parameters
serverโ either the ID of a server or aServerinstance.locked_reasonโ the reason behind locking the server. Limited to255characters in length. Keep it short, it's not a notes app.
Returns
None
unlock_server(server)
Unlocks a locked server. Free her ๐
Parameters
serverโ either the ID of a server or aServerinstance.
Returns
None
rescue_server(server, admin_pass=None, image=None)
Puts a server in rescue mode and changes its status to RESCUE. Not a glow-up โ a rescue ๐
Parameters
serverโ either the ID of a server or aServerinstance.admin_passโ the password for the rescued server. If you omit this parameter, the operation generates a new password. So like, don't panic if you skip it.imageโ the image reference to use to rescue your server. This can be the image ID or its full URL. If you omit this parameter, the base image reference will be used.
Returns
None
unrescue_server(server)
Unrescues a server and changes its status to ACTIVE. She's healed ๐
Parameters
serverโ either the ID of a server or aServerinstance.
Returns
None
evacuate_server(server, host=None, admin_pass=None, force=None, *, on_shared_storage=None)
Evacuates a server from a failed host to a new host. Moving day, but make it emergency ๐โโ๏ธ
Lowkey dramatic: this one is for when a host has failed.
Parameters
serverโ either the ID of a server or aServerinstance.
Still in the same server-move moment โ hereโs the rest of the param tea:
hostโ An optional parameter specifying the name or ID of the host to which the server is evacuated.admin_passโ An optional parameter specifying the administrative password to access the evacuated or rebuilt server.forceโ Force an evacuation by not verifying the provided destination host by the scheduler. (New in API version 2.29).on_shared_storageโ Whether the host is using shared storage. (Optional) (Only supported before API version 2.14)
Returns: None
๐ฆ start_server(server)
Starts a stopped server and changes its state to ACTIVE. Literally waking the poor thing up.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.
Returns: None
๐ธ stop_server(server)
Stops a running server and changes its state to SHUTOFF. Nap time, served.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.
Returns: None
๐ restore_server(server)
Restore a soft-deleted server. Bringing it back from the soft-delete void, no cap.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.
Returns: None
๐ shelve_server(server)
Shelves a server.
All associated data and resources are kept but anything still in memory is not retained. Policy defaults enable only users with administrative role or the owner of the server to perform this operation. Cloud provides could change this permission though.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.
Returns: None
โจ unshelve_server(server, *, host=None, availability_zone=Unset.UNSET)
Unshelves or restores a shelved server.
Policy defaults enable only users with administrative role or the owner of the server to perform this operation. Cloud provides could change this permission though.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.hostโ An optional parameter specifying the name the compute host to unshelve to. (New in API version 2.91).
Returns: None
๐ migrate_server(server, *, host=None)
Migrate a server from one host to another. Moving day, but make it cloud.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.hostโ The host to which to migrate the server.
Returns: None
๐ฅ live_migrate_server(server, host=None, force=False, block_migration=None, disk_over_commit=None)
Live migrate a server from one host to target host. Yes, live โ the server stays up while it moves, iconic behavior.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.hostโ The host to which to migrate the server. If the Nova service is too old, thehostparameter impliesforce=Truewhich causes the Nova scheduler to be bypassed. On such clouds, aValueErrorwill be thrown ifhostis given withoutforce.forceโ Force a live-migration by not verifying the provided destination host by the scheduler. This is unsafe and not recommended.block_migrationโ Perform a block live migration to the destination host by the scheduler. Can be'auto',TrueorFalse. Some clouds are too old to support'auto', in which case aValueErrorwill be thrown. If omitted, the value will be'auto'on clouds that support it, andFalseon clouds that do not.disk_over_commitโ Whether to allow disk over-commit on the destination host. (Optional)
Returns: None
๐ Modifying a Server ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ง change_server_password(server, new_password)
Change the administrator password. New password, who dis?
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.new_passwordโ The new password to be set.
Returns: None
๐ get_server_password(server)
Get the administrator password. No, Iโm not telling you what it is โ the API will.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.
Returns: encrypted password.
๐ซถ reset_server_state(server, state)
Reset the state of server. State machine? More like state situation.
Parameters:
serverโ The server can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>.stateโ The state of the server to be set,activeorerrorare valid.
Returns: None
๐ rebuild_server(server, image, **attrs)
Rebuild a server. Fresh start energy, but for compute.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.nameโ The name of the serveradmin_passwordโ The administrator passwordpreserve_ephemeralโ Indicates whether the server is rebuilt with the preservation of the ephemeral partition. Default:Falseimageโ The id of an image to rebuild with. Default:Noneaccess_ipv4โ The IPv4 address to rebuild with. Default:Noneaccess_ipv6โ The IPv6 address to rebuild with. Default:Nonemetadataโ A dictionary of metadata to rebuild with. Default:Nonepersonalityโ A list of dictionaries, each including apathandcontentskey, to be injected into the rebuilt server at launch. Default:None
Returns: The rebuilt Server <#openstack.compute.v2.server.Server> instance.
๐ resize_server(server, flavor)
Resize a server. Glow-up, but make it flavor-based.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.flavorโ Either the ID of a flavor or aFlavor <#openstack.compute.v2.flavor.Flavor>instance.
Returns: None
โญ confirm_server_resize(server)
Confirm a server resize. Lock it in, bestie.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.
Returns: None
๐ revert_server_resize(server)
Revert a server resize. Actually, never mind โ take it back.
Parameters:
serverโ Either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance.
Returns: None
๐ Image Operations ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ธ delete_image(image, ignore_missing=True)
Delete an image. Bye-bye, snapshot queen.
Parameters:
imageโ The value can be either the ID of an image or aImage <#openstack.compute.v2.image.Image>instance.ignore_missingโ okay so when this isFalse, aNotFoundExceptiongets raised if the image literally doesn't exist. Set it toTrueand no exception at all when you try to delete a nonexistent image โ it just vibes. ๐
Returns Nothing, bestie. None. ๐ซถ
find_image(name_or_id, ignore_missing=True) Find a single image ๐ฏ
Parameters
name_or_idโ the name or ID of a image.ignore_missingโ when set toFalse, aNotFoundExceptiongets raised when the resource doesn't exist. When set toTrue,Noneis returned when you go looking for a nonexistent resource instead of the whole thing blowing up.
Returns One Image or None.
Raises NotFoundException when no resource can be found.
Raises DuplicateResource when multiple resources are found. ๐ญ (yes, that's a whole situation)
get_image(image) Get a single image โจ
Parameters
imageโ the value can be the ID of an image or anImageinstance.
Returns One Image.
Raises NotFoundException when no resource can be found.
images(details=True, **query) Return a generator of images ๐
Parameters
detailsโ whenTrue, returnsImageobjects with all available properties, otherwise only basic properties come back. Default:True.queryโ optional query parameters, sent along to limit the resources being returned.
Returns A generator of image objects.
get_image_metadata(image) Return a dictionary of metadata for an image ๐
Deprecated since version 4.14.0: use fetch_image_metadata() instead. Like, she's still here but she's not the moment anymore.
set_image_metadata(image, **metadata) Update metadata for an image ๐ธ
Parameters
imageโ either the ID of an image or anImageinstance.metadataโ key/value pairs to be updated in the image's metadata. No other metadata is modified by this call. Periodt.
Returns An Image with only the image's metadata.
delete_image_metadata(image, keys=None) Delete metadata for an image ๐ฆ
Note: this method will do a HTTP DELETE request for every key in keys. Not me making one request per keyโฆ but that's literally what it does, iykyk.
Parameters
imageโ either the ID of an image or anImageinstance.keysโ the keys to delete. If omitted, all metadata is removed. Gone. โจ
Returns None.
๐ Flavor Operations ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
find_flavor(name_or_id, ignore_missing=True, *, get_extra_specs=False, **query) Find a single flavor ๐
Parameters
name_or_idโ the name or ID of a flavor.ignore_missingโ when set toFalse, aNotFoundExceptiongets raised when the resource doesn't exist. When set toTrue,Noneis returned when attempting to find a nonexistent resource.get_extra_specsโ when set toTrueandextra_specsisn't present in the response, it'll invoke an additional API call to fetchextra_specs.queryโ optional query parameters sent along to limit the flavors being returned.
Returns One Flavor or None.
Raises NotFoundException when no resource can be found.
Raises DuplicateResource when multiple resources are found. ๐
create_flavor(**attrs) Create a new flavor from attributes ๐ง
Parameters
attrsโ keyword arguments which will be used to create aFlavor, comprised of the properties on theFlavorclass.
Returns The results of flavor creation.
delete_flavor(flavor, ignore_missing=True) Delete a flavor ๐
Parameters
flavorโ the value can be either the ID of a flavor or aFlavorinstance.ignore_missingโ when set toFalse, aNotFoundExceptiongets raised when the flavor doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent flavor.
Returns None.
get_flavor(flavor, get_extra_specs=False) Get a single flavor โญ
Parameters
flavorโ the value can be the ID of a flavor or aFlavorinstance.get_extra_specsโ when set toTrueandextra_specsisn't present in the response, it'll invoke an additional API call to fetchextra_specs.
Returns One Flavor.
Raises NotFoundException when no resource can be found.
flavors(details=True, get_extra_specs=False, **query) Return a generator of flavors ๐
Parameters
detailsโ whenTrue, returnsFlavorobjects, with additional attributes filled.get_extra_specsโ when set toTrueandextra_specsisn't present in the response, it'll invoke an additional API call to fetchextra_specs.queryโ optional query parameters sent along to limit the flavors being returned.
Returns A generator of flavor objects.
flavor_add_tenant_access(flavor, tenant) Adds tenant/project access to flavor. ๐ฅ
Parameters
flavorโ either the ID of a flavor or aFlavorinstance.tenantโ the UUID of the tenant.
Returns None.
flavor_remove_tenant_access(flavor, tenant) Removes tenant/project access to flavor. ๐
Parameters
flavorโ either the ID of a flavor or aFlavorinstance.tenantโ the UUID of the tenant.
Returns None.
get_flavor_access(flavor) Lists tenants who have access to private flavor ๐
Parameters
flavorโ either the ID of a flavor or aFlavorinstance.
Returns List of dicts with flavor_id and tenant_id attributes.
fetch_flavor_extra_specs(flavor) Lists Extra Specs of a flavor โจ
Parameters
flavorโ either the ID of a flavor or aFlavorinstance.
Returns One Flavor.
create_flavor_extra_specs(flavor, extra_specs) Lists Extra Specs of a flavor ๐
Parameters
flavorโ either the ID of a flavor or aFlavorinstance.extra_specsโ dict of extra specs.
Returns One Flavor.
get_flavor_extra_specs_property(flavor, prop) Get specific Extra Spec property of a flavor ๐
Parameters
flavorโ either the ID of a flavor or aFlavor <#openstack.compute.v2.flavor.Flavor>instance, bestie. Both work, no cap.propโ the property name. Just the name, okay? ๐
Returns
The string value of the property you asked for. That's it, that's the whole vibe. โจ
update_flavor_extra_specs_property(flavor, prop, val) โ Update a specific Extra Spec property of a flavor. Target acquired, glow-up applied. ๐
flavorโ either the ID of a flavor or aFlavor <#openstack.compute.v2.flavor.Flavor>instance.propโ the property name.valโ the property value. The new fit. ๐
Returns
String value of the requested property.
delete_flavor_extra_specs_property(flavor, prop, ignore_missing=True) โ Delete a specific Extra Spec property of a flavor. It's giving "blocked, unfollowed, deleted." ๐
flavorโ either the ID of a flavor or aFlavor <#openstack.compute.v2.flavor.Flavor>instance.propโ the property name.ignore_missingโ okay so listen ๐ซถ: when this is set toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the flavor or the extra spec doesn't exist. When it's set toTrue, no exception will be set when attempting to delete a nonexistent flavor extra spec. SoTrue= unbothered, moisturized, in her lane. ๐
Returns
None. Nothing. Empty. Iconic minimalism. ๐ฆ
๐ ๏ธ Service Operations ๐ ๏ธ
Look at this constructor, she's long, she's detailed, she ate and left no crumbs ๐:
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None, endpoint_override=None,
version=None, auth=None, user_agent=None, connect_retries=None, logger=None,
allow=None, additional_headers=None, client_name=None, client_version=None,
allow_version_hack=None, global_request_id=None, min_version=None,
max_version=None, default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None, status_code_retry_delay=None,
statsd_client=None, statsd_prefix=None, prometheus_counter=None,
prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
update_service_forced_down(service, host=None, binary=None, forced=True) โ Update a service's forced_down info. Sometimes you just gotta manually declare a service down, iykyk. ๐ฅ
serviceโ either the ID of a service or aService <#openstack.compute.v2.service.Service>instance.hostโ the host where the service runs.binaryโ the name of the service.forcedโ whether or not this service was forced down manually by an administrator after the service was fenced. Yes, that's the literal meaning, don't come for me. ๐
Returns
The updated service instance.
disable_service(service, host=None, binary=None, disabled_reason=None) โ Disable a service. Sorry bestie, you're on timeout. ๐ญ
serviceโ either the ID of a service or aService <#openstack.compute.v2.service.Service>instance.hostโ the host where the service runs.binaryโ the name of the service.disabled_reasonโ the reason of force down a service. Spill the tea, write it down. ๐
Returns
The updated service instance.
enable_service(service, host=None, binary=None) โ Enable a service. Timeout's over, welcome back queen ๐โจ
serviceโ either the ID of a service, aService <#openstack.compute.v2.service.Service>instance, orNone.hostโ the host where the service runs.binaryโ the name of the service.
Returns
The updated service instance.
services(**query) โ Return a generator of service. Generators are lowkey the moment, they don't dump everything at once. ๐ธ
queryโ query parameters.
Returns
A generator of service.
find_service(name_or_id, ignore_missing=True, **query) โ Find a service from a name or an id so you can get the corresponding info. Detective mode: activated ๐ต๏ธโโ๏ธ
name_or_idโ the name or id of a service.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. No drama, justNone. ๐ฆqueryโ additional attributes like'host'.
Returns
One: class:~openstack.compute.v2.service.Service or None.
Raises
NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found. Two answers?? Not the plot twist ๐
delete_service(service, ignore_missing=True) โ Delete a service.
serviceโ the value can be either the ID of a service or aService <#openstack.compute.v2.service.Service>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the service does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent service.
Returns
None.
update_service(service, **attrs) โ Update a service. Glow-up szn ๐
serviceโ either the ID of a service or aService <#openstack.compute.v2.service.Service>instance.attrsโ the attributes to update on the service represented byservice.
Returns
The updated service.
๐ Server Share Operations ๐
And here's the constructor again, same energy, still long, still serving:
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None, endpoint_override=None,
version=None, auth=None, user_agent=None, connect_retries=None, logger=None,
allow=None, additional_headers=None, client_name=None, client_version=None,
allow_version_hack=None, global_request_id=None, min_version=None,
max_version=None, default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None, status_code_retry_delay=None,
statsd_client=None, statsd_prefix=None, prometheus_counter=None,
prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_share_attachment(server, share, **attrs) โ Create a new share attachment from attributes. Matchmaker, matchmaker, attach that share ๐
serverโ the value can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance that the share is attached to.shareโ the value can be the ID of a share or aShareinstance.attrsโ keyword arguments which will be used to create aShareMapping, comprised of the properties on theShareMappingclass. Yes, comprised of, we're fancy now. ๐
Returns
The results of create share.
delete_share_attachment(server, share, ignore_missing=True) โ Delete a share attachment. Unattach. Detach. Release the bond ๐ญ
serverโ the value can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance that the share is attached to.shareโ the value can be the ID of a share or aShareinstance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent resource.
Returns
None.
get_share_attachment(server, share) โ Get a single share attachment. Just one. Quality over quantity, bestie โจ
serverโ the value can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance that the share is attached to.shareโ the value can be the ID of a share or aShareinstance.
Returns
One ShareMapping.
Raises
NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
share_attachments(server, **query) โ Return a generator of share attachments. All of them, streaming in, one by one ๐
serverโ the server can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>.queryโ query parameters.
Returns
A generator of ShareMapping objects ShareMapping.
๐ Volume Attachment Operations ๐
Okay so this is the volume-attachment zone, and yes โ it's the same big proxy class as before, with the same thirty-something kwargs. I'm putting the full signature again because the manual does, and because bestie we do not skip things in this house ๐ซถ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_volume_attachment(server, volume=None, **attrs) โ makes a shiny new volume attachment out of the attributes you pass in โจ
- server โ the value can be either the ID of a server, or a
Server <#openstack.compute.v2.server.Server>instance that the volume is attached to. - volume โ the value can be either the ID of a volume, or a
Volume <#openstack.block_storage.v3.volume.Volume>instance. - attrs โ keyword arguments which will be used to create a
VolumeAttachment <#openstack.compute.v2.volume_attachment.VolumeAttachment>, comprised of the properties on theVolumeAttachmentclass.
Returns: the results of volume attachment creation ๐
update_volume_attachment(server, volume, volume_id=None, **attrs) โ updates a volume attachment
Heads up bestie, this one's important ๐ the underlying API expects a volume ID, not a volume attachment ID. There is currently no way to update volume attachments by their own ID. So don't come for it, that's just how it is ๐ญ
- server โ the value can be either the ID of a server, or a
Server <#openstack.compute.v2.server.Server>instance that the volume is attached to. - volume โ the value can be either the ID of a volume, or a
Volume <#openstack.block_storage.v3.volume.Volume>instance. - volume_id โ the ID of a volume to swap to. If this is not specified, we will default to not swapping the volume.
- attrs โ the attributes to update on the volume attachment represented by volume_attachment.
Returns: None
delete_volume_attachment(server, volume, ignore_missing=True) โ yeets a volume attachment into the void ๐
Same vibe check as above: the underlying API expects a volume ID, not a volume attachment ID. There is currently no way to delete volume attachments by their own ID.
- server โ the value can be either the ID of a server, or a
Server <#openstack.compute.v2.server.Server>instance that the volume is attached to. - volume โ the value can be the ID of a volume, or a
Volume <#openstack.block_storage.v3.volume.Volume>instance. - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the volume attachment does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent volume attachment.
Returns: None
get_volume_attachment(server, volume) โ gets you one single volume attachment ๐
And again, because the universe is testing us: the underlying API expects a volume ID, not a volume attachment ID. There is currently no way to retrieve volume attachments by their own ID.
- server โ the value can be either the ID of a server, or a
Server <#openstack.compute.v2.server.Server>instance that the volume is attached to. - volume โ the value can be the ID of a volume, or a
Volume <#openstack.block_storage.v3.volume.Volume>instance.
Returns: one VolumeAttachment <#openstack.compute.v2.volume_attachment.VolumeAttachment>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ฌ
volume_attachments(server, **query) โ returns a generator of volume attachments, lowkey the comfy way to iterate ๐ธ
- server โ the server can be either the ID of a server, or a
Server <#openstack.compute.v2.server.Server>. - query โ query parameters.
Returns: a generator of VolumeAttachment objects โ VolumeAttachment <#openstack.compute.v2.volume_attachment.VolumeAttachment>
๐ Keypair Operations ๐
Back at it with the exact same proxy class, because consistency is iconic ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_keypair(**attrs) โ creates a fresh new keypair from attributes ๐
- attrs โ keyword arguments which will be used to create a
Keypair <#openstack.compute.v2.keypair.Keypair>, comprised of the properties on theKeypairclass.
Returns: the results of keypair creation โจ
delete_keypair(keypair, ignore_missing=True, user_id=None) โ deletes a keypair, no cap ๐๏ธ
- keypair โ the value can be either the ID of a keypair, or a
Keypair <#openstack.compute.v2.keypair.Keypair>instance. - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the keypair does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent keypair. - user_id โ optional user_id owning the keypair.
Returns: None
get_keypair(keypair, user_id=None) โ gets you a single keypair ๐
- keypair โ the value can be either the ID of a keypair, or a
Keypair <#openstack.compute.v2.keypair.Keypair>instance. - user_id โ optional user_id owning the keypair.
Returns: one Keypair <#openstack.compute.v2.keypair.Keypair>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
find_keypair(name_or_id, ignore_missing=True, *, user_id=None) โ hunts down a single keypair for you, main character energy ๐ต๏ธโโ๏ธ
- name_or_id โ the name or ID of a keypair.
- ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. - user_id โ optional user_id owning the keypair.
Returns: one Keypair <#openstack.compute.v2.keypair.Keypair> or None
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises: DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found. Yeah, if there's more than one match it's gonna be messy ๐
keypairs(**query) โ returns a generator of keypairs, go off ๐ฅ
- query โ optional query parameters to be sent to limit the resources being returned.
Returns: a generator of keypair objects
๐ Server IPs ๐
One more time, the exact same proxy class โ yes the whole kwargs list, here it is, character for character ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
server_ips(server, network_label=None) โ returns a generator of server IPs, iykyk ๐
- server โ the server can be either the ID of a server, or a
Server <#openstack.compute.v2.server.Server>. - network_label โ the name of a particular network to list IP addresses from.
That's the IPs handled โ keep scrolling bestie, the next chunk is literally right below ๐
Returns โ a generator of ServerIP objects โจ that's the last little return from the Server IP zone, bestie.
๐ธ Server Group Operations ๐ธ
okay so these methods hang off the Proxy class, and the full signature is a whole mood โ copy it exactly, no cap:
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_server_group(**attrs) โ create a new server group from attributes
Parameters:
attrsโ keyword arguments that get used to create aServerGroup(openstack.compute.v2.server_group.ServerGroup), made up of the properties on theServerGroupclass. literally building the vibe from the class props ๐
Returns โ the results of server group creation โจ
delete_server_group(server_group, ignore_missing=True) โ delete a server group
Parameters:
server_groupโ the value can be either the ID of a server group or aServerGroup(openstack.compute.v2.server_group.ServerGroup) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the server group does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent server group. bestie said โif itโs not there, we move onโ ๐ซถ
Returns โ None
find_server_group(name_or_id, ignore_missing=True, *, all_projects=False) โ find a single server group
Parameters:
name_or_idโ the name or ID of a server group.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.all_projectsโ when set toTrue, search for server groups by name across all projects. Note that this will likely result in a higher chance of duplicates. Admin-only by default. so true, itโs giving โlook everywhereโ energy ๐
Returns โ one ServerGroup (openstack.compute.v2.server_group.ServerGroup) or None
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
Raises DuplicateResource (openstack.exceptions.DuplicateResource) when multiple resources are found. not two of them, bestie ๐ญ
get_server_group(server_group) โ get a single server group
Parameters:
server_groupโ the value can be the ID of a server group or aServerGroup(openstack.compute.v2.server_group.ServerGroup) instance.
Returns โ a ServerGroup (openstack.compute.v2.server_group.ServerGroup) object.
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
server_groups(*, all_projects=False, **query) โ return a generator of server groups
Parameters:
all_projectsโ when set toTrue, lists servers groups (yes, that's what the page says ๐) from all projects. Admin-only by default.queryโ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of ServerGroup objects ๐
๐ฆ Server Interface Operations ๐ฆ
same Proxy energy, same full signature โ here it is again, exactly:
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_server_interface(server, **attrs) โ create a new server interface from attributes
Parameters:
serverโ the server can be either the ID of a server or aServer(openstack.compute.v2.server.Server) instance that the interface belongs to.attrsโ keyword arguments which will be used to create aServerInterface(openstack.compute.v2.server_interface.ServerInterface), comprised of the properties on theServerInterfaceclass.
Returns โ the results of server interface creation โจ
delete_server_interface(server_interface, server=None, ignore_missing=True) โ delete a server interface
Parameters:
server_interfaceโ the value can be either the ID of a server interface or aServerInterface(openstack.compute.v2.server_interface.ServerInterface) instance.serverโ this parameter need to be specified whenServerInterfaceID is given as value. It can be either the ID of a server or aServer(openstack.compute.v2.server.Server) instance that the interface belongs to.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the server interface does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent server interface.
Returns โ None
get_server_interface(server_interface, server=None) โ get a single server interface
Parameters:
server_interfaceโ the value can be the ID of a server interface or aServerInterface(openstack.compute.v2.server_interface.ServerInterface) instance.serverโ this parameter need to be specified whenServerInterfaceID is given as value. It can be either the ID of a server or aServer(openstack.compute.v2.server.Server) instance that the interface belongs to.
Returns โ one ServerInterface (openstack.compute.v2.server_interface.ServerInterface)
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
server_interfaces(server, **query) โ return a generator of server interfaces
Parameters:
serverโ the server can be either the ID of a server or aServer(openstack.compute.v2.server.Server).queryโ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of ServerInterface objects ๐
๐ Server Tag Operations ๐
one more Proxy signature moment, because the manual page said so and we respect the manual page:
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
add_tag_to_server(server, tag) โ add a tag to a server.
Parameters:
serverโ either the ID of a server or aServer(openstack.compute.v2.server.Server) instance.tagโ the tag to add.
Returns โ None
remove_tag_from_server(server, tag) โ remove a tag from a server.
Parameters:
serverโ either the ID of a server or aServer(openstack.compute.v2.server.Server) instance.tagโ the tag to remove.
Returns โ None
remove_tags_from_server(server) โ remove all tags from a server.
Parameters:
serverโ either the ID of a server or aServer(openstack.compute.v2.server.Server) instance.tagโ the tag to remove. (the page liststaghere even though the signature is justserverโ iconic documentation behavior ๐)
Returns โ None ๐
๐ธ Server External Event Operations ๐ธ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Ok so the methods on this one, bestie ๐
create_server_external_events(events)โ makes one or more server external events. Plural. A whole lil batch. ๐
โ ๏ธ Warning: this API is intended for inter-service communication only (e.g. Neutron, Cyborg notifying Nova about events). So like... it's for the services talking to each other, not for you to be messy with. Respect the group chat boundaries fr fr ๐
Parameters
eventsโ List of dicts, each containing event attributes (name,server_uuid,status,tag).
Returns
A generator of ServerExternalEvent โ a generator, so it's giving "I'll give you the events one at a time, be patient" energy โจ
๐ฆ Availability Zone Operations ๐ฆ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
availability_zones(details=False)โ returns a generator of availability zones. The zones!! The places your stuff lives!! ๐
Parameters
detailsโ Return extra details about the availability zones. This defaults toFalseas it generally requires extra permission. So like, lowkey the extra tea is behind a permission wall ๐ โ that's whyFalseis the default, it's not being shady, it's being polite.
Returns
A generator of availability zone AvailabilityZone <#openstack.compute.v2.availability_zone.AvailabilityZone> ๐
๐ Limits Operations ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_limits(**query)โ retrieves the limits that are applied to the project's account. Your ceilings, your caps, the "no you can't have infinite of that" receipts ๐โจ
Returns
A Limits object, including both AbsoluteLimits <#openstack.compute.v2.limits.AbsoluteLimits> and RateLimits. Two for one, we love a combo ๐
โญ Hypervisor Operations โญ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
hypervisors(details=False, **query)โ returns a generator of hypervisors. The actual physical(ish) machines hosting your vibes ๐ฅ๏ธ๐
Parameters
detailsโ When set to the default,False,Hypervisor<#openstack.compute.v2.hypervisor.Hypervisor> instances will be returned with only basic information populated. Just the headline, not the whole story.queryโ Optional query parameters to be sent to limit the resources being returned. Filter away, bestie ๐
Returns
A generator of hypervisor.
find_hypervisor(name_or_id, ignore_missing=True, *, details=True)โ finds a single hypervisor. One (1) hypervisor, specifically, no extras ๐
Parameters
name_or_idโ The name or ID of a hypervisor.ignore_missingโ When set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. SoTrue= "it's fine, no drama",False= "I want the error, I want the truth" ๐ญdetailsโ When set toFalse, instances with only basic data will be returned. The default,True, will cause instances with full data to be returned. Note the flip fromhypervisors()above โ here it defaults toTrue, ok? Don't mix them up ๐
Returns
One: class:~openstack.compute.v2.hypervisor.Hypervisor or None.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found. Yes, multiple. Chaos. Not the vibe ๐
get_hypervisor(hypervisor)โ gets a single hypervisor.
Parameters
hypervisorโ The value can be the ID of a hypervisor or aHypervisor<#openstack.compute.v2.hypervisor.Hypervisor> instance. ID or the whole object, dealer's choice ๐ฒ
Returns
A Hypervisor <#openstack.compute.v2.hypervisor.Hypervisor> object.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
get_hypervisor_uptime(hypervisor)โ gets uptime information for a hypervisor. How long has it been awake, bestie, when did it last sleep ๐ดโฑ๏ธ
Parameters
hypervisorโ The value can be the ID of a hypervisor or aHypervisor<#openstack.compute.v2.hypervisor.Hypervisor> instance.
Returns
A Hypervisor <#openstack.compute.v2.hypervisor.Hypervisor> object.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
๐ง Extension Operations ๐ง
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
find_extension(name_or_id, ignore_missing=True)โ finds a single extension. Extensions are the little bonus features, the add-ons, the accessories of the compute world ๐
Parameters
name_or_idโ The name or ID of an extension.ignore_missingโ When set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns
One Extension <#openstack.compute.v2.extension.Extension> or None.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
Raises DuplicateResource <#openstack.exceptions.DuplicateResource> when multiple resources are found.
extensions()โ retrieves a generator of extensions. All of them. The whole collection. Slay โจ
Returns
A generator of extension instances.
๐ QuotaClassSet Operations ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_quota_class_set(quota_class_set='default')โ gets a single quota class set.
Only one quota class is permitted, default. That's it. One class. There is no other class. Don't go looking ๐
Parameters
quota_class_setโ The value can be the ID of a quota class set (onlydefaultis supported) or aQuotaClassSetinstance.
Returns
One QuotaClassSet.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_quota_class_set(quota_class_set, **attrs)โ updates aQuotaClassSet.
Only one quota class is permitted, default. Same rule, still true, we're not being repetitive, the API is ๐
Parameters
quota_class_setโ either the ID of a quota class set (and listen, onlydefaultis supported, so don't get creative ๐ ) or aQuotaClassSetinstance.attrsโ the attributes you wanna update on theQuotaClassSetthatquota_class_setis representing.
Returns
The updated QuotaSet โจ
๐ QuotaSet Operations ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_quota_set(project, usage=False, **query)
Show ya the QuotaSet info for the project ๐
Parameters
projectโ ID or instance ofProject <#openstack.identity.v3.project.Project>for the project you want the quota for.usageโ when you set this toTrue, quota usage and reservations get filled in. Obsessed with the receipts ๐queryโ extra query parameters to use, if you're feeling extra.
Returns
One QuotaSet <#openstack.compute.v2.quota_set.QuotaSet> ๐
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. (Yeah. It's gone. ๐ญ)
get_quota_set_defaults(project)
Show ya the QuotaSet defaults for the project โ like, the factory settings era โจ
Parameters
project โ ID or instance of Project <#openstack.identity.v3.project.Project> for the project you want the quota for.
Returns
One QuotaSet <#openstack.compute.v2.quota_set.QuotaSet>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
revert_quota_set(project, **query)
Reset the quota for the project/user. Ctrl+Z but make it cloud ๐ซถ
Parameters
projectโ ID or instance ofProject <#openstack.identity.v3.project.Project>for the project you wanna reset the quota on.queryโ additional parameters to be used.
Returns
None โ yeah, nothing back, it just does the thing ๐
update_quota_set(project, *, user=None, **attrs)
Update a QuotaSet. Glow-up szn ๐ฅ
Parameters
projectโ ID or instance ofProject <#openstack.identity.v3.project.Project>for the project you wanna update the quota on.user_idโ optional ID of the user to set quotas as.attrsโ the attributes to update on theQuotaSetthatquota_setis representing.
Returns
The updated QuotaSet
๐ฆ Server Migration Operations ๐ฆ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
abort_server_migration(server_migration, server, ignore_missing=True)
Abort an in-progress server migration. Not me pulling the plug mid-move ๐
Parameters
server_migrationโ the value can be either the ID of a server migration or aServerMigration <#openstack.compute.v2.server_migration.ServerMigration>instance.serverโ you have to specify this when aServerMigrationID is given as the value. It can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance that the migration belongs to.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the server migration doesn't exist. When set toTrue, no exception gets set when you attempt to delete a nonexistent server migration. (Yes, it says "delete" in a migration function. Iconic. ๐)
Returns
None
force_complete_server_migration(server_migration, server=None)
Force complete an in-progress server migration. No cap, we finishing this โจ
Parameters
server_migrationโ the value can be either the ID of a server migration or aServerMigration <#openstack.compute.v2.server_migration.ServerMigration>instance.serverโ you have to specify this when aServerMigrationID is given as the value. It can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance that the migration belongs to.
Returns
None
get_server_migration(server_migration, server, ignore_missing=True)
Get a single server migration. Just the one. Main character energy ๐
Parameters
server_migrationโ the value can be the ID of a server migration or aServerMigration <#openstack.compute.v2.server_migration.ServerMigration>instance.serverโ this parameter needs to be specified when aServerMigrationID is given as the value. It can be either the ID of a server or aServer <#openstack.compute.v2.server.Server>instance that the migration belongs to.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the server migration doesn't exist. When set toTrue, no exception gets set when you attempt to delete a nonexistent server migration.
Returns
One ServerMigration <#openstack.compute.v2.server_migration.ServerMigration> ๐ธ
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
server_migrations(server)
Return a generator of migrations for a server. All the migrations, one by one, in a neat lil stream ๐
Parameters
server โ the server can be either the ID of a server or a Server <#openstack.compute.v2.server.Server>.
Returns
A generator of ServerMigration objects โ ServerMigration <#openstack.compute.v2.server_migration.ServerMigration>
๐ธ Migration Operations ๐ธ
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
migrations(**query)
Return a generator of migrations for all the servers. Every single one, bestie ๐ซถ
Parameters
query โ optional query parameters sent along to limit the migrations being returned.
Returns
A generator of Migration objects โจ
๐ Interactive Consoles ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_server_remote_console(server, **attrs)
Create a remote console on the server. Peek at your box from afar ๐
Parameters
server โ either the ID of a server or a Server <#openstack.compute.v2.server.Server> instance.
Returns
One ServerRemoteConsole <#openstack.compute.v2.server_remote_console.ServerRemoteConsole> ๐
get_server_console_url(server, console_type)
Create a remote console on the server. (Yeah, the description is literally the same as the one above it โ nope, not me being lazy, that's genuinely what it says, iykyk ๐)
Parameters
serverโ either the ID of a server, or aServer<#openstack.compute.v2.server.Server> instance. either one works bestie ๐ซconsole_typeโ the type of the console connection.
Returns โ a dictionary with the console type and url ๐
validate_console_auth_token(console_token) Look up console connection info for a console auth token. iykyk โจ
Parameters
console_tokenโ the console auth token, exactly as it came back in the URL fromget_server_console_url.
Returns โ a dictionary with connection details, and ngl those details vary depending on the console type.
get_server_console_output(server, length=None) Grab the console output for a server. literally just the log ๐
Parameters
serverโ either the ID of a server, or aServer<#openstack.compute.v2.server.Server> instance.lengthโ optional, the number of lines to fetch from the end of the console log. leave it out and you get all the lines, no cap.
Returns โ the console output as a dict. control characters get escaped so it's a valid JSON string ๐ซถ
create_console(server, console_type, console_protocol=None) Create a remote console on the server. main character behaviour honestly ๐
when the microversion supported is higher than 2.6, a remote console gets created; otherwise it falls back to the deprecated call to get the server console. so yeah, older microversion = deprecated path, be aware ๐ญ
Parameters
serverโ either the ID of a server, or aServer<#openstack.compute.v2.server.Server> instance.console_typeโ the type of the remote console. supported values are:novnc,spice-html5,rdp-html5,serial,webmks(supported after2.8),spice-direct(supported after2.99).console_protocolโ optional console protocol. heads up: it's only respected after microversion2.6.
Returns โ a dictionary with the console type, the connection details (a url), and optionally the protocol โจ
โจ Helpers โจ
okay so this is the proxy class itself, and she has a LOT of keyword arguments. every single one, coming right up ๐
class openstack.compute.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
wait_for_delete(res, interval=2, wait=120, callback=None) Wait for a resource to be deleted. she will sit there and watch it disappear, iconic patience ๐ง
Parameters
resโ the resource to wait on to be deleted.intervalโ number of seconds to wait before two consecutive checks. default is2.waitโ maximum number of seconds to wait before the change. default is120.callbackโ a callback function. it gets called with a single value, progress, which is a percentage value from0-100.
Returns โ the resource is returned on success ๐
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if the transition to delete failed to occur in the specified seconds. so like, don't just wait forever, mmkay?
๐ Container Infrastructure Management ๐
๐ฆ Cluster Operations ๐ฆ
class openstack.container_infrastructure_management.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_cluster(**attrs) Create a new cluster from attributes. fresh cluster, fresh vibes โจ
Parameters
attrsโ keyword arguments which will be used to create aCluster<#openstack.container_infrastructure_management.v1.cluster.Cluster>, comprised of the properties on theClusterclass.
Returns โ the results of cluster creation ๐ซ
delete_cluster(cluster, ignore_missing=True) Delete a cluster. bye bestie ๐
Parameters
clusterโ the value can be either the ID of a cluster or aCluster<#openstack.container_infrastructure_management.v1.cluster.Cluster> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the cluster does not exist. when set toTrue, no exception will be set when attempting to delete a nonexistent cluster. default isTrue, so she's chill about it ๐
Returns โ None
find_cluster(name_or_id, ignore_missing=True) Find a single cluster. the search is ON ๐
Parameters
name_or_idโ the name or ID of a cluster.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. when set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns โ one Cluster <#openstack.container_infrastructure_management.v1.cluster.Cluster> or None ๐ซถ
get_cluster(cluster) Get a single cluster. just the one, not a whole crowd ๐
Parameters
clusterโ the value can be the ID of a cluster or aCluster<#openstack.container_infrastructure_management.v1.cluster.Cluster> instance.
Returns โ one Cluster <#openstack.container_infrastructure_management.v1.cluster.Cluster>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
clusters(**query) Return a generator of clusters. a whole lil generator of them, we love a lazy iterator ๐ธ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of cluster objects Cluster <#openstack.container_infrastructure_management.v1.cluster.Cluster> ๐ฅ
update_cluster(cluster, **attrs) Update a cluster. glow-up time ๐
Parameters
clusterโ either the id of a cluster or aCluster<#openstack.container_infrastructure_management.v1.cluster.Cluster> instance.attrsโ the attributes to update on the cluster represented by cluster.
Returns โ the updated cluster โจ
๐ Cluster Certificates Operations ๐
class openstack.container_infrastructure_management.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_cluster_certificate(**attrs) Create a new cluster_certificate from a CSR. certificates, but make it cute ๐
Parameters
attrsโ keyword arguments which will be used to create aClusterCertificate<#openstack.container_infrastructure_management.v1.cluster_certificate.ClusterCertificate>, comprised of the properties on theClusterCertificateclass.
Returns โ the results of cluster_certificate creation โญ
get_cluster_certificate(cluster_certificate) Get a single cluster_certificate. one (1) certificate, coming right up ๐ฆ
Parameters
cluster_certificateโ the value can be the ID of acluster_certificateor aClusterCertificate<#openstack.container_infrastructure_management.v1.cluster_certificate.ClusterCertificate> instance.
Returns โ one ClusterCertificate <#openstack.container_infrastructure_management.v1.cluster_certificate.ClusterCertificate>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐
๐ Cluster Templates Operations ๐
First up: the class herself. Say hi to the proxy, she's got a lot of keyword args and honestly she's thriving:
class openstack.container_infrastructure_management.v1._proxy.Proxy(session,
*, service_type=None, service_name=None, interface=None,
region_name=None, endpoint_override=None, version=None, auth=None,
user_agent=None, connect_retries=None, logger=None, allow=None,
additional_headers=None, client_name=None, client_version=None,
allow_version_hack=None, global_request_id=None, min_version=None,
max_version=None, default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_cluster_template(**attrs)โ makes a brand-new cluster template out of attributes, main character behavior only ๐
Parameters
attrsโ keyword arguments that get used to create aClusterTemplate<#openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate>, made up of the properties on theClusterTemplateclass.
Returns The results of cluster_template creation โจ
delete_cluster_template(cluster_template, ignore_missing=True)โ bye bye cluster template, no notes ๐ซถ
Parameters
cluster_templateโ the value can be either the ID of a cluster_template or aClusterTemplate<#openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the cluster_template doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent cluster_template.
Returns None
find_cluster_template(name_or_id, ignore_missing=True)โ hunts down a single cluster_template, lowkey a detective ๐
Parameters
name_or_idโ the name or ID of a cluster_template.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the resource doesn't exist. When set toTrue,Nonegets returned when attempting to find a nonexistent resource.
Returns One ClusterTemplate <#openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate> or None
get_cluster_template(cluster_template)โ grabs a single cluster_template, no gatekeeping ๐
Parameters
cluster_templateโ the value can be the ID of a cluster_template or aClusterTemplate<#openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate> instance.
Returns One ClusterTemplate <#openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found ๐ญ
cluster_templates(**query)โ returns a generator of cluster_templates, she gives and she gives ๐ธ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns A generator of cluster_template objects ClusterTemplate <#openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate>
update_cluster_template(cluster_template, **attrs)โ glow-up time for your cluster_template โจ
Parameters
cluster_templateโ either the id of a cluster_template or aClusterTemplate<#openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate> instance.attrsโ the attributes to update on the cluster_template represented by cluster_template.
Returns The updated cluster_template ๐
๐ Service Operations ๐
Same class, same absolutely iconic wall of keyword args, so here she is again in full because we do not skip details in this house:
class openstack.container_infrastructure_management.v1._proxy.Proxy(session,
*, service_type=None, service_name=None, interface=None,
region_name=None, endpoint_override=None, version=None, auth=None,
user_agent=None, connect_retries=None, logger=None, allow=None,
additional_headers=None, client_name=None, client_version=None,
allow_version_hack=None, global_request_id=None, min_version=None,
max_version=None, default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
services()โ returns a generator of services, she's a whole vibe check on what's running ๐ฅ
Returns A generator of service objects Service <#openstack.container_infrastructure_management.v1.service.Service>
๐ Database API ๐
So for the full rundown on how to actually use database, go peep Using OpenStack Database <>. That's the homework bestie, iykyk ๐
๐ฆ The Database Class ๐ฆ
The database high-level interface lives through the database member of a Connection <#openstack.connection.Connection> object. Important detail fr fr: that database member only gets added if the service is detected. No service, no member, that's just how it is ๐ซถ
๐ Database Operations ๐
Once more with feeling โ the proxy class, exact same signature, character for character:
class openstack.database.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_database(instance, **attrs)โ creates a new database from attributes, new database just dropped ๐
Parameters
instanceโ this can be either the ID of an instance or aInstance<#openstack.database.v1.instance.Instance>attrsโ keyword arguments which will be used to create aDatabase<#openstack.database.v1.database.Database>, comprised of the properties on theDatabaseclass.
Returns The results of server creation
delete_database(database, instance=None, ignore_missing=True)โ deletes a database, gone girl energy ๐ญ
Parameters
databaseโ the value can be either the ID of a database or aDatabase<#openstack.database.v1.database.Database> instance.instanceโ this parameter needs to be specified when an ID is given as database. It can be either the ID of an instance or aInstance<#openstack.database.v1.instance.Instance>ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the database doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent database.
Returns None
find_database(name_or_id, instance, ignore_missing=True)โ finds a single database, sleuth mode activated ๐ต๏ธโโ๏ธ
Parameters
name_or_idโ the name or ID of a database.instanceโ this can be either the ID of an instance or aInstance<#openstack.database.v1.instance.Instance>ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource doesn't exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns One Database <#openstack.database.v1.database.Database> or None
databases(instance, **query)โ returns a generator of databases, the whole collection, no crumbs ๐
Parameters
instanceโ this can be either the ID of an instance or aInstance<#openstack.database.v1.instance.Instance> instance that the interface belongs to.queryโ optional query parameters to be sent to limit the resources being returned.
Returns A generator of database objects
get_database(database, instance=None)โ gets a single database, bestie delivers ๐ฆ
Parameters
instanceโ this parameter needs to be specified when an ID is given as database. It can be either the ID of an instance or aInstance<#openstack.database.v1.instance.Instance>databaseโ the value can be the ID of a database or aDatabase<#openstack.database.v1.database.Database> instance.
Returns: one Database ๐๏ธ
Raises NotFoundException when no resource can be found. yeah โ if it's not there, it really isn't there, no cap ๐ญ
๐จ Flavor Operations
The flavor corner of the proxy, bestie. Same class, same everything:
class openstack.database.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
find_flavor(name_or_id, ignore_missing=True)
Find a single flavor ๐ like, just one. the one. periodt.
Parameters
- name_or_id โ The name or ID of a flavor.
- ignore_missing โ When set to
False,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. so likeโฆ ghost it or catch feelings, your call ๐
Returns: One Flavor or None
get_flavor(flavor)
Get a single flavor โจ
Parameters
- flavor โ The value can be the ID of a flavor or a
Flavorinstance.
Returns: One Flavor
Raises NotFoundException when no resource can be found. she's not here, bestie ๐ซถ
flavors(**query)
Return a generator of flavors ๐ yes, a generator, not a list โ she's lazy in the efficient way, not the toxic way.
Parameters
- query โ Optional query parameters to be sent to limit the resources being returned.
Returns: A generator of flavor objects
๐ง Instance Operations
Now the main character section โ instances, the whole reason you're here tbh ๐
class openstack.database.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_instance(**attrs)
Create a new instance from attributes ๐ฃ it's giving birth-of-a-database energy.
Parameters
- attrs โ Keyword arguments which will be used to create a
Instance, comprised of the properties on theInstanceclass.
Returns: The results of server creation
delete_instance(instance, ignore_missing=True)
Delete an instance ๐ gone. reduced to atoms. respectfully.
Parameters
- instance โ The value can be either the ID of an instance or a
Instanceinstance. - ignore_missing โ When set to
False,NotFoundExceptionwill be raised when the instance does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent instance. so like, unbothered. moisturized. in her lane โจ
Returns: None
find_instance(name_or_id, ignore_missing=True)
Find a single instance ๐
Parameters
- name_or_id โ The name or ID of a instance.
- ignore_missing โ When set to
False,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns: One Instance or None
get_instance(instance)
Get a single instance ๐ธ
Parameters
- instance โ The value can be the ID of an instance or a
Instanceinstance.
Returns: One Instance
Raises NotFoundException when no resource can be found. ๐ญ
instances(**query)
Return a generator of instances ๐
Parameters
- query โ Optional query parameters to be sent to limit the resources being returned.
Returns: A generator of instance objects
update_instance(instance, **attrs)
Update a instance โ๏ธ glow-up time, we love a transformation arc.
Parameters
- instance โ Either the id of a instance or a
Instanceinstance. - attrs โ The attributes to update on the instance represented by instance.
Returns: The updated instance
๐ User Operations
And finally the users section โ the little guys who actually log in ๐ซถ database users, not like, your ex. different thing.
class openstack.database.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_user(instance, **attrs)
Create a new user from attributes ๐งโ๐ป new account, who dis
Parameters
- instance โ This can be either the ID of an instance or a
Instance - attrs โ Keyword arguments which will be used to create a
User, comprised of the properties on theUserclass.
Returns: The results of server creation
delete_user(user, instance=None, ignore_missing=True)
Delete a user ๐๏ธ bye bestie, block and delete, the whole routine.
Parameters
- user โ The value can be either the ID of a user or a
Userinstance. - instance โ This parameter needs to be specified when an ID is given as user. It can be either the ID of an instance or a
Instance - ignore_missing โ When set to
False,NotFoundExceptionwill be raised when the user does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent user.
โ ๏ธ lowkey important: if you're passing an ID as user, you must also pass instance. no instance, no vibes, no deletion. iykyk ๐
Returns: None
find_user(name_or_id, instance, ignore_missing=True)
Find a single user ๐ note that unlike delete_user, instance here is required โ no default, she's not optional. main character energy fr.
Parameters
- name_or_id โ The name or ID of a user.
- instance โ This can be either the ID of an instance or a
Instance - ignore_missing โ When set to
False,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns: One User or None
users(instance, **query)
Return a generator of users ๐๐
Parameters
- instance โ This can be either the ID of an instance or a
Instance - query โ Optional query parameters to be sent to limit the resources being returned.
Returns: A generator of user objects
get_user(user, instance=None)
Get a single user โญ
Parameters
- user โ The value can be the ID of a user or a
Userinstance. - instance โ This parameter needs to be specified when an ID is given as database. It can be either the ID of an instance or a
Instance
๐ and yes, the original docstring literally says database there even though the parameter is instance. we're reporting it exactly as written, character for character โ not my typo, i'm just the messenger ๐ซก
Returns โ one User (fr the openstack.database.v1.user.User one ๐
)
Raises โ NotFoundException (that's openstack.exceptions.NotFoundException) when no resource can be found, no cap. ๐ญ
๐ฆ DNS API
For the full glow-up on how to actually use dns, peep Using OpenStack DNS.
๐ธ The DNS Class
Okay so the dns high-level interface lives on the dns member of a Connection object. Iconic. But heads up bestie: that dns member is only added if the service is detected โ no service, no member, that's just how it is. ๐ซถ
๐ DNS Zone Operations
Here's the whole constructor, exactly as-is, because we do not paraphrase signatures in this house:
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ zones(**query)
Retrieve a generator of zones โ yes, a generator, so it's lazy and cute like that. โจ
Parameters
queryโ optional query params you can send to limit which resources come back:name: Zone Name field.type: Zone Type field.email: Zone email field.status: Status of the zone.ttl: TTL field filter.absdescription: Zone description field filter.
Returns โ a generator of zone Zone instances (the openstack.dns.v2.zone.Zone kind ๐ฆ).
create_zone(**attrs)
Create a brand new zone from attributes. Main character energy for your DNS. ๐
Parameters
attrsโ keyword arguments used to create aZone(openstack.dns.v2.zone.Zone), made up of the properties on theZoneclass.
Returns โ the results of zone creation.
get_zone(zone)
Get a zone. Simple. Slay. ๐
Parameters
zoneโ the value can be the ID of a zone or aZone(openstack.dns.v2.zone.Zone) instance.
Returns โ a Zone instance.
delete_zone(zone, ignore_missing=True, delete_shares=False)
Delete a zone. Bye bestie ๐๐ญ
Parameters
zoneโ the value can be the ID of a zone or aZone(openstack.dns.v2.zone.Zone) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the zone does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent zone.delete_sharesโ whenTrue, delete the zone shares along with the zone.
Returns โ Zone been deleted.
find_zone(name_or_id, ignore_missing=True)
Find a single zone โ like a search but for exactly one, we love a monogamous lookup. ๐
Parameters
name_or_idโ the name or ID of a zone.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the zone does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent zone.
Returns โ Zone (openstack.dns.v2.zone.Zone).
abandon_zone(zone, **attrs)
Abandon Zone ๐ซฅ (yes that's really the name, it's giving "walking away dramatically").
Parameters
zoneโ the value can be the ID of a zone to be abandoned or aZoneExport(openstack.dns.v2.zone_export.ZoneExport) instance.
Returns โ None.
xfr_zone(zone, **attrs)
Trigger update of a secondary Zone. Go off, trigger it. ๐ฅ
Parameters
zoneโ the value can be the ID of a zone to be abandoned or aZoneExport(openstack.dns.v2.zone_export.ZoneExport) instance.
Returns โ None.
โญ Recordset Operations
Same constructor, same everything, here it is again verbatim because it belongs to this section too:
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ recordsets(zone=None, **query)
Retrieve a generator of recordsets. Generators keep giving, iykyk. โจ
Parameters
zoneโ the optional value can be the ID of a zone or aZone(openstack.dns.v2.zone.Zone) instance. If it is not given, all recordsets for all zones of the tenant would be retrieved.queryโ optional query params sent to limit the resources being returned:name: Recordset Name field.type: Type field.status: Status of the recordset.ttl: TTL field filter.description: Recordset description field filter.
Returns โ a generator of zone (Recordset, i.e. openstack.dns.v2.recordset.Recordset) instances.
create_recordset(zone, **attrs)
Create a new recordset in the zone. Nesting it right in there. ๐ช
Parameters
zoneโ the value can be the ID of a zone or aZone(openstack.dns.v2.zone.Zone) instance.attrsโ keyword arguments used to create aRecordset(openstack.dns.v2.recordset.Recordset), made up of the properties on theRecordsetclass.
Returns โ the results of zone creation.
update_recordset(recordset, **attrs)
Update Recordset attributes. Glow-up arc unlocked. ๐
Parameters
attrsโ keyword arguments used to create aRecordset(openstack.dns.v2.recordset.Recordset), made up of the properties on theRecordsetclass.
Returns โ the results of zone creation.
get_recordset(recordset, zone)
Get a recordset. One (1) recordset, coming right up. ๐
Parameters
zoneโ the value can be the ID of a zone or aZone(openstack.dns.v2.zone.Zone) instance.recordsetโ the value can be the ID of a recordset or aRecordset(openstack.dns.v2.recordset.Recordset) instance.
Returns โ Recordset instance.
delete_recordset(recordset, zone=None, ignore_missing=True)
Delete a zone โ yes, the label literally says zone, we're not fixing it, we're just reporting it. ๐
Parameters
recordsetโ the value can be the ID of a recordset or aRecordset(openstack.dns.v2.recordset.Recordset) instance.zoneโ the value can be the ID of a zone or aZone(openstack.dns.v2.zone.Zone) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the zone does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent zone.
Returns โ Recordset instance been deleted.
๐ Zone Import Operations
And once more, the constructor, character for character, because it's a whole vibe:
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ง zone_imports(**query)
Retrieve a generator of zone imports โ bringing zones in from elsewhere, very "new era" of you. โญ
Parameters
queryโ optional query params you can send to limit the resources being returned:zone_id: Zone I field.message: Message field.status: Status of the zone import record.
Returns โ a generator of zone ZoneImport instances (that's openstack.dns.v2.zone_import.ZoneImport ๐ฆ).
create_zone_import(**attrs)
Create a new zone import from attributes. Fresh import, fresh start, periodt. ๐
Parameters
attrsโ keyword arguments used to create aZoneImport(openstack.dns.v2.zone_import.ZoneImport), made up of the properties on theZoneImportclass.
Returns โ the results of zone creation โจ that's the whole return value, no cap.
get_zone_import(zone_import)
Grab a single zone import record ๐
zone_importโ the value can be the ID of a zone import or aZoneImport<#openstack.dns.v2.zone_import.ZoneImport> instance.
Returns โ a ZoneImport instance.
delete_zone_import(zone_import, ignore_missing=True)
Delete a zone import ๐๏ธ
zone_importโ the value can be the ID of a zone import or aZoneImport<#openstack.dns.v2.zone_import.ZoneImport> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the zone does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent zone.
Returns โ the deleted zone import.
๐ฆ Zone Export Operations
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
zone_exports(**query)
Hands you back a generator of zone exports ๐ (yes, a generator โ lazy, iconic, main-character energy)
queryโ optional query parameters to be sent to limit the resources being returned.zone_id: Zone I field.message: Message field.status: Status of the zone import record.
Returns โ a generator of zone ZoneExport <#openstack.dns.v2.zone_export.ZoneExport> instances.
create_zone_export(zone, **attrs)
Make a brand-new zone export from attributes ๐
zoneโ the value can be the ID of a zone to be exported or aZoneExport<#openstack.dns.v2.zone_export.ZoneExport> instance.attrsโ keyword arguments which will be used to create aZoneExport<#openstack.dns.v2.zone_export.ZoneExport>, comprised of the properties on theZoneExportclass.
Returns โ the results of zone creation.
get_zone_export(zone_export)
Get one zone export record ๐
zoneโ the value can be the ID of a zone import or aZoneExport<#openstack.dns.v2.zone_export.ZoneExport> instance.
Returns โ ZoneExport instance.
get_zone_export_text(zone_export)
Get a zone export record, but as text ๐ (same data, text-flavored vibe)
zoneโ the value can be the ID of a zone import or aZoneExport<#openstack.dns.v2.zone_export.ZoneExport> instance.
Returns โ ZoneExport instance.
delete_zone_export(zone_export, ignore_missing=True)
Yeet a zone export ๐๏ธโจ
zone_exportโ the value can be the ID of a zone import or aZoneExport<#openstack.dns.v2.zone_export.ZoneExport> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the zone does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent zone.
Returns โ the deleted zone export.
๐ธ FloatingIP Operations
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
floating_ips(**query)
Retrieve a generator of recordsets ๐ซถ
queryโ optional query parameters to be sent to limit the resources being returned.name: Recordset Name field.type: Type field.status: Status of the recordset.ttl: TTL field filter.description: Recordset description field filter.
Returns โ a generator of floatingips (FloatingIP <#openstack.dns.v2.floating_ip.FloatingIP>) instances.
get_floating_ip(floating_ip)
Get a Floating IP ๐
floating_ipโ the value can be the ID of a floating ip or aFloatingIP<#openstack.dns.v2.floating_ip.FloatingIP> instance. The ID is in format"region_name:floatingip_id".
Returns โ FloatingIP instance.
update_floating_ip(floating_ip, **attrs)
Update floating ip attributes โจ
floating_ipโ the id or an instance ofFloatingIP.attrsโ attributes for update onFloatingIP.
๐ TLD Operations
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
tlds(**query)
Retrieve a generator of tlds ๐
queryโ optional query parameters to be sent to limit the resources being returned.name: TLD Name field.
Returns โ a generator of tld TLD <#openstack.dns.v2.tld.TLD> instances.
create_tld(**attrs)
Create a new tld from attributes ๐
attrsโ keyword arguments which will be used to create aTLD<#openstack.dns.v2.tld.TLD>, comprised of the properties on theTLDclass.
Returns โ the results of TLD creation.
get_tld(tld)
Get a tld ๐
tldโ the value can be the ID of a tld or aTLD<#openstack.dns.v2.tld.TLD> instance.
Returns โ tld instance.
delete_tld(tld, ignore_missing=True)
Delete a tld ๐
tldโ the value can be the ID of a tld or aTLD<#openstack.dns.v2.tld.TLD> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the tld does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent tld.
Returns โ TLD been deleted.
find_tld(name_or_id, ignore_missing=True)
Find a single tld ๐ง
name_or_idโ the name or ID of a tld.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the tld does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent tld.
Returns โ TLD <#openstack.dns.v2.tld.TLD>.
โญ Zone Transfer Operations
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
zone_transfer_requests(**query)โ grab a generator of all the zone transfer requests โจ
Parameters
query โ optional query params you can send to filter down what comes back:
status: the status of the recordset.
Returns
A generator of transfer requests โ ZoneTransferRequest <#openstack.dns.v2.zone_transfer.ZoneTransferRequest> instances, bestie ๐ซถ
get_zone_transfer_request(request)โ pull the info for one ZoneTransfer Request ๐
Parameters
request โ can be the ID of a transfer request, or a ZoneTransferRequest <#openstack.dns.v2.zone_transfer.ZoneTransferRequest> instance. Either works, no cap.
Returns
A zone transfer request instance.
create_zone_transfer_request(zone, **attrs)โ make a fresh ZoneTransfer Request out of attributes ๐ฑ
Parameters
zoneโ can be the ID of a zone you wanna transfer, or aZoneExport <#openstack.dns.v2.zone_export.ZoneExport>instance.attrsโ keyword args used to create theZoneTransferRequest <#openstack.dns.v2.zone_transfer.ZoneTransferRequest>, made up of the properties on the ZoneTransferRequest class.
Returns
The results of zone transfer request creation.
update_zone_transfer_request(request, **attrs)โ change up the attributes on a ZoneTransfer Request ๐
Parameters
floating_ipโ the id or an instance ofZoneTransferRequest <#openstack.dns.v2.zone_transfer.ZoneTransferRequest>. (yes, the param is literally calledfloating_ipin this doc, we don't ask questions ๐ซ )attrsโ attributes to update on theZoneTransferRequest <#openstack.dns.v2.zone_transfer.ZoneTransferRequest>.
delete_zone_transfer_request(request, ignore_missing=True)โ yeet a ZoneTransfer Request ๐
Parameters
requestโ can be the ID of a zone transfer request, or aZoneTransferRequest <#openstack.dns.v2.zone_transfer.ZoneTransferRequest>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the zone doesn't exist. When set toTrue, no exception is set when you try to delete a nonexistent zone.
Returns
The deleted zone transfer request.
zone_transfer_accepts(**query)โ get a generator of zone transfer accepts โจ
Parameters
query โ optional query params to send to limit the resources returned:
status: the status of the recordset.
Returns
A generator of transfer accepts โ ZoneTransferAccept <#openstack.dns.v2.zone_transfer.ZoneTransferAccept> instances.
get_zone_transfer_accept(accept)โ get the info for one ZoneTransfer Accept ๐
Parameters
request โ can be the ID of a transfer accept, or a ZoneTransferAccept <#openstack.dns.v2.zone_transfer.ZoneTransferAccept> instance. (yeah the param is listed as request even tho the arg is accept โ that's literally what it says, iykyk ๐)
Returns
A zone transfer request instance.
create_zone_transfer_accept(**attrs)โ make a brand new ZoneTransfer Accept from attributes ๐
Parameters
attrs โ keyword args used to create the ZoneTransferAccept <#openstack.dns.v2.zone_transfer.ZoneTransferAccept>, comprised of the properties on the ZoneTransferAccept class.
Returns
The results of zone transfer request creation.
๐ธ Zone Share Operations ๐ธ
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
zone_shares(zone, **query)โ get a generator of zone shares ๐
Parameters
zoneโ the zone ID or aZone <#openstack.dns.v2.zone.Zone>instance.queryโ optional query params to send to limit the resources returned:target_project_id: the target project ID field.
Returns
A generator of zone shares โ ZoneShare <#openstack.dns.v2.zone_share.ZoneShare> instances.
get_zone_share(zone, zone_share)โ get one zone share ๐
Parameters
zoneโ can be the ID of a zone or aZone <#openstack.dns.v2.zone.Zone>instance.zone_shareโ can be either the ID of the zone share, or aZoneShare <#openstack.dns.v2.zone_share.ZoneShare>instance that the zone share belongs to.
Returns
A ZoneShare instance.
find_zone_share(zone, zone_share_id, ignore_missing=True)โ find a single zone share ๐ฆ
Parameters
zoneโ can be the ID of a zone or aZone <#openstack.dns.v2.zone.Zone>instance.zone_share_idโ the zone share ID.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the zone share doesn't exist. When set toTrue,Noneis returned when you try to find a nonexistent zone share.
Returns
ZoneShare <#openstack.dns.v2.zone_share.ZoneShare>
create_zone_share(zone, **attrs)โ create a new zone share from attributes ๐ฑ
Parameters
zoneโ the zone ID or aZone <#openstack.dns.v2.zone.Zone>instance.attrsโ keyword args used to create aZoneShare <#openstack.dns.v2.zone_share.ZoneShare>, comprised of the properties on the ZoneShare class.
Returns
The results of zone share creation.
delete_zone_share(zone, zone_share, ignore_missing=True)โ delete a zone share ๐
Parameters
zoneโ the zone ID or aZone <#openstack.dns.v2.zone.Zone>instance.zone_shareโ can be either the ID of the zone share, or aZoneShare <#openstack.dns.v2.zone_share.ZoneShare>instance that the zone share belongs to.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the zone share doesn't exist. When set toTrue, no exception is set when you try to delete a nonexistent zone share.
Returns
None
โจ Limit Operations โจ
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
limits(**query)โ get a generator of limits ๐
Returns
A generator of limits โ Limit <#openstack.dns.v2.limit.Limit> instances.
๐ Quota Operations ๐
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
quotas(**query)โ returns a generator of quotas ๐
Parameters
query โ optional query params you send to limit the resources being returned.
-a,--allโ bestie this is the one that shows you everything, no filter, no cap ๐-n,--numberโ ok so this one's giving "numbered list" energy, it literally adds line numbers to the output โจ-s,--squeeze-blankโ the way this one just smooths things out... it collapses multiple blank lines into a single one, iconic behavior honestly ๐-u,--unbufferedโ no buffering, no waiting, just immediately pushing output through. it's giving impatient main character energy fr fr ๐
๐ธ Service Status Operations ๐ธ
okay so check it โ this is literally the same Proxy class definition again, same constructor, same everything:
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
service_statuses()
Retrieve a generator of service statuses โ like, it hands you back a generator that spits out all the service statuses one at a time ๐ฆ
- Returns โ a generator of service statuses, specifically
ServiceStatus<#openstack.dns.v2.service_status.ServiceStatus> instances. so you get all the tea about what's up with each service ๐
get_service_status(service)
Get a status of a service in the Designate system โ this one's your lookup tool, you give it a service and it tells you what's going on with it ๐
serviceโ so this can be either the ID of a service OR aServiceStatus<#openstack.dns.v2.service_status.ServiceStatus> instance. like, you can pass it the actual object or just the ID, either way works bestie โจ- Returns โ a
ServiceStatusinstance. periodt. ๐
๐ Blacklist Operations ๐
again, same Proxy class, same constructor, we're literally just copy-pasting the vibe at this point:
class openstack.dns.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
blacklists(**query)
Retrieve a generator of blacklists โ so like, this one's giving you a generator of all the blacklist entries ๐ซ
- Returns โ a generator of
Blacklist<#openstack.dns.v2.blacklist.Blacklist> instances. so you get them one by one, very chill, very on-demand ๐
get_blacklist(blacklist)
Get a blacklist โ singular. one. single. blacklist. ๐ฏ
blacklistโ the value can be either the ID of a blacklist OR aBlacklist<#openstack.dns.v2.blacklist.Blacklist> instance. like, pass it whatever you got bestie ๐ซถ- Returns โ a
Blacklistinstance. simple as that. no cap. ๐
create_blacklist(**attrs)
Create a new blacklist โ you're making a brand new one, main character energy fr fr โจ
attrsโ these are keyword arguments that'll be used to create aBlacklist<#openstack.dns.v2.blacklist.Blacklist>. they're comprised of the properties on theBlacklistclass, so like, you're just passing in the ingredients and it bakes you a blacklist ๐ง- Returns โ the results of blacklist creation. so like, the new blacklist that you just made. slay. ๐ฅ
update_blacklist(blacklist, **attrs)
Update blacklist attributes โ you're changing stuff on an existing one, giving it a little makeover ๐
blacklistโ the id or an instance of~openstack.dns.v2.blacklist.Blacklist. so like, whatever you got, it'll take it ๐attrsโ attributes for update on~openstack.dns.v2.blacklist.Blacklist. these are the ones you're changing, bestie ๐ธ- Returns โ the updated blacklist. so like, here's the glow-up, looking fresh ๐
delete_blacklist(blacklist, ignore_missing=True)
Delete a blacklist โ bye bye ๐ it's giving "you're not coming to the function anymore" energy ๐
blacklistโ the id or an instance of~openstack.dns.v2.blacklist.Blacklist. same deal, ID or object, either works ๐ฆignore_missingโ okay so this one's important bestie. when set toFalse, aNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the blacklist does not exist. but when set toTrue(which is the default!), no exception will be set when attempting to delete a nonexistent blacklist. so like, if you're not sure it's there, leave this asTrueand it'll just quietly do its thing ๐คซ- Returns โ the blacklist that's been deleted. like, here's what got yeeted ๐๏ธ
๐ Identity API v2 ๐
okay so for the details on how to use identity, you gotta see Using OpenStack Identity <>. that's your homework bestie, go read it ๐
๐ The Identity v2 Class ๐
the identity high-level interface is available through the identity member of a Connection <#openstack.connection.Connection> object. so like, you access it through the connection, iykyk ๐
important note: the identity member will only be added if the service is detected. so like, if it's not there, it's not there. no vibes to be had ๐
โจ Extension Operations โจ
okay so we're back with another Proxy class definition, same constructor arguments, same everything:
class openstack.identity.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
extensions()
Retrieve a generator of extensions โ it's giving you all the extensions, one at a time, very chill ๐ฆ
- Returns โ a generator of extension instances. so like, a whole stream of them ๐
get_extension(extension)
Get a single extension โ just one. singular. focused. ๐ฏ
extensionโ the value can be either the ID of an extension OR anExtension<#openstack.identity.v2.extension.Extension> instance. so like, pass whatever you have bestie โจ- Returns โ one
Extension<#openstack.identity.v2.extension.Extension>. periodt. ๐ - Raises โ
NotFoundException<#openstack.exceptions.NotFoundException> when no extension can be found. so like, if it doesn't exist, you're getting an exception, no cap ๐ญ
๐ User Operations ๐
and again, same Proxy class, same constructor, we're literally just going through the motions at this point:
class openstack.identity.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_user(**attrs)
Create a new user from attributes โ you're making a whole new user, main character energy fr fr ๐ฅ
attrsโ keyword arguments which will be used to create aUser<#openstack.identity.v2.user.User>, comprised of the properties on theUserclass. so like, you're just passing in all the deets and it creates the user for you ๐ง- Returns โ the results of user creation. so like, the new user, fresh out the oven ๐
delete_user(user, ignore_missing=True)
Delete a user โ bye bestie ๐ you're gone, you're out, no more vibes from you ๐
userโ the value can be either the ID of a user OR aUser<#openstack.identity.v2.user.User> instance. same deal as always, ID or object ๐ฆignore_missingโ okay so when set toFalse, aNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the user does not exist. but when set toTrue(the default!), no exception will be set when attempting to delete a nonexistent user. so like, it just quietly does nothing if they're already gone ๐คซ- Returns โ
None. that's it. nothing. nada. silence. ๐
find_user(name_or_id, ignore_missing=True)
Find a single user โ you're looking for one specific user, giving detective energy ๐
name_or_idโ the name or ID of a user. so like, you can search by either one, very flexible bestie โจignore_missingโ when set toFalse, aNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. but when set toTrue(default!),Nonewill be returned when attempting to find a nonexistent resource. so like, if you're not sure they're there, you'll just getNoneback, no drama ๐- Returns โ one
User<#openstack.identity.v2.user.User> orNone. so like, either you found them or you didn't, no in-between ๐
get_user(user)
Get a single user โ again, just one, focused, singular, no cap ๐ฏ
So like, wrapping up get_user real quick:
- Parameters
userโ the value can be the ID of a user or aUser(#openstack.identity.v2.user.User) instance. ๐
- Returns โ One
User(#openstack.identity.v2.user.User). โจ - Raises โ
NotFoundException(#openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ Like, it's just not there bestie, no cap.
users(**query)
Retrieve a generator of users. ๐ฅ Yes, a generator โ it's giving lazy iterator energy, she doesn't dump everything on you at once.
- Parameters
queryโ optional query parameters that get sent along to limit the resources being returned. ๐
- Returns โ a generator of user instances. Slay.
update_user(user, **attrs)
Update a user. Glow-up time. ๐
- Parameters
userโ either the ID of a user or aUser(#openstack.identity.v2.user.User) instance. ๐ซถattrsโ the attributes you're updating on the user represented byuser.
- Returns โ the updated user. Iconic.
๐ญ Role Operations
class openstack.identity.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Look at that constructor. It's giving "I have a lot of kwargs and I'm not sorry." ๐ Every single one is up there in the block above, verbatim, don't come for me.
create_role(**attrs)
Create a new role from attributes. New role, who dis? ๐
- Parameters
attrsโ keyword arguments that'll be used to create aRole(#openstack.identity.v2.role.Role), made up of the properties on theRoleclass. ๐ฆ
- Returns โ the results of role creation.
delete_role(role, ignore_missing=True)
Delete a role. Bye bestie ๐
- Parameters
roleโ the value can be either the ID of a role or aRole(#openstack.identity.v2.role.Role) instance.ignore_missingโ when it's set toFalse,NotFoundException(#openstack.exceptions.NotFoundException) gets raised when the role does not exist. When it's set toTrue, no exception gets set when you attempt to delete a nonexistent role. ๐ (Lowkey the forgiving mode, fr.)
- Returns โ
None.
find_role(name_or_id, ignore_missing=True)
Find a single role. Detective mode ๐ต๏ธโโ๏ธโจ
- Parameters
name_or_idโ the name or ID of a role.ignore_missingโ when it's set toFalse,NotFoundException(#openstack.exceptions.NotFoundException) gets raised when the resource does not exist. When it's set toTrue,Nonegets returned when you attempt to find a nonexistent resource. ๐
- Returns โ One
Role(#openstack.identity.v2.role.Role) orNone.
get_role(role)
Get a single role. Gimme gimme ๐ซด
- Parameters
roleโ the value can be the ID of a role or aRole(#openstack.identity.v2.role.Role) instance.
- Returns โ One
Role(#openstack.identity.v2.role.Role). - Raises โ
NotFoundException(#openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ
roles(**query)
Retrieve a generator of roles. โญ
- Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
- Returns โ a generator of role instances.
update_role(role, **attrs)
Update a role. She's evolving ๐ซ
- Parameters
roleโ either the ID of a role or aRole(#openstack.identity.v2.role.Role) instance.attrsโ the attributes to update on the role represented byrole.
- Returns โ the updated role.
๐ Tenant Operations
class openstack.identity.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Same constructor, same absolute wall of kwargs โ copied exactly, every default and all. ๐
create_tenant(**attrs)
Create a new tenant from attributes. New tenant just dropped ๐
- Parameters
attrsโ keyword arguments which will be used to create aTenant(#openstack.identity.v2.tenant.Tenant), comprised of the properties on theTenantclass.
- Returns โ the results of tenant creation.
delete_tenant(tenant, ignore_missing=True)
Delete a tenant. ๐งน
- Parameters
tenantโ the value can be either the ID of a tenant or aTenant(#openstack.identity.v2.tenant.Tenant) instance.ignore_missingโ when set toFalse,NotFoundException(#openstack.exceptions.NotFoundException) will be raised when the tenant does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent tenant. ๐
- Returns โ
None.
find_tenant(name_or_id, ignore_missing=True)
Find a single tenant. ๐
- Parameters
name_or_idโ the name or ID of a tenant.ignore_missingโ when set toFalse,NotFoundException(#openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. โจ
- Returns โ One
Tenant(#openstack.identity.v2.tenant.Tenant) orNone.
get_tenant(tenant)
Get a single tenant. Gimme ๐ค
- Parameters
tenantโ the value can be the ID of a tenant or aTenant(#openstack.identity.v2.tenant.Tenant) instance.
- Returns โ One
Tenant(#openstack.identity.v2.tenant.Tenant). - Raises โ
NotFoundException(#openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ
tenants(**query)
Retrieve a generator of tenants. ๐ธ
- Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
- Returns โ a generator of tenant instances.
update_tenant(tenant, **attrs)
Update a tenant. โจ
- Parameters
tenantโ either the ID of a tenant or aTenant(#openstack.identity.v2.tenant.Tenant) instance.attrsโ the attributes to update on the tenant represented bytenant.
- Returns โ the updated tenant.
๐ Identity API v3
For details on how to use identity, see Using OpenStack Identity <>. (Yes, that's the literal reference as written โ I'm not out here inventing links, bestie. ๐ซถ)
๐ซ The Identity v3 Class
The identity high-level interface is available through the identity member of a Connection (#openstack.connection.Connection) object. The identity member will only be added if the service is detected. โจ Like, she only shows up if she's invited.
๐ Credential Operations
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
v3 proxy, same giant kwargs list, verbatim, character for character. ๐
create_credential(**attrs)
Create a new credential from attributes. ๐
- Parameters
attrsโ keyword arguments which will be used to create aCredential(#openstack.identity.v3.credential.Credential), comprised of the properties on theCredentialclass.
- Returns โ the results of credential creation.
delete_credential(credential, ignore_missing=True)
Delete a credential. ๐๏ธ
- Parameters
credentialโ the value can be either the ID of a credential or aCredential(#openstack.identity.v3.credential.Credential) instance.
ignore_missingโ bestie, this is the drama switch ๐ when it'sFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised the second the credential doesn't exist. When it'sTrue, literally nothing happens โ no exception gets set when you try to delete a credential that was never there. ghosted, respectfully ๐
Returns
None
๐ธ find_credential(name_or_id, ignore_missing=True)
Find one single credential. just the one. we're not greedy โจ
Parameters
name_or_idโ the name or the ID of a credential, either works, iykyk.ignore_missingโ when it'sFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised if the resource doesn't exist. when it'sTrue, you just getNoneback when you go looking for something that isn't there. no cap, very chill of it ๐ฆ
Returns
One Credential <#openstack.identity.v3.credential.Credential> or None
๐ get_credential(credential)
Get a single credential. the getting-est of them all ๐
Parameters
credentialโ the value can be the ID of a credential or aCredential <#openstack.identity.v3.credential.Credential>instance. your choice, main character ๐
Returns
One Credential <#openstack.identity.v3.credential.Credential>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
๐ฆ credentials(**query)
Retrieve a generator of credentials. a whole little stream of them, iconic ๐ซ
Parameters
queryโ optional query parameters, sent along to limit the resources being returned. basically "here's what I want, filter accordingly" ๐
Returns
A generator of credentials instances.
๐ update_credential(credential, **attrs)
Update a credential. glow-up time โจ
Parameters
credentialโ either the ID of a credential or aCredential <#openstack.identity.v3.credential.Credential>instance.attrsโ the attributes to update on the credential represented by credential. sprinkle sprinkle ๐ง
Returns
The updated credential
๐ Domain Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
like, that is the whole constructor signature and I am not about to paraphrase it. it's giving very "read it and weep" energy ๐ every kwarg stays, fr fr.
โญ create_domain(**attrs)
Create a brand new domain from attributes. fresh out the box ๐
Parameters
attrsโ keyword arguments which will be used to create aDomain <#openstack.identity.v3.domain.Domain>, comprised of the properties on theDomainclass.
Returns
The results of domain creation
๐ delete_domain(domain, ignore_missing=True)
Delete a domain. gone, bye, slay ๐ซถ
Parameters
domainโ the value can be either the ID of a domain or aDomain <#openstack.identity.v3.domain.Domain>instance.ignore_missingโ when it'sFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised if the domain doesn't exist. when it'sTrue, no exception gets set when you try to delete a domain that never existed. we love a graceful exit ๐
Returns
None
๐ฅ find_domain(name_or_id, ignore_missing=True)
Find a single domain. detective mode ๐
Parameters
name_or_idโ the name or ID of a domain.ignore_missingโ set it toFalseand aNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the resource doesn't exist. set it toTrueand you getNoneback when you go hunting for a nonexistent resource. choosing peace, honestly ๐ธ
Returns
One Domain <#openstack.identity.v3.domain.Domain> or None
๐ get_domain(domain)
Get a single domain. just the one. periodt ๐
Parameters
domainโ the value can be the ID of a domain or aDomain <#openstack.identity.v3.domain.Domain>instance.
Returns
One Domain <#openstack.identity.v3.domain.Domain>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
๐ domains(**query)
Retrieve a generator of domains. a whole parade of them ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of domain instances.
โจ update_domain(domain, **attrs)
Update a domain. the glow-up continues ๐ซ
Parameters
domainโ either the ID of a domain or aDomain <#openstack.identity.v3.domain.Domain>instance.attrsโ the attributes to update on the domain represented by domain.
Returns
The updated domain
๐ Domain Config Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
same signature, same energy, we are not re-typing our feelings about it ๐
๐ create_domain_config(domain, **attrs)
Create a new config for a domain from attributes. cute little config baby ๐ง
Parameters
domainโ the value can be the ID of a domain or aDomain <#openstack.identity.v3.domain.Domain>instance.attrsโ keyword arguments which will be used to create aDomainConfig <#openstack.identity.v3.domain_config.DomainConfig>comprised of the properties on theDomainConfigclass.
Returns
The results of domain config creation
๐ฆ delete_domain_config(domain, ignore_missing=True)
Delete a config for a domain. bye config ๐
Parameters
domainโ the value can be the ID of a domain or a aDomain <#openstack.identity.v3.domain.Domain>instance.ignore_missingโ when it'sFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the identity provider doesn't exist. when it'sTrue, no exception gets set when you attempt to delete a nonexistent config for a domain. ๐ซถ
๐ ok so heads up: yes, the original really does say "the identity provider does not exist" in a domain-config method. not a typo I made, not me being chaotic โ copying it faithfully, bestie. don't shoot the messenger ๐
Returns
None
๐ธ get_domain_config(domain)
Get a single config for a domain.
Parameters
domain_idโ the value can be the ID of a domain or aDomain <#openstack.identity.v3.domain.Domain>instance.
Returns
One DomainConfig <#openstack.identity.v3.domain_config.DomainConfig>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
โญ update_domain_config(domain, **attrs)
Update a config for a domain. glow-up, config edition โจ
Parameters
domain_idโ the value can be the ID of a domain or aDomain <#openstack.identity.v3.domain.Domain>instance.attrsโ the attributes to update on the config for a domain represented by domain_id.
Returns
The updated config for a domain
๐ Endpoint Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
yes it's the same giant kwargs list again. it's giving "copy-paste but make it โจdocumentationโจ" ๐
๐ฅ create_endpoint(**attrs)
Create a new endpoint from attributes. new endpoint just dropped ๐
Parameters
attrsโ keyword arguments which will be used to create aEndpoint <#openstack.identity.v3.endpoint.Endpoint>, comprised of the properties on theEndpointclass.
Returns: The results of endpoint creation โจ
delete_endpoint(endpoint, ignore_missing=True)โ Delete an endpoint ๐- Parameters:
endpointโ The value can be either the ID of an endpoint or aEndpoint <#openstack.identity.v3.endpoint.Endpoint>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the endpoint does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent endpoint.
- Returns:
None
- Parameters:
find_endpoint(name_or_id, ignore_missing=True)โ Find a single endpoint ๐- Parameters:
name_or_idโ The name or ID of a endpoint.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
- Returns: One
Endpoint <#openstack.identity.v3.endpoint.Endpoint>orNone
- Parameters:
get_endpoint(endpoint)โ Get a single endpoint ๐ฆ- Parameters:
endpointโ The value can be the ID of an endpoint or aEndpoint <#openstack.identity.v3.endpoint.Endpoint>instance.
- Returns: One
Endpoint <#openstack.identity.v3.endpoint.Endpoint> - Raises:
NotFoundException <#openstack.exceptions.NotFoundException>when no resource can be found.
- Parameters:
endpoints(**query)โ Retrieve a generator of endpoints ๐- Parameters:
queryโ Optional query parameters to be sent to limit the resources being returned.
- Returns: A generator of endpoint instances.
- Parameters:
update_endpoint(endpoint, **attrs)โ Update a endpoint ๐- Parameters:
endpointโ Either the ID of an endpoint or aEndpoint <#openstack.identity.v3.endpoint.Endpoint>instance.attrsโ The attributes to update on the endpoint represented byendpoint.
- Returns: The updated endpoint
- Parameters:
endpoint_group_endpoints(endpoint_group, **query)โ Retrieve a generator of endpoints which are associated with theendpoint_group. ๐- Parameters:
endpoint_groupโ Either theendpoint_groupID or an instance ofEndpointGroupqueryโ Optional query parameters to be sent to limit the resources being returned.
- Returns: A generator of endpoint instances.
- Parameters:
project_endpoints(project, **query)โ Retrieve a generator of endpoints which are associated with theproject. ๐ธ- Parameters:
projectโ Either the project ID or an instance ofProject <#openstack.identity.v3.project.Project>queryโ Optional query parameters to be sent to limit the resources being returned.
- Returns: A generator of endpoint instances.
- Parameters:
associate_endpoint_with_project(project, endpoint)โ Creates a direct association betweenprojectandendpoint๐ฅ- Parameters:
projectโ Either the ID of a project or aProject <#openstack.identity.v3.project.Project>instance.endpointโ Either the ID of an endpoint or aEndpoint <#openstack.identity.v3.endpoint.Endpoint>instance.
- Returns:
None
- Parameters:
disassociate_endpoint_from_project(project, endpoint)โ Removes a direct association betweenprojectandendpoint๐- Parameters:
projectโ Either the ID of a project or aProject <#openstack.identity.v3.project.Project>instance.endpointโ Either the ID of an endpoint or aEndpoint <#openstack.identity.v3.endpoint.Endpoint>instance.
- Returns:
None
- Parameters:
๐ Endpoint Group Operations ๐
Same proxy class signature, exact same kwargs โ here it is in all its glory:
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_endpoint_group(**attrs)โ Create a new endpoint group from attributes ๐- Parameters:
attrsโ Keyword arguments which will be used to create aEndpointGroup, comprised of the properties on theEndpointGroupclass.
- Returns: The results of endpoint group creation
- Parameters:
delete_endpoint_group(endpoint_group, ignore_missing=True)โ Delete an endpoint group ๐- Parameters:
endpoint_groupโ The value can be either the ID of an endpoint group or aEndpointGroupinstance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the endpoint group does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent endpoint group.
- Returns:
None
- Parameters:
find_endpoint_group(name_or_id, ignore_missing=True)โ Find a single endpoint group ๐ฆ- Parameters:
name_or_idโ The name or ID of a endpoint group.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
- Returns: One
EndpointGrouporNone
- Parameters:
get_endpoint_group(endpoint_group)โ Get a single endpoint group ๐- Parameters:
endpoint_groupโ The value can be the ID of an endpoint group or aEndpointGroupinstance.
- Returns: One
EndpointGroup - Raises:
NotFoundException <#openstack.exceptions.NotFoundException>when no resource can be found.
- Parameters:
endpoint_groups(**query)โ Retrieve a generator of endpoint groups โจ- Parameters:
queryโ Optional query parameters to be sent to limit the resources being returned.
- Returns: A generator of endpoint group instances.
- Parameters:
update_endpoint_group(endpoint_group, **attrs)โ Update an endpoint group ๐- Parameters:
endpoint_groupโ Either the ID of an endpoint group or aEndpointGroupinstance.attrsโ The attributes to update on the endpoint group represented byendpoint_group.
- Returns: The updated endpoint group
- Parameters:
project_endpoint_groups(project, **query)โ Retrieve a generator of endpoint groups which are associated with theproject. ๐- Parameters:
projectโ Either the project ID or an instance ofProject <#openstack.identity.v3.project.Project>queryโ Optional query parameters to be sent to limit the resources being returned.
- Returns: A generator of endpoint group instances.
- Parameters:
๐ธ Group Operations ๐ธ
Same proxy class signature again โ no cap, it really is this long:
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_group(**attrs)โ Create a new group from attributes ๐ซถ- Parameters:
attrsโ Keyword arguments which will be used to create aGroup <#openstack.identity.v3.group.Group>, comprised of the properties on theGroupclass.
- Returns: The results of group creation โจ
- Parameters:
delete_group(group, ignore_missing=True)
Delete a group ๐๏ธ โ bye bestie, you're out of the group chat (the literal group chat).
- group โ honestly could be either the ID of a group, or a full
Group <#openstack.identity.v3.group.Group>instance. Either one works, she's flexible. - ignore_missing โ okay so this is the important one. Set it to
Falseand aNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the group doesn't exist. Set it toTrueand no exception will be set when attempting to delete a nonexistent group. SoTrue= "idk her, moving on ๐ ",False= "we're gonna have a problem".
Returns โ None. That's it. Nothing. Void. Silence. ๐
find_group(name_or_id, ignore_missing=True, **query)
Find a single group ๐ โ one (1) group, no more, no less.
- name_or_id โ the name or ID of a group. That's the whole brief.
- ignore_missing โ set to
FalseandNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the resource doesn't exist. Set toTrueandNonegets returned when attempting to find a nonexistent resource. So like, you asked, she's not there, you getNoneand you can go about your day ๐ซถ
Returns โ One Group <#openstack.identity.v3.group.Group> or None. That's the vibe check result.
get_group(group)
Get a single group โญ โ just one, thanks.
- group โ the value can be the ID of a group or a
Group <#openstack.identity.v3.group.Group>instance.
Returns โ One Group <#openstack.identity.v3.group.Group>.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. So if she's not there, she's not there, and the SDK will let you know loudly ๐ญ
groups(**query)
Retrieve a generator of groups โจ โ all of them, streaming in like your feed.
- query โ optional query parameters to be sent to limit the resources being returned. Use this if you don't want the entire population of groups, bestie.
Returns โ a generator of group instances. Generator, not a list, iykyk ๐ฅ
update_group(group, **attrs)
Update a group ๐ โ little glow-up, no big deal.
- group โ either the ID of a group or a
Group <#openstack.identity.v3.group.Group>instance. - attrs โ the attributes to update on the group represented by group. Whatever you pass, that's what changes.
Returns โ the updated group ๐
add_user_to_group(user, group)
Add user to group ๐ซถ โ putting the person in the group chat.
- user โ either the ID of a user or a
User <#openstack.identity.v3.user.User>instance. - group โ either the ID of a group or a
Group <#openstack.identity.v3.group.Group>instance.
Returns โ None. She did the thing and said nothing. Main character energy.
remove_user_from_group(user, group)
Remove user to group ๐ โ yes, that's how the original says it, and yes, it means taking the user out of the group. Nobody's perfect.
- user โ either the ID of a user or a
User <#openstack.identity.v3.user.User>instance. - group โ either the ID of a group or a
Group <#openstack.identity.v3.group.Group>instance.
Returns โ None. Boom, they're out. ๐
check_user_in_group(user, group)
Check whether user belongsto group ๐ โ the ultimate "are they in the group chat or not".
- user โ either the ID of a user or a
User <#openstack.identity.v3.user.User>instance. - group โ either the ID of a group or a
Group <#openstack.identity.v3.group.Group>instance.
Returns โ a boolean representing current relation. So True = they're in, False = they're not. Periodt.
group_users(group, **attrs)
List users in a group ๐ โ the full roster.
- group โ either the ID of a group or a
Group <#openstack.identity.v3.group.Group>instance. - attrs โ heads up, only
password_expires_atcan be filter for result. That is literally the only one, so don't try anything else ๐
Returns โ List of User <#openstack.identity.v3.user.User>. The whole squad, listed out.
๐ฆ Policy Operations ๐ฆ
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Yes bestie, that whole signature is real and every single kwarg is there. Do not ask me to shorten it, I would never ๐ค
create_policy(**attrs)
Create a new policy from attributes โจ โ birthing a policy, iconic.
- attrs โ keyword arguments which will be used to create a
Policy <#openstack.identity.v3.policy.Policy>, comprised of the properties on thePolicyclass.
Returns โ the results of policy creation. Look at her, she's created ๐
delete_policy(policy, ignore_missing=True)
Delete a policy ๐๏ธ โ say bye.
- policy โ the value can be either the ID of a policy or a
Policy <#openstack.identity.v3.policy.Policy>instance. - ignore_missing โ set to
FalseandNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the policy does not exist. Set toTrueand no exception will be set when attempting to delete a nonexistent policy. Ghost policy? No problem. ๐ซถ
Returns โ None. Nothing to report.
find_policy(name_or_id, ignore_missing=True)
Find a single policy ๐ โ just the one, thank you.
- name_or_id โ the name or ID of a policy.
- ignore_missing โ set to
FalseandNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. Set toTrueandNonewill be returned when attempting to find a nonexistent resource. She's either there or she's aNone, no drama.
Returns โ One Policy <#openstack.identity.v3.policy.Policy> or None.
get_policy(policy)
Get a single policy โญ โ grab her.
- policy โ the value can be the ID of a policy or a
Policy <#openstack.identity.v3.policy.Policy>instance.
Returns โ One Policy <#openstack.identity.v3.policy.Policy>.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. Loud and clear ๐ข
policies(**query)
Retrieve a generator of policies ๐ โ all of them, one by one.
- query โ optional query parameters to be sent to limit the resources being returned. Filtering is self-care.
Returns โ a generator of policy instances. Not a list! A generator. Ngl this matters.
update_policy(policy, **attrs)
Update a policy ๐ โ the glow-up chapter.
- policy โ either the ID of a policy or a
Policy <#openstack.identity.v3.policy.Policy>instance. - attrs โ the attributes to update on the policy represented by policy.
Returns โ the updated policy. Serving fresh โจ
๐ธ Project Operations ๐ธ
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Same signature, same energy, different operations. She's consistent like that. ๐
create_project(**attrs)
Create a new project from attributes ๐ฅ โ new project, new era.
- attrs โ keyword arguments which will be used to create a
Project <#openstack.identity.v3.project.Project>, comprised of the properties on theProjectclass.
Returns โ the results of project creation. Slay.
delete_project(project, ignore_missing=True)
Delete a project ๐ โ close the whole thing down.
- project โ the value can be either the ID of a project or a
Project <#openstack.identity.v3.project.Project>instance. - ignore_missing โ set to
FalseandNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the project does not exist. Set toTrueand no exception will be set when attempting to delete a nonexistent project. So if you're not sure she's real, leave it atTrueand move on with your life ๐
Returns โ None.
find_project(name_or_id, ignore_missing=True, **query)
Find a single project ๐ฆ โ one project, coming right up.
- name_or_id โ the name or ID of a project.
ignore_missingโ bestie, if you set this toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets thrown the moment the resource doesn't exist, no cap. Set it toTrueinstead and you just getNoneback when you go looking for something that's not there. Softest possible landing tbh ๐ซถ
Returns
One Project <#openstack.identity.v3.project.Project> or None โ that's it, that's the whole vibe โจ
๐ get_project(project)
Grab exactly one project. One. Singular. Main character only ๐
Parameters
- project โ this can be the ID of a project, or a whole
Project <#openstack.identity.v3.project.Project>instance if you already have one chilling in your code.
Returns
One Project <#openstack.identity.v3.project.Project> ๐
Heads up: this Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. So if there's nothing there, it WILL tell you, loudly ๐ญ
๐ธ projects(**query)
Retrieve a generator of projects โ like, all of them, streaming at you one at a time, no big list energy ๐ฆ
Parameters
- query โ optional query parameters you can send along to limit the resources being returned. Filter away, queen ๐
Returns
A generator of project instances. It's giving infinite scroll but for projects fr fr.
๐ user_projects(user, **query)
Retrieve a generator of projects to which the user has authorization to access. Basically "what can this person even touch" check ๐ฅ
Parameters
- user โ either the user id or an instance of
User <#openstack.identity.v3.user.User> - query โ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of project instances ๐
โญ endpoint_projects(endpoint, **query)
Retrieve a generator of projects which are associated with the endpoint. The linkage detective work, lowkey iconic ๐ต๏ธโโ๏ธ
Parameters
- endpoint โ either the endpoint ID or an instance of
Endpoint <#openstack.identity.v3.endpoint.Endpoint> - query โ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of project instances ๐
๐ฆ update_project(project, **attrs)
Update a project. Glow-up time โจ
Parameters
- project โ either the ID of a project or a
Project <#openstack.identity.v3.project.Project>instance. - attrs โ the attributes to update on the project represented by project.
Returns
The updated project ๐
๐ endpoint_group_projects(endpoint_group, **query)
Retrieve a generator of projects which are associated with the endpoint group. Group-chat membership but for projects, iykyk ๐ซถ
Parameters
- group (endpoint) โ either the endpoint group ID or an instance of
EndpointGroup - query โ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of project instances ๐
๐ associate_project_with_endpoint_group(endpoint_group, project)
Create a direct association between the endpoint group and project. Matchmaker, matchmaker ๐ง
Parameters
- endpoint_group โ either the ID of an endpoint group or a
EndpointGroupinstance. - project โ either the ID of a project or a
Project <#openstack.identity.v3.project.Project>instance.
Returns
None โ nothing back, but the connection is made, trust ๐
๐ disassociate_project_from_endpoint_group(endpoint_group, project)
Removes a direct association between endpoint group and project. Unmatching, we've all been there ๐ญ
Parameters
- endpoint_group โ either the ID of an endpoint group or a
EndpointGroupinstance. - project โ either the ID of a project or a
Project <#openstack.identity.v3.project.Project>instance.
Returns
None ๐ซฅ
โจ Service Operations โจ
Okay so here's the class you're working through. Copy it exactly, don't be creative with it bestie:
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐
create_service(**attrs)
Create a new service from attributes. New service just dropped ๐ฅ
Parameters
- attrs โ keyword arguments which will be used to create a
Service <#openstack.identity.v3.service.Service>, comprised of the properties on theServiceclass.
Returns
The results of service creation โจ
๐ง delete_service(service, ignore_missing=True)
Delete a service. Bye bestie ๐
Parameters
- service โ the value can be either the ID of a service or a
Service <#openstack.identity.v3.service.Service>instance. - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the service does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent service. Chill mode is the default ๐ซถ
Returns
None
๐ find_service(name_or_id, ignore_missing=True)
Find a single service. Detective mode, activated ๐ต๏ธโโ๏ธ
Parameters
- name_or_id โ the name or ID of a service.
- ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns
One Service <#openstack.identity.v3.service.Service> or None โ could go either way, honestly ๐
๐ get_service(service)
Get a single service. Just the one. Very demure ๐ธ
Parameters
- service โ the value can be the ID of a service or a
Service <#openstack.identity.v3.service.Service>instance.
Returns
One Service <#openstack.identity.v3.service.Service> โญ
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. So like, don't be surprised ๐ญ
๐ฆ services(**query)
Retrieve a generator of services โ streaming the whole lineup at you ๐
Parameters
- query โ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of service instances. Periodt.
๐ update_service(service, **attrs)
Update a service. Service glow-up arc ๐
Parameters
- service โ either the ID of a service or a
Service <#openstack.identity.v3.service.Service>instance. - attrs โ the attributes to update on the service represented by service.
Returns
The updated service ๐ฅ
๐ User Operations ๐
Same class, same exact signature โ yes, it's the same block again, that's just how the page is laid out, don't come for me ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ create_user(**attrs)
Create a new user from attributes. New person, who dis ๐
Parameters
- attrs โ keyword arguments which will be used to create a
User <#openstack.identity.v3.user.User>, comprised of the properties on theUserclass.
Returns
The results of user creation โจ
๐ธ delete_user(user, ignore_missing=True)
Delete a user. It's giving blocked ๐ซฅ
Parameters
- user โ the value can be either the ID of a user or a
User <#openstack.identity.v3.user.User>instance. - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the user does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent user.
Returns
None ๐
โญ find_user(name_or_id, ignore_missing=True, **query)
Find a single user. Where they at ๐
Parameters
- name_or_id โ the name or ID of a user.
ignore_missingโ vibe check on missing stuff: set it toFalseand aNotFoundException<#openstack.exceptions.NotFoundException> gets thrown the moment the resource doesn't exist. Set it toTrueand you just getNoneback when you go looking for something that isn't there. no drama, no crash. ๐ซถ
Returns One User <#openstack.identity.v3.user.User> or None
get_user(user)
Get a single user. one. just the one. ๐
Parameters
userโ can be the ID of a user, or aUser<#openstack.identity.v3.user.User> instance. either is slay.
Returns One User <#openstack.identity.v3.user.User>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. so like, if it's giving nothing, it tells you. ๐ญ
user_groups(user)
List groups a user is in. like, which group chats is this person actually in. ๐
Parameters
userโ either the ID of a user or aUser<#openstack.identity.v3.user.User> instance
Returns List of group
users(**query)
Retrieve a generator of users. all of them. a whole generator, so it's lowkey efficient bestie. โจ
Parameters
queryโ Optional query parameters to be sent to limit the resources being returned.
Returns A generator of user instances.
update_user(user, **attrs)
Update a user. glow-up time. ๐ฆ
Parameters
userโ Either the ID of a user or aUser<#openstack.identity.v3.user.User> instance.attrsโ The attributes to update on the user represented byattrs.
Returns The updated user
update_password(user, current_password, password)
Update the password for the user the token belongs to. putting in the old one to set the new one, very "confirm your identity" of it. ๐
Parameters
userโ Either the ID of a user or aUser<#openstack.identity.v3.user.User> instance.current_passwordโ The user's current password.passwordโ The user's new password.
Returns None
๐ Token Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
validate_token(token, nocatalog=False, allow_expired=False)
Validate a token. is it real? is it valid? we find out. ๐ฅ
Parameters
tokenโ The token to validate.nocatalogโ Whether the returned token should not include a catalog.allow_expiredโ Whether to allow expired tokens.
Returns A Token <#openstack.identity.v3.token.Token>.
check_token(token, allow_expired=False)
Check if a token is valid. simple yes-or-no energy. โญ
Parameters
tokenโ The token to check.allow_expiredโ Whether to allow expired tokens.
Returns True if valid, else False.
revoke_token(token)
Revoke a token. blocking them. unfollowing. it's over. ๐
Parameters
tokenโ The token to revoke.
Returns None
๐ Trust Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_trust(**attrs)
Create a new trust from attributes. building trust fr fr. ๐ซถ
Parameters
attrsโ Keyword arguments which will be used to create aTrust<#openstack.identity.v3.trust.Trust>, comprised of the properties on theTrustclass.
Returns The results of trust creation
delete_trust(trust, ignore_missing=True)
Delete a trust. okay bye. ๐
Parameters
trustโ The value can be either the ID of a trust or aTrust<#openstack.identity.v3.trust.Trust> instance.ignore_missingโ When set toFalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the credential does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent credential.
Returns None
find_trust(name_or_id, ignore_missing=True)
Find a single trust. where is it. we must locate it. ๐
Parameters
name_or_idโ The name or ID of a trust.ignore_missingโ When set toFalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns One Trust <#openstack.identity.v3.trust.Trust> or None
get_trust(trust)
Get a single trust. just the one. giving main character. ๐
Parameters
trustโ The value can be the ID of a trust or aTrust<#openstack.identity.v3.trust.Trust> instance.
Returns One Trust <#openstack.identity.v3.trust.Trust>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
trusts(**query)
Retrieve a generator of trusts. the whole collection, lazily. โจ
Parameters
queryโ Optional query parameters to be sent to limit the resources being returned.
Returns A generator of trust instances.
๐ Region Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_region(**attrs)
Create a new region from attributes. new region just dropped. ๐
Parameters
attrsโ Keyword arguments which will be used to create aRegion<#openstack.identity.v3.region.Region>, comprised of the properties on theRegionclass.
Returns The results of region creation.
delete_region(region, ignore_missing=True)
Delete a region. yeeting it. ๐๏ธ
Parameters
regionโ The value can be either the ID of a region or aRegion<#openstack.identity.v3.region.Region> instance.ignore_missingโ When set toFalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the region does not exist. When set toTrue, no exception will be thrown when attempting to delete a nonexistent region.
Returns None
find_region(name_or_id, ignore_missing=True)
Find a single region. gotta find it first bestie. ๐
Parameters
name_or_idโ The name or ID of a region.ignore_missingโ When set toFalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the region does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent region.
Returns One Region <#openstack.identity.v3.region.Region> or None
get_region(region)
Get a single region. ๐
Parameters
regionโ The value can be the ID of a region or aRegion<#openstack.identity.v3.region.Region> instance.
Returns One Region <#openstack.identity.v3.region.Region>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no matching region can be found.
regions(**query)
Retrieve a generator of regions
Parameters
queryโ optional query params bestie, sent along to limit the regions being returned. ๐
Returns
A generator of region instances. โจ
โจ update_region(region, **attrs) โจ
Update a region. We love a lil glow-up. ๐
Parameters
regionโ either the ID of a region or aRegioninstance (openstack.identity.v3.region.Region). ๐ฆattrsโ the attributes to update on the region represented byregion. ๐
Returns
The updated region. Slay. ๐
๐ Role Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ธ create_role(**attrs) ๐ธ
Create a shiny new role from attributes. Main character creation energy. ๐ซ
Parameters
attrsโ keyword arguments used to create aRole(openstack.identity.v3.role.Role), made up of the properties on theRoleclass. ๐
Returns
The results of role creation. Obsessed. ๐
๐ฆ delete_role(role, ignore_missing=True) ๐ฆ
Delete a role. Bye bestie. ๐
Parameters
roleโ the value can be either the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the role does not exist. When set toTrue, no exception will be thrown when attempting to delete a nonexistent role. ๐
Returns
None โ that's literally it. ๐คทโโ๏ธ
๐ find_role(name_or_id, ignore_missing=True, **query) ๐
Find a single role. Detective mode: activated. ๐
Parameters
name_or_idโ the name or ID of a role. ๐ฆignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the role does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent role. ๐ญ
Returns
One Role (openstack.identity.v3.role.Role) or None. ๐
โจ get_role(role) โจ
Get a single role. Gimme gimme. ๐ซถ
Parameters
roleโ the value can be the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐ธ
Returns
One Role (openstack.identity.v3.role.Role). ๐
Raises
NotFoundException (openstack.exceptions.NotFoundException) when no matching role can be found. ๐
๐ roles(**query) ๐
Retrieve a generator of roles. Endless scroll, but make it IAM. ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. The options are:domain_id,name. โจ
Returns
A generator of role instances. ๐ฆ
๐ update_role(role, **attrs) ๐
Update a role. Small tweaks, big vibes. ๐
Parameters
roleโ either the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐kwargsโ the attributes to update on the role represented by value. Onlynamecan be updated. โ ๏ธ
Returns
The updated role. Slay. ๐
๐ Role Assignment Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ฆ role_assignments_filter(domain=None, project=None, system=None, group=None, user=None) ๐ฆ
Retrieve a generator of roles assigned to user/group. Filtering era. ๐
Parameters
domainโ either the ID of a domain or aDomaininstance (openstack.identity.v3.domain.Domain). ๐ธprojectโ either the ID of a project or aProjectinstance (openstack.identity.v3.project.Project). ๐systemโ either the system name or aSysteminstance (openstack.identity.v3.system.System). ๐ฆgroupโ either the ID of a group or aGroupinstance (openstack.identity.v3.group.Group). ๐userโ either the ID of a user or aUserinstance (openstack.identity.v3.user.User). โจ
Returns
A generator of role instances. ๐
๐ role_assignments(**query) ๐
Retrieve a generator of role assignments. The lore. ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. The options are:group_id,role_id,scope_domain_id,scope_project_id,inherited_to,user_id,include_names,include_subtree. ๐
Returns
RoleAssignment (openstack.identity.v3.role_assignment.RoleAssignment). ๐
๐ธ assign_domain_role_to_user(domain, user, role, *, inherited=False) ๐ธ
Assign role to user on a domain. Giving them the keys, respectfully. ๐
Parameters
domainโ either the ID of a domain or aDomaininstance (openstack.identity.v3.domain.Domain). ๐ฆuserโ either the ID of a user or aUserinstance (openstack.identity.v3.user.User). ๐roleโ either the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐inheritedโ whether the role assignment is inherited. ๐ฑ
Returns
None โ no cap. โจ
๐ฆ unassign_domain_role_from_user(domain, user, role, *, inherited=False) ๐ฆ
Unassign role from user on a domain. Revoking access, iconic behavior. ๐ซ
Parameters
domainโ either the ID of a domain or aDomaininstance (openstack.identity.v3.domain.Domain). ๐ธuserโ either the ID of a user or aUserinstance (openstack.identity.v3.user.User). ๐roleโ either the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐inheritedโ whether the role assignment is inherited. ๐ฑ
Returns
None. Periodt. ๐
โจ validate_user_has_domain_role(domain, user, role, *, inherited=False) โจ
Validates that a user has a role on a domain. Vibe check, but for IAM. โ
Parameters
domainโ either the ID of a domain or aDomaininstance (openstack.identity.v3.domain.Domain). ๐ฆuserโ either the ID of a user or aUserinstance (openstack.identity.v3.user.User). ๐roleโ either the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐
Returns
True if user has role in domain. ๐ฅ
๐ assign_domain_role_to_group(domain, group, role, *, inherited=False) ๐
Assign role to group on a domain. Group chat gets permissions. ๐ฌ
Parameters
domainโ either the ID of a domain or aDomaininstance (openstack.identity.v3.domain.Domain). ๐ธgroupโ either the ID of a group or aGroupinstance (openstack.identity.v3.group.Group). ๐ฆroleโ either the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐inheritedโ whether the role assignment is inherited. ๐ฑ
Returns
None. ๐
๐ unassign_domain_role_from_group(domain, group, role, *, inherited=False) ๐
Unassign role from group on a domain. Removing them from the group project. ๐ญ
Parameters
domainโ either the ID of a domain or aDomaininstance (openstack.identity.v3.domain.Domain). ๐groupโ either the ID of a group or aGroupinstance (openstack.identity.v3.group.Group). ๐ฆroleโ either the ID of a role or aRoleinstance (openstack.identity.v3.role.Role). ๐inheritedโ whether the role assignment is inherited. ๐ฑ
Returns
None. ๐ซถ
๐ validate_group_has_domain_role(domain, group, role, *, inherited=False) ๐
Validates that a group has a role on a domain. Checking the receipts. ๐งพ
Parameters
domainโ either the ID of a domain, or aDomaininstance (that'sopenstack.identity.v3.domain.Domainfor you โจ)groupโ either the ID of a group, or aGroupinstance (openstack.identity.v3.group.Group)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)
Returns โ True if the group has that role on the domain ๐ซถ
assign_project_role_to_user(project, user, role, *, inherited=False)
Hand a role to a user, on a project. That's it, that's the vibe ๐
Parameters
projectโ either the ID of a project, or aProjectinstance (openstack.identity.v3.project.Project)userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)inheritedโ whether the role assignment is inherited ๐
Returns โ None
unassign_project_role_from_user(project, user, role, *, inherited=False)
Take that role back from the user on a project. Reversal arc, we love to see it ๐ญ
Parameters
projectโ either the ID of a project, or aProjectinstance (openstack.identity.v3.project.Project)userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)inheritedโ whether the role assignment is inherited ๐
Returns โ None
validate_user_has_project_role(project, user, role, *, inherited=False)
Checks that a user fr fr has a role on a project ๐
Parameters
projectโ either the ID of a project, or aProjectinstance (openstack.identity.v3.project.Project)userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)
Returns โ True if the user has that role in the project ๐
assign_project_role_to_group(project, group, role, *, inherited=False)
Same energy as the user version, but the whole group eats ๐
Parameters
projectโ either the ID of a project, or aProjectinstance (openstack.identity.v3.project.Project)groupโ either the ID of a group, or aGroupinstance (openstack.identity.v3.group.Group)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)inheritedโ whether the role assignment is inherited ๐
Returns โ None
unassign_project_role_from_group(project, group, role, *, inherited=False)
Yank the role back off the group on that project ๐
Parameters
projectโ either the ID of a project, or aProjectinstance (openstack.identity.v3.project.Project)groupโ either the ID of a group, or aGroupinstance (openstack.identity.v3.group.Group)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)inheritedโ whether the role assignment is inherited ๐
Returns โ None
validate_group_has_project_role(project, group, role, *, inherited=False)
Vibe check: does this group actually have this role on this project? ๐
Parameters
projectโ either the ID of a project, or aProjectinstance (openstack.identity.v3.project.Project)groupโ either the ID of a group, or aGroupinstance (openstack.identity.v3.group.Group)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)
Returns โ True if the group has that role in the project โจ
assign_system_role_to_user(user, role, system)
Now we're at the system level โ assign a role to a user on a system, no inherited kwarg here bestie, note the difference ๐
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)systemโ the system name
Returns โ None
unassign_system_role_from_user(user, role, system)
Take the system-level role away from the user. Bye bestie ๐
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)systemโ the system name
Returns โ None
validate_user_has_system_role(user, role, system)
Does the user hold this role on the system? Let's find out ๐ฅ
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)systemโ the system name
Returns โ True if the user has that role in the system ๐
assign_system_role_to_group(group, role, system)
Group edition of the system-level handout. Same three args, no kwarg ๐
Parameters
groupโ either the ID of a group, or aGroupinstance (openstack.identity.v3.group.Group)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)systemโ the system name
Returns โ None
unassign_system_role_from_group(group, role, system)
And the un-assign for the group on the system. Clean up your messes, icon ๐
Parameters
groupโ either the ID of a group, or aGroupinstance (openstack.identity.v3.group.Group)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)systemโ the system name
Returns โ None
validate_group_has_system_role(group, role, system)
Checks whether the group has the role on the system. The final vibe check of this little saga ๐ฆ
Parameters
groupโ either the ID of a group, or aGroupinstance (openstack.identity.v3.group.Group)roleโ either the ID of a role, or aRoleinstance (openstack.identity.v3.role.Role)systemโ the system name
Returns โ True if the group has that role on the system โญ
๐ Registered Limit Operations ๐
New section, new obsession. Meet the proxy class in all its glory โ yes we're printing the whole signature, it's giving main character ๐ง
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
registered_limits(**query)
Gives you a generator of registered_limits โ yes, a generator, so it's lazy and cute about it โจ
Parameters
queryโ optional query parameters, sent along to limit whichregistered_limitscome back to you.
Returns โ a generator of registered_limits instances. That's RegisteredLimit (openstack.identity.v3.registered_limit.RegisteredLimit) ๐ซถ
get_registered_limit(registered_limit)
Grabs one single registered_limit. Just the one. Lowkey the simplest method here ๐
Parameters
registered_limitโ the value can be the ID of aregistered_limit, or aRegisteredLimitinstance (openstack.identity.v3.registered_limit.RegisteredLimit).
Returns โ one RegisteredLimit (openstack.identity.v3.registered_limit.RegisteredLimit).
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found ๐ญ
create_registered_limit(**attrs)
Builds a brand-new registered_limit out of attributes you pass in ๐ธ
Parameters
attrsโ keyword arguments which will be used to create aRegisteredLimit(openstack.identity.v3.registered_limit.RegisteredLimit), comprised of the properties on theRegisteredLimitclass.
Returns โ the results of registered_limit creation.
update_registered_limit(registered_limit, **attrs)
Updates an existing registered_limit, because glow-ups are real ๐
Parameters
aaaand the parameter list is where this part cuts off โ next part picks it right back up, don't @ me ๐
registered_limitโ either the ID of aregistered_limit, or aRegisteredLimitinstance (openstack.identity.v3.registered_limit.RegisteredLimitfor the full flex ๐ ).kwargsโ the attributes you want to update on theregistered_limitthatvaluepoints at.
Returns โ the updated registered_limit. slay โจ
๐ delete_registered_limit(registered_limit, ignore_missing=True)
Deletes a registered_limit. bye bestie ๐
Parameters
registered_limitโ either the ID of a registered_limit, or aRegisteredLimitinstance (openstack.identity.v3.registered_limit.RegisteredLimit).ignore_missingโ set it toFalseandNotFoundException(openstack.exceptions.NotFoundException) will be raised when the registered_limit doesn't exist. Set it toTrueand nothing gets thrown when you try to delete a registered_limit that was never there. no drama, no exception ๐ซถ
Returns โ None
๐ Limit Operations
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐งต limits(**query)
Gives you a generator of limits. it's giving infinite scroll but make it quotas ๐
Parameters
queryโ optional query parameters, sent along to limit which limits get returned. yes we said limit twice, it's that kind of day.
Returns โ a generator of limits instances. ๐
๐ get_limit(limit)
Grabs one single limit. just the one. main character only ๐
Parameters
limitโ the value can be the ID of a limit, or aLimitinstance (openstack.identity.v3.limit.Limit).
Returns โ one Limit (openstack.identity.v3.limit.Limit).
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ
๐ ๏ธ create_limit(**attrs)
Makes a whole new limit out of attributes. build-a-bear but for identity quotas ๐งธ
Parameters
attrsโ keyword arguments that get used to create aLimit(openstack.identity.v3.limit.Limit), made up of the properties on theLimitclass.
Returns โ the results of limit creation. new limit just dropped ๐ฅ
โ๏ธ update_limit(limit, **attrs)
Updates a limit. glow-up time ๐
Parameters
limitโ either the ID of a limit. or aLimitinstance (openstack.identity.v3.limit.Limit).kwargsโ the attributes to update on the limit represented by value.
Returns โ the updated limit.
๐๏ธ delete_limit(limit, ignore_missing=True)
Deletes a limit. it's over bestie ๐
Parameters
limitโ the value can be either the ID of a limit, or aLimitinstance (openstack.identity.v3.limit.Limit).ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the limit does not exist. When set toTrue, no exception will be thrown when attempting to delete a nonexistent limit. lowkey the most forgiving flag ever ๐ซถ
Returns โ None
๐ฆ Application Credential Operations
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐๏ธ application_credentials(user, **query)
Hands you a generator of application credentials. no passwords, just vibes โจ
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User).queryโ optional query parameters that get sent to limit the resources being returned.
Returns โ a generator of application credentials instances, i.e. ApplicationCredential (openstack.identity.v3.application_credential.ApplicationCredential).
๐ get_application_credential(user, application_credential)
Gets one single application credential. one (1) credential. iconic ๐
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User).application_credentialโ the value can be the ID of a application credential, or anApplicationCredentialinstance (openstack.identity.v3.application_credential.ApplicationCredential).
Returns โ one ApplicationCredential (openstack.identity.v3.application_credential.ApplicationCredential).
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
๐ช create_application_credential(user, name, **attrs)
Creates a brand new application credential from attributes. fresh credential, who dis ๐ธ
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User).nameโ the name of the application credential, which is unique to the user.attrsโ keyword arguments which will be used to create anApplicationCredential(openstack.identity.v3.application_credential.ApplicationCredential), comprised of the properties on theApplicationCredentialclass.
Returns โ the results of application credential creation.
๐ต๏ธ find_application_credential(user, name_or_id, ignore_missing=True, **query)
Finds one single application credential. detective mode ๐
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User).name_or_idโ the name or ID of an application credential.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. soft launch of a search, honestly ๐ซถ
Returns โ one ApplicationCredential (openstack.identity.v3.application_credential.ApplicationCredential) or None
๐งน delete_application_credential(user, application_credential, ignore_missing=True)
Deletes an application credential. revoke, block, delete ๐
Parameters
userโ either the ID of a user, or aUserinstance (openstack.identity.v3.user.User).application_credentialโ the value can be either the ID of an application credential, or anApplicationCredentialinstance (openstack.identity.v3.application_credential.ApplicationCredential).ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the application credential does not exist. When set toTrue, no exception will be thrown when attempting to delete a nonexistent application credential.
Returns โ None
๐ง Federation Protocol Operations
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ create_federation_protocol(idp, **attrs)
Creates a new federation protocol from attributes. crossing identity providers like it's nothing ๐ซ
Parameters
delete_federation_protocol(idp, protocol, ignore_missing=True)โ bestie, this deletes a federation protocol. gone. poof. ๐
Parameters:
idpโ the ID, or anIdentityProviderinstance (that'sopenstack.identity.v3.identity_provider.IdentityProvider), of the identity provider that the protocol is attached to. Pro tip from the docs: this can beNoneifprotocolis itself aFederationProtocol(openstack.identity.v3.federation_protocol.FederationProtocol) instance. ๐ซถprotocolโ the ID of a federation protocol, or aFederationProtocol(openstack.identity.v3.federation_protocol.FederationProtocol) instance.ignore_missingโ set it toFalseand aNotFoundException(openstack.exceptions.NotFoundException) gets raised when the federation protocol doesn't exist. set it toTrueand no exception fires when you try to delete a nonexistent federation protocol. no drama, no error, just vibes. โจ
Returns: None
find_federation_protocol(idp, protocol, ignore_missing=True)โ finds you a single federation protocol, like the world's most helpful search bar ๐
Parameters:
idpโ the ID, or anIdentityProvider(openstack.identity.v3.identity_provider.IdentityProvider) instance, of the identity provider the protocol is attached to.protocolโ the name or ID of a federation protocol.ignore_missingโFalsemeans aNotFoundException(openstack.exceptions.NotFoundException) gets raised when the resource doesn't exist.Truemeans you just getNoneback when you go looking for a nonexistent resource. it's giving "no thoughts, justNone" ๐
Returns: one federation protocol, or None
get_federation_protocol(idp, protocol)โ grabs a single federation protocol, no searching around
Parameters:
idpโ the ID, or anIdentityProvider(openstack.identity.v3.identity_provider.IdentityProvider) instance, of the identity provider the protocol is attached to. can beNoneifprotocolis aFederationProtocol(openstack.identity.v3.federation_protocol.FederationProtocol) instance.protocolโ the value can be the ID of a federation protocol, or aFederationProtocol(openstack.identity.v3.federation_protocol.FederationProtocol) instance.
Returns: one federation protocol
Raises: NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. ๐
federation_protocols(idp, **query)โ hands you a generator of federation protocols, iconic generator behaviour fr fr
Parameters:
idpโ the ID, or anIdentityProvider(openstack.identity.v3.identity_provider.IdentityProvider) instance, of the identity provider the protocol is attached to.queryโ optional query parameters, sent along to limit the resources being returned. use them, bestie, your list will thank you ๐
Returns: a generator of federation protocol instances.
update_federation_protocol(idp, protocol, **attrs)โ glow-up time for a federation protocol โจ
Parameters:
idpโ the ID, or anIdentityProvider(openstack.identity.v3.identity_provider.IdentityProvider) instance, of the identity provider the protocol is attached to. can beNoneifprotocolis aFederationProtocol(openstack.identity.v3.federation_protocol.FederationProtocol) instance.protocolโ either the ID of a federation protocol, or aFederationProtocol(openstack.identity.v3.federation_protocol.FederationProtocol) instance.attrsโ the attributes to update on the federation protocol represented byprotocol.
Returns: the updated federation protocol
๐บ๏ธ Mapping Operations ๐บ๏ธ
Same class energy, one more time โ because yes, it's literally the same signature. here it is in full:
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_mapping(**attrs)
Creates a brand-new mapping from attributes โ mapping main character energy ๐
Parameters:
attrsโ keyword arguments which will be used to create aMapping(openstack.identity.v3.mapping.Mapping), comprised of the properties on theMappingclass.
Returns: the results of mapping creation ๐
delete_mapping(mapping, ignore_missing=True)
Deletes a mapping. bye bestie ๐ฆ
Parameters:
mappingโ the ID of a mapping, or aMapping(openstack.identity.v3.mapping.Mapping) instance.ignore_missingโ set toFalseand aNotFoundException(openstack.exceptions.NotFoundException) is raised when the mapping doesn't exist. set toTrueand no exception gets set when you attempt to delete a nonexistent mapping. we love a soft landing ๐
Returns: None
find_mapping(name_or_id, ignore_missing=True)
Finds a single mapping โ detective mode activated ๐
Parameters:
name_or_idโ the name or ID of a mapping.ignore_missingโFalsemeans aNotFoundException(openstack.exceptions.NotFoundException) gets raised when the resource doesn't exist.TruemeansNonecomes back when you attempt to find a nonexistent resource.
Returns: one Mapping (openstack.identity.v3.mapping.Mapping), or None
get_mapping(mapping)
Gets a single mapping, straightforward, no cap
Parameters:
mappingโ the value can be the ID of a mapping, or aMapping(openstack.identity.v3.mapping.Mapping) instance.
Returns: one Mapping (openstack.identity.v3.mapping.Mapping)
Raises: NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ
mappings(**query)
Retrieves a generator of mappings โ yes, a generator, they're everywhere, get used to it โจ
Parameters:
queryโ optional query parameters to be sent to limit the resources being returned.
Returns: a generator of mapping instances.
update_mapping(mapping, **attrs)
Updates a mapping. little refresh, little self-care ๐
Parameters:
mappingโ either the ID of a mapping, or aMapping(openstack.identity.v3.mapping.Mapping) instance.attrsโ the attributes to update on the mapping represented bymapping.
Returns: the updated mapping
๐ชช Identity Provider Operations ๐ชช
And one more time, the class signature, identical, because the docs said so and we do not skip details on this page:
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_identity_provider(**attrs)
Creates a new identity provider from attributes โ birth of an icon ๐
Parameters:
attrsโ keyword arguments which will be used to create anIdentityProvider(openstack.identity.v3.identity_provider.IdentityProvider), comprised of the properties on theIdentityProviderclass.
Returns: the results of identity provider creation โญ
delete_identity_provider(identity_provider, ignore_missing=True)โ bestie, this deletes an identity provider, periodt ๐๏ธ
Parameters:
- identity_provider โ the ID of an identity provider, or a
IdentityProviderinstance (link:<#openstack.identity.v3.identity_provider.IdentityProvider>). - ignore_missing โ set this to
Falseand aNotFoundException(link:<#openstack.exceptions.NotFoundException>) will be raised when the identity provider doesn't exist. Set it toTrue(the default, bestie) and literally nothing happens when you try to delete a nonexistent one. No drama. ๐
Returns: None
find_identity_provider(name_or_id, ignore_missing=True)โ finds you a single identity provider, like a little scavenger hunt ๐
Parameters:
- name_or_id โ the name or ID of an identity provider.
- ignore_missing โ set to
FalseandNotFoundException(link:<#openstack.exceptions.NotFoundException>) gets raised when the resource doesn't exist. Set toTrueand you just getNoneback when it can't find anything.
Returns: the details of an identity provider or None.
get_identity_provider(identity_provider)โ get one single mapping (yes, the docs say "mapping" here, we don't ask questions ๐ญ)
Parameters:
- mapping โ the value can be the ID of an identity provider or a
IdentityProviderinstance (link:<#openstack.identity.v3.identity_provider.IdentityProvider>).
Returns: the details of an identity provider.
Raises NotFoundException (link: <#openstack.exceptions.NotFoundException>) when no resource can be found. ๐
identity_providers(**query)โ retrieve a whole generator of identity providers, we love a generator moment โจ
Parameters:
- query โ optional query parameters you send to limit the resources being returned.
Returns: a generator of identity provider instances. IdentityProvider (link: <#openstack.identity.v3.identity_provider.IdentityProvider>)
update_identity_provider(identity_provider, **attrs)โ update a mapping, glow-up edition ๐
Parameters:
- mapping โ either the ID of an identity provider or a
IdentityProviderinstance (link:<#openstack.identity.v3.identity_provider.IdentityProvider>). - attrs โ the attributes to update on the identity_provider represented by identity_provider.
Returns: the updated identity provider.
๐ Access Rule Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
access_rules(user, **query)โ retrieve a generator of access rules, so many rules bestie ๐ฆ
Parameters:
- user โ either the ID of a user or a
Userinstance (link:<#openstack.identity.v3.user.User>). - query โ optional query parameters to send to limit the resources being returned.
Returns: a generator of access rules instances.
delete_access_rule(user, access_rule, ignore_missing=True)โ deletes an access rule, bye bye ๐
Parameters:
- user โ either the ID of a user or a
Userinstance (link:<#openstack.identity.v3.user.User>). - access_rule โ the value can be either the ID of an access rule or a
AccessRuleinstance. - ignore_missing โ set to
FalseandNotFoundException(link:<#openstack.exceptions.NotFoundException>) gets raised when the access rule doesn't exist. Set toTrueand no exception gets thrown when you try to delete a nonexistent access rule.
Returns: None
๐ Service Provider Operations ๐
class openstack.identity.v3._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_service_provider(**attrs)โ makes a brand new service provider from attributes, slay ๐
Parameters:
- attrs โ keyword arguments which will be used to create a
ServiceProvider, comprised of the properties on theServiceProviderclass.
Returns: the results of service provider creation.
delete_service_provider(service_provider, ignore_missing=True)โ delete a service provider, no cap ๐๏ธ
Parameters:
- service_provider โ the ID of a service provider or a
ServiceProviderinstance. - ignore_missing โ set to
FalseandNotFoundException(link:<#openstack.exceptions.NotFoundException>) will be raised when the service provider doesn't exist. Set toTrueand no exception gets set when attempting to delete a nonexistent service provider.
Returns: None
find_service_provider(name_or_id, ignore_missing=True)โ find a single service provider, good luck bestie ๐
Parameters:
- name_or_id โ the name or ID of a service provider.
- ignore_missing โ set to
FalseandNotFoundException(link:<#openstack.exceptions.NotFoundException>) will be raised when the resource doesn't exist. Set toTrueandNonegets returned when attempting to find a nonexistent resource.
Returns: the details of an service provider or None.
get_service_provider(service_provider)โ get a single service provider, iconic ๐
Parameters:
- service_provider โ the value can be the ID of a service provider or a
ServiceProviderinstance.
Returns: the details of an service provider.
Raises NotFoundException (link: <#openstack.exceptions.NotFoundException>) when no resource can be found. ๐ญ
service_providers(**query)โ retrieve a generator of service providers, generators are giving main character energy โญ
Parameters:
- query โ optional query parameters to be sent to limit the resources being returned.
Returns: a generator of service provider instances. ServiceProvider
update_service_provider(service_provider, **attrs)โ update a service provider, glow up again ๐
Parameters:
- service_provider โ either the ID of an service provider or a
ServiceProviderinstance. - attrs โ the attributes to update on the service provider represented by service_provider.
Returns: the updated service provider.
๐ธ Image API v1 ๐ธ
For details on how to use image, see Using OpenStack Image <> (the link is literally empty in the source, we're not gonna pretend otherwise ๐).
๐ฆ The Image v1 Class ๐ฆ
The image high-level interface is available through the image member of a Connection object (link: <#openstack.connection.Connection>). The image member will only be added if the service is detected. iykyk โจ
class openstack.image.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
upload_image(**attrs)โ upload a new image from attributes, let's gooo ๐ฅ
Parameters:
- attrs โ keyword arguments which will be used to create a
Image(link:<#openstack.image.v1.image.Image>), comprised of the properties on theImageclass.
Returns: the results of image creation.
delete_image(image, ignore_missing=True)โ delete an image, bye bestie ๐๏ธ
Parameters:
imageโ this one's either the ID of an image, or a whole entireImageinstance. Both slay, pick whichever feels right ๐ซถignore_missingโ okay so set this toFalseand aNotFoundExceptiongets raised at you the second the image doesn't exist. Set it toTrueand no exception will be set when you attempt to delete a nonexistent image. Choosing peace, honestly ๐ธ
Returns: None โ that's the whole personality. Nothing. Void. ๐ญ
find_image(name_or_id, ignore_missing=True) โ finds a single image. One. Singular. Main character only ๐
Parameters
name_or_idโ the name or ID of a image ๐ignore_missingโ when it'sFalse, aNotFoundExceptiongets raised when the resource doesn't exist. When it'sTrue,Nonegets returned when you attempt to find a nonexistent resource. No drama, no chaos โจ
Returns: one Image or None ๐ซ
get_image(image) โ gets a single image, lowkey the most straightforward one here.
Parameters
imageโ the ID of an image, or anImageinstance.
Returns: one Image ๐
Raises: NotFoundException when no resource can be found. She's not gonna sugarcoat it for you ๐ญ
images(**query) โ returns a generator of images. Not a list, bestie, a generator. We love a lazy iterator ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. Use them or don't, the vibes are yours ๐ฆ
Returns: a generator of image objects โญ
update_image(image, **attrs) โ updates a image.
Parameters
imageโ either the ID of a image, or anImageinstance.attrsโ the attributes to update on the image represented byimage.
Returns: the updated image ๐
Image API v2
For details on how to use image, see Using OpenStack Image ๐
The Image v2 Class
The image high-level interface is available through the image member of a Connection object. The image member will only be added if the service is detected โ so if it's just not there, that's literally why, no cap ๐
Image Operations
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Look at all those keyword args. Gorgeous. Every single one of them is a None by default and that's exactly how she likes it ๐
create_image(name, *, filename=None, data=None, container=None,
md5=None, sha256=None, disk_format=None, container_format=None,
tags=None, disable_vendor_agent=True, allow_duplicates=False,
meta=None, wait=False, timeout=3600, validate_checksum=False,
use_import=False, import_method=None, uri=None,
remote_region=None, remote_image_id=None,
remote_service_interface=None, stores=None, all_stores=None,
all_stores_must_succeed=None, size=None, **kwargs)
Create an image and optionally upload data โจ
Creates a new image. If filename or data are provided, it will also upload data to this image.
Okay so, real talk: uploading image data is actually quite a complicated procedure. Like, genuinely. There are three ways to upload an image:
- Image upload
- Image import
- Image tasks
If the image tasks API is enabled, this must be used. However โ this API is deprecated since the Image service's Mitaka (12.0.0) release and is now admin-only. ๐ Assuming this API is not enabled, you may choose between image upload or image import. Image import is more powerful and allows you to upload data from multiple sources including other glance instances. It should be preferred on all services that support it. Periodt.
Parameters
nameโ name of the image to create. If it's a pathname of an image, the name will be constructed from the extensionless basename of the path. Cute, right? ๐ธfilenameโ the path to the file to upload, if needed. (optional, defaults toNone)dataโ image data (string or file-like object). It is mutually exclusive withfilenameโ pick one, not both, we've talked about this ๐containerโ name of the container in swift where images should be uploaded for import if the cloud requires such a thing. (optional, defaults to'images')md5โ md5 sum of the image file. If not given, an md5 will be calculated.sha256โ sha256 sum of the image file. If not given, an md5 will be calculated. (yes bestie, it saysmd5there too โ that's literally what the doc says, we're just reading it out ๐)disk_formatโ the disk format the image is in. (optional, defaults to the os-client-config config value for this cloud)container_formatโ the container format the image is in. (optional, defaults to the os-client-config config value for this cloud)tagsโ list of tags for this image. Each tag is a string of at most 255 chars. Keep 'em short and iconic ๐disable_vendor_agentโ whether or not to append metadata flags to the image to inform the cloud in question to not expect a vendor agent to be running. (optional, defaults toTrue)allow_duplicatesโ if true, skips checks that enforce unique image name. (optional, defaults toFalse)metaโ a dict of key/value pairs to use for metadata that bypasses automatic type conversion. Raw. Untouched. Feral, even ๐ฆwaitโ if true, waits for image to be created. Defaults to true โ however, be aware that one of the upload methods is always synchronous. So like, don't get too comfortable ๐timeoutโ seconds to wait for image creation.Noneis forever. Literally forever. Think about that ๐ฐ๏ธvalidate_checksumโ if true and cloud returns checksum, compares return value with the one calculated or passed into this call. If value does not match โ raises exception. Default is'false'โ ๏ธuse_importโ use the'glance-direct'method of the interoperable image import mechanism to import the image. This defaults to false because it is harder on the target cloud so should only be used when needed, such as when the user needs the cloud to transform image format. If the cloud has disabled direct uploads, this will default to true. If you wish to use other import methods, use theimport_imagemethod instead ๐import_methodโ method to use for importing the image. Not all deployments support all methods. One of:glance-direct(default),web-download,glance-download(copy-imageis not used with create). Use ofglance-directrequires the image be first staged ๐ฅuriโ required only if using theweb-downloadimport method. This url is where the data is made available to the Image service.remote_regionโ the remote glance region to download the image from when usingglance-download.remote_image_idโ the ID of the image to import from the remote glance when usingglance-download.remote_service_interfaceโ the remote glance service interface to use when usingglance-download.storesโ list of stores to be used whenenabled_backendsis activated in glance. List values can be the id of a store or aStoreinstance. Impliesuse_importequalsTrue๐all_storesโ upload to all available stores. Mutually exclusive withstoreandstores. Impliesuse_importequalsTrue.
all_stores_must_succeedโ okay so when this isTrue, if an error pops off during the upload in at least one store, the worfklow fails, the data is deleted from stores where copying is done (not staging), and the state of the image stays unchanged. When itโsFalse, the workflow will fail (data deleted from stores, โฆ) only if the import fails on all stores specified by the user. In a partial success, the locations added to the image are the stores where the data was actually uploaded correctly. Default isTrue. Impliesuse_importequalsTrue. ๐sizeโ size of the image data in bytes. Providing this lets Glance pre-allocate storage and can improve upload performance โจ. If you donโt provide it anddatais a file-like object, the size will be calculated automatically.
Additional kwargs get passed to image creation as extra metadata for the image, and all values get converted to string except for min_disk, min_ram, size and virtual_size, which get converted to int.
If you are sure you have all of your data types correct or have an advanced need to be explicit, use meta. If you are just a normal consumer, using kwargs is likely the right choice. If a value is in meta and kwargs, meta wins. Periodt.
Returns: The results of image creation ๐
Raises: SDKException if there are problems uploading ๐ญ
๐ฆ import_image
import_image(image, method='glance-direct', *, uri=None, remote_region=None, remote_image_id=None, remote_service_interface=None, store=None, stores=None, all_stores=None, all_stores_must_succeed=None)
Import data to an existing image.
The interoperable image import process was introduced in Image API v2.6. It mainly lets image importing happen from an external URL and lets the Image service download it by itself without sending binary data at image creation. Iconic behavior, honestly ๐
Parameters
imageโ the value can be the ID of a image or anImageinstance.methodโ method to use for importing the image. Not all deployments support all methods. One of:glance-direct(default),web-download,glance-download, orcopy-image. Use ofglance-directrequires the image be first staged.uriโ required only if using theweb-downloadimport method. This url is where the data is made available to the Image service.remote_regionโ the remote glance region to download the image from when usingglance-download.remote_image_idโ the ID of the image to import from the remote glance when usingglance-download.remote_service_interfaceโ the remote glance service interface to use when usingglance-download.storeโ used whenenabled_backendsis activated in glance. The value can be the id of a store or aStoreinstance.storesโ list of stores to be used whenenabled_backendsis activated in glance. List values can be the id of a store or aStoreinstance.all_storesโ upload to all available stores. Mutually exclusive withstoreandstores.all_stores_must_succeedโ when set toTrue, if an error occurs during the upload in at least one store, the worfklow fails, the data is deleted from stores where copying is done (not staging), and the state of the image is unchanged. When set toFalse, the workflow will fail (data deleted from stores, โฆ) only if the import fails on all stores specified by the user. In case of a partial success, the locations added to the image will be the stores where the data has been correctly uploaded. Default isTrue.
Returns: The raw response from the request.
๐ธ stage_image
stage_image(image, *, filename=None, data=None, size=None)
Stage binary image data.
Parameters
imageโ the value can be the ID of a image or anImageinstance.filenameโ optional name of the file to read data from.dataโ optional data to be uploaded as an image.sizeโ optional size of the data in bytes. Providing this lets Glance pre-allocate storage and can improve staging performance. If you donโt provide it anddatais a file-like object, the size will be calculated automatically.
Returns: The results of image creation.
๐ upload_image
upload_image(container_format=None, disk_format=None, data=None, size=None, **attrs)
Create and upload a new image from attributes.
Parameters
container_formatโ format of the container. A valid value isami,ari,aki,bare,ovf,ova, ordocker.disk_formatโ the format of the disk. A valid value isami,ari,aki,vhd,vmdk,raw,qcow2,vdi, oriso.dataโ the data to be uploaded as an image.attrsโ keyword arguments which will be used to create aImage, comprised of the properties on theImageclass.
Returns: The results of image creation.
๐ download_image
download_image(image, *, stream=False, output=None, chunk_size=1048576, store_preferences=None)
Download an image.
This will download an image to memory when stream=False, or allow streaming downloads using an iterator when stream=True. For examples of working with streamed responses, see the section called Downloading an Image with stream=True (docs anchor: #download-image-stream-true) ๐ซถ
Parameters
imageโ the value can be either the ID of an image or aImageinstance.streamโ- When
True, return arequests.Responseinstance allowing you to iterate over the response data stream instead of storing its entire contents in memory. Seerequests.Response.iter_content()for more details. - NOTE: If you do not consume the entirety of the response you must explicitly call
requests.Response.close()or otherwise risk inefficiencies with the requests libraryโs handling of connections. - When
False, return the entire contents of the response.
- When
outputโ either a file object or a path to store data into.chunk_sizeโ size in bytes to read from the wire and buffer at one time. Defaults to1024 * 1024 = 1 MiB.store_preferencesโ list of store names to prefer when downloading.
Returns: When output is not given โ the bytes comprising the given Image when stream is False, otherwise a requests.Response instance. When output is given โ a Image instance.
๐ง delete_image
delete_image(image, *, store=None, ignore_missing=True)
Delete an image.
Parameters
imageโ the value can be either the ID of an image or aImageinstance.storeโ the value can be either the ID of a store or aStoreinstance that the image is associated with. If specified, the image will only be deleted from the specified store.ignore_missingโ when set toFalse,NotFoundExceptionwill be raised when the image does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent image.
Returns: None
๐ find_image
find_image(name_or_id, ignore_missing=True)
Find a single image.
Parameters
name_or_idโ the name or ID of a image.ignore_missingโ when set toFalse,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns: one Image or None โ literally just the image, or the void, no in-between bestie ๐
โจ get_image(image) โจ
Get a single image. One (1) image. That's the whole gig.
Parameters
- image โ the value can be the ID of an image or an
Imageinstance. (yes, ID string or the whole object, both slay)
Returns: one Image
Raises NotFoundException when no resource can be found. Like, it's not hiding, it's just not there ๐ญ
๐ธ images(**query) ๐ธ
Return a generator of images โ a whole lil stream of them, one at a time, no cap.
Parameters
- query โ optional query parameters sent along to limit the resources being returned. Use these or you're getting the entire camera roll, bestie ๐ซถ
Returns: a generator of image objects
๐ update_image(image, **attrs) ๐
Update an image. Glow-up time โจ
Parameters
- image โ either the ID of an image or an
Imageinstance. - attrs โ the attributes to update on the image represented by image.
Returns: the updated image
๐ฆ deactivate_image(image) ๐ฆ
Deactivate an image. It's taking a nap, do not disturb ๐ค
Parameters
- image โ either the ID of an image or an
Imageinstance.
Returns: None
๐ reactivate_image(image) ๐
Reactivate an image. Nap's over, main character energy restored ๐
Parameters
- image โ either the ID of an image or an
Imageinstance.
Returns: None
๐ add_tag(image, tag) ๐
Add a tag to an image. Little label, big personality.
Parameters
- image โ the value can be the ID of an image or an
Imageinstance. - tag โ the tag to be added.
Returns: None
๐ remove_tag(image, tag) ๐
Remove a tag from an image. Un-label it, respectfully.
Parameters
- image โ the value can be the ID of an image or an
Imageinstance. - tag โ the tag to be removed.
Returns: None
๐ Image Task Operations ๐
Okay so this whole block hangs off the same proxy class, and yes you have to look at the full signature, it's giving "terms and conditions" but make it Python ๐ญ
class openstack.image.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ image_tasks(image) ๐
Return a generator of Image Tasks โ a nice lil lazy stream of them ๐ซ
Parameters
- image โ the value can be either the name of an image or an
Imageinstance. (name or object, yes both, we love flexibility)
Returns: a generator object of image tasks
Raises NotFoundException when no resource can be found. It looked. It found nothing. It's fine. We're fine. ๐ญ
๐ง Image Location Operations ๐ง
Same proxy class, same absolutely massive signature โ here it is again, because the page loves you and wants you fully informed ๐
class openstack.image.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ฅ add_image_location(image, url, *, validation_data=None) ๐ฅ
Add a location to an image. It's getting a new address, congrats ๐
Parameters
- image โ either the ID of an image or an
Imageinstance. - url โ a valid location url. Valid. We're being picky and honestly? Respect.
- validation_data โ values to be used to populate the corresponding image properties. Keyword-only, note the
*bestie ๐ซถ
Returns: the created image location
โญ image_locations(image) โญ
Get locations associated to an Image โ plural, a whole little collection of addresses.
Parameters
- image โ either the ID of an image or an
Imageinstance.
Returns: a generator of image location objects
๐ Member Operations ๐
Third time's the charm, here's the proxy signature again (it does not get shorter, sorry babe):
class openstack.image.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ซถ add_member(image, **attrs) ๐ซถ
Create a new member from attributes. It's a whole person for your image, iconic ๐
Parameters
- image โ the value can be the ID of an image or an
Imageinstance that the member will be created for. - attrs โ keyword arguments which will be used to create a
Member, comprised of the properties on theMemberclass.
See Image Sharing Reference for details: https://docs.openstack.org/api-ref/image/v2/index.html?expanded=create-image-member-detail#create-image-member
Returns: the results of member creation
๐ remove_member(member, image=None, ignore_missing=True) ๐
Delete a member. Bye bestie, no hard feelings ๐ธ
Parameters
- member โ the value can be either the ID of a member or a
Memberinstance. - image โ the value can be either the ID of an image or an
Imageinstance that the member is part of. This is required if member is an ID. Like, an ID alone doesn't tell us where to look, yk? ๐ - ignore_missing โ when set to
False,NotFoundExceptionwill be raised when the member does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent member. (Default isTrue, so by default we simply do not care ๐ )
Returns: None
๐ find_member(name_or_id, image, ignore_missing=True) ๐
Find a single member. Just the one. Scavenger hunt, but polite.
Parameters
- name_or_id โ the name or ID of a member.
- image โ this is the image that the member belongs to, the value can be the ID of an image or an
Imageinstance. - ignore_missing โ when set to
False,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. (Different flavour of "missing" handling thanremove_member, don't mix them up!)
Returns: one Member or None
๐ฆ get_member(member, image) ๐ฆ
Get a single member on an image. Specific member, specific image, very intentional.
Parameters
- member โ the value can be the ID of a member or a
Memberinstance. - image โ this is the image that the member belongs to. The value can be the ID of an image or an
Imageinstance.
Returns: one Member
Raises NotFoundException when no resource can be found. Again. It's a whole theme ๐ฅ
๐ members(image, **query) ๐
Return a generator of members โ all the friends of this image, streamed one by one.
Parameters
- image โ this is the image that the member belongs to, the value can be the ID of an image or an
Imageinstance. - query โ optional query parameters to be sent to limit the resources being returned.
Returns: a generator of member objects
๐ update_member(member, image, **attrs) ๐
Update the member of an image. Little refresh, little glow-up โจ
Parameters
- member โ either the ID of a member or a
Memberinstance.
Continuing the update_member deets, bestie:
imageโ the image that this member belongs to. The value can be the ID of an image, or anopenstack.image.v2.image.Imageinstance. ๐ผ๏ธattrsโ the attributes you want to update on the member represented bymember.
See the Image Sharing Reference at https://docs.openstack.org/api-ref/image/v2/index.html?expanded=update-image-member-detail#update-image-member for the full tea. โ
Returns: the updated member โจ
๐ ๏ธ Task Operations ๐ ๏ธ
Same Proxy energy, same constructor signature โ no cap:
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
tasks(**query)
Return a generator of tasks. ๐
Parameters: query โ optional query parameters sent along to limit the resources being returned.
Returns: a generator of task objects.
get_task(task)
Get task details. ๐
Parameters: task โ the value can be the ID of a task or an openstack.image.v2.task.Task instance.
Returns: one Task (openstack.image.v2.task.Task).
Raises: openstack.exceptions.NotFoundException when no resource can be found. ๐ญ
create_task(**attrs)
Create a new task from attributes. ๐
Parameters: attrs โ keyword arguments used to create a Task (openstack.image.v2.task.Task), made up of the properties on the Task class.
Returns: the results of task creation.
wait_for_task(task, status='success', failures=None, interval=2, wait=120)
Wait for a task to be in a particular status. โณ
Parameters:
taskโ the resource to wait on until it reaches the specified status. The resource must have astatusattribute.statusโ desired status.failures(list) โ statuses that would be interpreted as failures.intervalโ number of seconds to wait between consecutive checks. Defaults to2.waitโ maximum number of seconds to wait before the change. Defaults to120.
Returns: the resource is returned on success. ๐ซถ
Raises: openstack.exceptions.ResourceTimeout if the transition to the desired status failed to occur in the specified seconds.
Raises: openstack.exceptions.ResourceFailure if the resource has transited to one of the failure statuses.
Raises: AttributeError if the resource does not have a status attribute. ๐
๐ Schema Operations ๐
Again, same Proxy constructor signature โ iconic, unchanged:
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_images_schema()
Get images schema. ๐ผ๏ธ
Returns: one Schema.
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_image_schema()
Get single image schema.
Returns: one Schema.
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_members_schema()
Get image members schema. ๐ฏ
Returns: one Schema.
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_member_schema()
Get image member schema.
Returns: one Schema.
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_tasks_schema()
Get image tasks schema. ๐๏ธ
Returns: one Schema.
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_task_schema()
Get image task schema.
Returns: one Schema.
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_namespace_schema()
Get metadata definition namespace schema. ๐ง
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_namespaces_schema()
Get metadata definition namespaces schema.
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_resource_type_schema()
Get metadata definition resource type association schema. ๐
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_resource_types_schema()
Get metadata definition resource type associations schema.
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_object_schema()
Get metadata definition object schema. ๐ฆ
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_objects_schema()
Get metadata definition objects schema.
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_property_schema()
Get metadata definition property schema. ๐ท๏ธ
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_properties_schema()
Get metadata definition properties schema.
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_tag_schema()
Get metadata definition tag schema. ๐
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
get_metadef_tags_schema()
Get metadata definition tags schema.
Returns: one MetadefSchema (openstack.image.v2.metadef_schema.MetadefSchema).
Raises: openstack.exceptions.NotFoundException when no resource can be found.
๐ Service Info Discovery Operations ๐
And one more time, the Proxy constructor signature stays serving looks:
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
stores(details=False, **query)
Return a generator of supported image stores. ๐๏ธ
Returns โ a generator of store objects ๐๏ธโจ
get_import_info()
Okay so this one is giving โtell me the image constraintsโ energy. It gets a info about image constraints (yes, โa infoโ โ we keep the sourceโs grammar exactly, bestie ๐ ).
Returns โ One Import <#openstack.image.v2.service_info.Import> ๐
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
๐ง Metadef Namespace Operations
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_metadef_namespace(**attrs)
Create a new metadef namespace from attributes. New namespace, who dis? โจ
Parameters
attrsโ Keyword arguments which will be used to create aMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>comprised of the properties on theMetadefNamespaceclass.
Returns โ The results of metadef namespace creation.
delete_metadef_namespace(metadef_namespace, ignore_missing=True)
Delete a metadef namespace. Poof, gone โ but only if you actually mean it ๐ซถ
Parameters
metadef_namespaceโ The value can be either the name of a metadef namespace or aMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the metadef namespace does not exist.
Returns โ None
get_metadef_namespace(metadef_namespace)
Get a single metadef namespace. Main-character retrieval behavior, honestly ๐
Parameters
metadef_namespaceโ Either the name of a metadef namespace or anMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.
Returns โ One MetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
metadef_namespaces(**query)
Return a generator of metadef namespaces. Itโs giving infinite scroll, but for namespaces ๐
Returns โ A generator object of metadef namespaces.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_metadef_namespace(metadef_namespace, **attrs)
Update a server. Yes, the original description literally says โserverโ here โ we are simply reporting the lore, bestie ๐ญ๐
Parameters
metadef_namespaceโ Either the name of a metadef namespace or anMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.attrsโ The attributes to update on the metadef namespace represented bymetadef_namespace.
Returns โ The updated metadef namespace.
๐ฆ Metadef Object Operations
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_metadef_object(namespace, **attrs)
Create a new object from namespace. New object, who dis? ๐ซ
Parameters
namespaceโ The value can be either the name of a metadef namespace or aMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.attrsโ Keyword arguments which will be used to create aMetadefObject <#openstack.image.v2.metadef_object.MetadefObject>, comprised of the properties on the Metadef object class.
Returns โ A metadef namespace.
get_metadef_object(metadef_object, namespace)
Get a single metadef object. One object, zero chaos (ideally) ๐
Parameters
metadef_objectโ The value can be the ID of ametadef_objector aMetadefObject <#openstack.image.v2.metadef_object.MetadefObject>instance.namespaceโ The value can be either the name of a metadef namespace or aMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.
Returns โ One MetadefObject <#openstack.image.v2.metadef_object.MetadefObject>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
metadef_objects(namespace)
Get metadef object list of the namespace. The source says it returns One MetadefObject โ singular, iconic, no cap ๐
Parameters
namespaceโ The value can be either the name of a metadef namespace or aMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.
Returns โ One MetadefObject <#openstack.image.v2.metadef_object.MetadefObject>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_metadef_object(metadef_object, namespace, **attrs)
Update a single metadef object. Glow-up arc, but for metadata โจ
Parameters
metadef_objectโ The value can be the ID of ametadef_objector aMetadefObject <#openstack.image.v2.metadef_object.MetadefObject>instance.namespaceโ The value can be either the name of a metadef namespace or aMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.attrsโ Keyword arguments which will be used to update aMetadefObject <#openstack.image.v2.metadef_object.MetadefObject>
Returns โ One MetadefObject <#openstack.image.v2.metadef_object.MetadefObject>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
delete_metadef_object(metadef_object, namespace, **attrs)
Removes a single metadef object. Bye bestie, we hardly knew ye ๐ซก
Parameters
metadef_objectโ The value can be the ID of ametadef_objector aMetadefObject <#openstack.image.v2.metadef_object.MetadefObject>instance.namespaceโ The value can be either the name of a metadef namespace or aMetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace>instance.attrsโ Keyword arguments which will be used to update aMetadefObject <#openstack.image.v2.metadef_object.MetadefObject>
Returns โ The deleted metadef object.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
๐ Metadef Resource Type Operations
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
metadef_resource_types(**query)
Return a generator of metadef resource types. Resource-type generator realness ๐ธ
Returns โ A generator object of metadef resource types MetadefResourceType <#openstack.image.v2.metadef_resource_type.MetadefResourceType>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
create_metadef_resource_type_association(metadef_namespace, **attrs)
Creates a resource type association between a namespace and the resource type specified in the body of the request. Thatโs the whole description, bestie โ no extra Returns or Raises listed here ๐
Parameters
attrsโ the keyword args that get used to create aMetadefResourceTypeAssociation<#openstack.image.v2.metadef_resource_type.MetadefResourceTypeAssociation>, built from the properties on theMetadefResourceTypeAssociationclass.
Returns
The results of metadef resource type association creation โจ
๐
delete_metadef_resource_type_association(metadef_resource_type, metadef_namespace, ignore_missing=True)
Removes a resource type association from a namespace. Bye bestie ๐
Parameters
metadef_resource_typeโ can be either the name of a metadef resource type association or aMetadefResourceTypeAssociation<#openstack.image.v2.metadef_resource_type.MetadefResourceTypeAssociation> instance.metadef_namespaceโ can be either the name of the metadef namespace or aMetadefNamespace<#openstack.image.v2.metadef_namespace.MetadefNamespace> instance.ignore_missingโ when set toFalse, aNotFoundException<#openstack.exceptions.NotFoundException> gets raised if the metadef resource type association doesn't exist.
Returns
None
๐ฆ metadef_resource_type_associations(metadef_namespace, **query)
Hands you back a generator of metadef resource type associations.
Parameters
metadef_namespace โ can be either the name of the metadef namespace or a MetadefNamespace <#openstack.image.v2.metadef_namespace.MetadefNamespace> instance.
Returns
A generator object of metadef resource type associations, MetadefResourceTypeAssociation <#openstack.image.v2.metadef_resource_type.MetadefResourceTypeAssociation>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when nothing can be found. ๐ญ
๐ง Metadef Property Operations ๐ง
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ธ create_metadef_property(metadef_namespace, **attrs)
Makes a metadef property. New property just dropped ๐
Parameters
metadef_namespaceโ can be either the name of the metadef namespace or aMetadefNamespaceinstance.attrsโ the attributes to create on the metadef property represented bymetadef_property.
Returns
The created metadef property โจ
๐ update_metadef_property(metadef_property, metadef_namespace, **attrs)
Updates a metadef property โ glow-up time.
Parameters
metadef_propertyโ can be either the name of the metadef property or aMetadefProperty<#openstack.image.v2.metadef_property.MetadefProperty> instance.metadef_namespaceโ can be either the name of the metadef namespace or aMetadefNamespace<#openstack.image.v2.metadef_namespace.MetadefNamespace> instance.attrsโ the attributes to update on the metadef property represented bymetadef_property.
Returns
The updated metadef property โจ
๐ซถ delete_metadef_property(metadef_property, metadef_namespace, ignore_missing=True)
Deletes a metadef property. It's giving closure ๐๏ธ
Parameters
metadef_propertyโ can be either the name of the metadef property or aMetadefProperty<#openstack.image.v2.metadef_property.MetadefProperty> instance.metadef_namespaceโ can be either the name of the metadef namespace or aMetadefNamespace<#openstack.image.v2.metadef_namespace.MetadefNamespace> instance.ignore_missingโ when set toFalse, aNotFoundException<#openstack.exceptions.NotFoundException> gets raised if the instance doesn't exist. When set toTrue, no exception gets set when you try to delete a nonexistent instance.
Returns
None
๐ get_metadef_property(metadef_property, metadef_namespace, **query)
Gets you a single metadef property.
Parameters
metadef_propertyโ can be either the name of the metadef property or aMetadefProperty<#openstack.image.v2.metadef_property.MetadefProperty> instance.metadef_namespaceโ can be either the name of the metadef namespace or aMetadefNamespace<#openstack.image.v2.metadef_namespace.MetadefNamespace> instance.
Returns
One MetadefProperty <#openstack.image.v2.metadef_property.MetadefProperty>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when nothing can be found. ๐ญ
โญ Helpers โญ
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ wait_for_delete(res, interval=2, wait=120, callback=None)
Waits for a resource to be deleted. Bestie is very patient, but not infinitely patient, iykyk ๐
Parameters
resโ the resource you're waiting on to be deleted.intervalโ number of seconds to wait before consecutive checks.waitโ maximum number of seconds to wait before the change.callbackโ a callback function. This gets called with a single value,progress, which is a percentage value from 0-100.
Returns
The resource gets returned on success.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if the transition to delete failed to occur in the specified seconds. ๐
๐ Cache Operations ๐
class openstack.image.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ฆ cache_delete_image(image, ignore_missing=True)
Deletes an image from cache. Not me evicting my exes from the group chat ๐
Parameters
imageโ can be either the ID of an image or anImage<#openstack.image.v2.image.Image> instance.ignore_missingโ when set toFalse, aNotFoundException<#openstack.exceptions.NotFoundException> gets raised if the image or the cache entry doesn't exist.
Returns
None
โจ queue_image(image)
Queues image(s) for caching. Get in line, bestie ๐๏ธ
๐ง clear_cache(target='both')
Clears all images from cache, queue, or both. Spring cleaning fr fr ๐งน
Parameters
target โ specify which target you wanna clear. One of: both (default), cache, queue.
๐ KeyManager API ๐
For deets on how to use key_management, see Using OpenStack Key Manager <> ๐ธ
๐ฅ The KeyManager Class ๐ฅ
The key_management high-level interface is available through the key_manager member of a Connection <#openstack.connection.Connection> object. The key_manager member only gets added if the service is detected. ๐
โจ Secret Operations โจ
Bestie, this is the secret-handling corner of the proxy. The class signature is literally this big thing:
class openstack.key_manager.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_secret(**attrs) โ Create a new secret from attributes ๐
attrsโ Keyword arguments which will be used to create aSecret <#openstack.key_manager.v1.secret.Secret>, comprised of the properties on theOrderclass.
Returns: The results of secret creation โจ
delete_secret(secret, ignore_missing=True) โ Delete a secret ๐ซถ
Parameters
secretโ The value can be either the ID of a secret or aSecret <#openstack.key_manager.v1.secret.Secret>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the secret does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent secret.
Returns: None
find_secret(name_or_id, ignore_missing=True) โ Find a single secret ๐
Parameters
name_or_idโ The name or ID of a secret.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns: One Secret <#openstack.key_manager.v1.secret.Secret> or None
get_secret(secret) โ Get a single secret ๐
Parameters
secretโ The value can be the ID of a secret or aSecret <#openstack.key_manager.v1.secret.Secret>instance.
Returns: One Secret <#openstack.key_manager.v1.secret.Secret>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
secrets(**query) โ Return a generator of secrets ๐
Parameters
queryโ Optional query parameters to be sent to limit the resources being returned.
Returns: A generator of secret objects
update_secret(secret, **attrs) โ Update a secret โญ
Parameters
secretโ Either the id of a secret or aSecret <#openstack.key_manager.v1.secret.Secret>instance.attrsโ The attributes to update on the secret represented by secret.
Returns: The updated secret
๐ธ Container Operations ๐ธ
Same big class signature, now for container business:
class openstack.key_manager.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_container(**attrs) โ Create a new container from attributes ๐
Parameters
attrsโ Keyword arguments which will be used to create aContainer <#openstack.key_manager.v1.container.Container>, comprised of the properties on theContainerclass.
Returns: The results of container creation
delete_container(container, ignore_missing=True) โ Delete a container ๐
Parameters
containerโ The value can be either the ID of a container or aContainer <#openstack.key_manager.v1.container.Container>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the container does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent container.
Returns: None
find_container(name_or_id, ignore_missing=True) โ Find a single container ๐ฆ
Parameters
name_or_idโ The name or ID of a container.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns: One Container <#openstack.key_manager.v1.container.Container> or None
get_container(container) โ Get a single container ๐
Parameters
containerโ The value can be the ID of a container or aContainer <#openstack.key_manager.v1.container.Container>instance.
Returns: One Container <#openstack.key_manager.v1.container.Container>
Raises: NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
containers(**query) โ Return a generator of containers ๐ง
Parameters
queryโ Optional query parameters to be sent to limit the resources being returned.
Returns: A generator of container objects
update_container(container, **attrs) โ Update a container ๐
Parameters
containerโ Either the id of a container or aContainer <#openstack.key_manager.v1.container.Container>instance.attrsโ The attributes to update on the container represented by container.
Returns: The updated container
๐ Container ACL Operations ๐
And here's the class signature one more time, because the ACL glow-up deserves it:
class openstack.key_manager.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_container_acl(container) โ Get a container's ACL settings ๐
Parameters
containerโ The value can be the ID of a container or aContainer <#openstack.key_manager.v1.container.Container>instance.
Returns: One container ACL
create_container_acl(container, **attrs) โ Create or replace a container's ACL ๐
Parameters
containerโ The value can be the ID of a container or aContainer <#openstack.key_manager.v1.container.Container>instance.attrsโ Keyword arguments which will be used to create aContainerACL <#openstack.key_manager.v1.container_acl.ContainerACL>, comprised of the properties on theContainerACLclass. The ACL body must be supplied explicitly, typically as areaddict, e.g.read={'users': ['user-id'], 'project-access': False}.
Returns: The results of ACL creation
update_container_acl(container, **attrs) โ Update a container's ACL ๐ซ
Parameters
containerโ The value can be the ID of a container or aContainer <#openstack.key_manager.v1.container.Container>instance.attrsโ The attributes to update on the ACL. The ACL body must be supplied explicitly, typically as areaddict, e.g.read={'users': ['user-id'], 'project-access': True}.
Returns: The updated ACL
delete_container_acl(container, ignore_missing=True) โ Reset a container's ACL to default settings ๐งน
Parameters
containerโ the container you're nuking. Slug in the ID of a container, or hand over an actualContainerinstance (<#openstack.key_manager.v1.container.Container>) and let the SDK do the heavy lifting ๐ignore_missingโ set it toFalseand you get aNotFoundException(<#openstack.exceptions.NotFoundException>) thrown at you the second the container doesn't exist. Set it toTrueand the SDK is just gonna vibe โ no exception, no drama, even if you're deleting a container that was never a thing ๐ซถ
Returns โ None. That's it, that's the whole return value, bestie.
Order Operations
class openstack.key_manager.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_order(**attrs)
Cooks up a brand-new order straight from its attributes โจ
Parameters
- attrs โ keyword args that get used to build an
Order(<#openstack.key_manager.v1.order.Order>). Basically every property on theOrderclass, so go off ๐
Returns โ the results of order creation. The fresh new order, looking all cute.
delete_order(order, ignore_missing=True)
Yeets an order into the void ๐๏ธ
Parameters
- order โ either the ID of an order, or an
Order(<#openstack.key_manager.v1.order.Order>) instance. - ignore_missing โ
Falsemeans aNotFoundException(<#openstack.exceptions.NotFoundException>) gets raised when the order doesn't exist.Truemeans no exception gets set even when you attempt to delete a nonexistent order. No notes, just vibes ๐
Returns โ None.
find_order(name_or_id, ignore_missing=True)
Finds you a single order, like a lil scavenger hunt ๐ฆ
Parameters
- name_or_id โ the name or ID of a order.
- ignore_missing โ
FalseโNotFoundException(<#openstack.exceptions.NotFoundException>) raised when the resource doesn't exist.Trueโ you getNoneback when attempting to find a nonexistent resource. Gentle. Kind. Iconic.
Returns โ one Order (<#openstack.key_manager.v1.order.Order>) or None.
get_order(order)
Grabs a single order, no searching around ๐
Parameters
- order โ the ID of an order, or an
Order(<#openstack.key_manager.v1.order.Order>) instance.
Returns โ one Order (<#openstack.key_manager.v1.order.Order>).
Raises โ NotFoundException (<#openstack.exceptions.NotFoundException>) when no resource can be found. ๐ญ
orders(**query)
Hands you back a generator of orders, all lined up ๐
Parameters
- query โ optional query params you can send along to limit the resources being returned. Filter away, bestie.
Returns โ a generator of order objects.
update_order(order, **attrs)
Glow-up time โ updates a order ๐
Parameters
- order โ either the id of a order or an
Order(<#openstack.key_manager.v1.order.Order>) instance. - attrs โ the attributes to update on the order represented by order.
Returns โ the updated order. Look at her now ๐ฅ
Quota Operations
class openstack.key_manager.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_project_quota(project)
Get a single project quota โ one project, one quota, very monogamous of you ๐
Parameters
- project โ a project ID or a
Project(<#openstack.identity.v3.project.Project>) instance.
Returns โ one ProjectQuota (<#openstack.key_manager.v1.project_quota.ProjectQuota>).
Raises โ NotFoundException (<#openstack.exceptions.NotFoundException>) when no resource can be found ๐
get_quota()
Gets the effective quotas for the current project โ the real real, not the theoretical โจ
Returns โ one Quota (<#openstack.key_manager.v1.quota.Quota>).
Raises โ NotFoundException (<#openstack.exceptions.NotFoundException>) when no resource can be found.
Secret Store Operations
class openstack.key_manager.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
secret_stores(**query)
Returns a generator of secret stores โ yes bestie, a whole generator, lazy and efficient, we love to see it ๐ง
Parameters
- query โ optional query parameters to be sent along to limit the resources being returned.
Returns โ a generator of secret store objects.
get_global_default_secret_store()
Gets the global default secret store, the main character of secret stores ๐
Returns โ one SecretStore (<#openstack.key_manager.v1.secret_store.SecretStore>).
Raises โ NotFoundException (<#openstack.exceptions.NotFoundException>) when no resource can be found. ๐ญ
get_preferred_secret_store()
Gets the preferred secret store for the current project โ this project's personal fave ๐ธ
Returns โ one SecretStore (<#openstack.key_manager.v1.secret_store.SecretStore>).
Raises โ NotFoundException (<#openstack.exceptions.NotFoundException>) when no resource can be found.
ProjectQuota Operations
class openstack.key_manager.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
delete_project_quota(project, ignore_missing=True)
Deletes a project quota ๐๏ธโจ
Parameters
- project โ a project ID or a
Project(<#openstack.identity.v3.project.Project>) instance. - ignore_missing โ
Falsemeans aNotFoundException(<#openstack.exceptions.NotFoundException>) gets raised when the project quota doesn't exist.Truemeans no exception gets set when you attempt to delete a nonexistent project quota. Chill mode: activated ๐ซถ
Returns โ None.
get_project_quota(project)
Get a single project quota, one (1) quota, freshly fetched ๐
Parameters
- project โ a project ID or a
Project(<#openstack.identity.v3.project.Project>) instance.
Returns โ one ProjectQuota (<#openstack.key_manager.v1.project_quota.ProjectQuota>).
Raises โ NotFoundException (<#openstack.exceptions.NotFoundException>) when no resource can be found.
update_project_quota(project, **attrs)
Updates a project quota โ new quota, who dis ๐
Parameters
- project โ a project ID or a
Project(<#openstack.identity.v3.project.Project>) instance. - attrs โ the attributes to update on the project quota represented by project quota.
Returns โ the updated project quota ๐ฅ
โจ Secret ACL Operations โจ
Okay bestie, so first up we have the class openstack.key_manager.v1._proxy.Proxy โ and yes, the signature is a whole mood, so here it is in all its glory:
class openstack.key_manager.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_secret_acl(secret)โ Gets the ACL of a secret. No cap, it's giving "let me see who's allowed".- Parameters:
secretโ Secret ID or aSecretinstance (theopenstack.key_manager.v1.secret.Secretclass).
- Returns:
SecretACL(theopenstack.key_manager.v1.secret_acl.SecretACLclass) whosereadcontains the ACL. If no explicit ACL exists, the default ACL is returned. - Raises:
NotFoundException(theopenstack.exceptions.NotFoundExceptionclass)
- Parameters:
set_secret_acl(secret, **attrs)โ Set (replace) the ACL of a secret (PUT). It's a full glow-up replacement, bestie.- Parameters:
secretโ Secret ID orSecretinstance.attrsโ ACL body, typically areaddict.
- Returns:
SecretACL(theopenstack.key_manager.v1.secret_acl.SecretACLclass) whoseacl_refreferences the ACL URL.
- Parameters:
update_secret_acl(secret, **attrs)โ Partially update the ACL of a secret (PATCH). Lowkey just tweaking, not a full rewrite.- Parameters:
secretโ Secret ID orSecretinstance.attrsโ Partial ACL body, typically areaddict.
- Returns:
SecretACL(theopenstack.key_manager.v1.secret_acl.SecretACLclass) whoseacl_refreferences the ACL URL.
- Parameters:
delete_secret_acl(secret, ignore_missing=True)โ Delete the ACL of a secret. Bye bye, ACL! ๐- Parameters:
secretโ Secret ID orSecretinstance.ignore_missingโ When set toFalse, raise if not found.
- Returns:
None - Raises:
NotFoundException(theopenstack.exceptions.NotFoundExceptionclass)
- Parameters:
โจ Secret Consumer Operations โจ
Same iconic class signature, because consistency is key:
class openstack.key_manager.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_secret_consumer(secret, **attrs)โ Create a consumer for a secret. It's giving "let's link this secret to a service".- Parameters:
secretโ Either the id of a secret or aSecretinstance (theopenstack.key_manager.v1.secret.Secretclass).attrsโ Must includeservice,resource_type,resource_id.
- Returns: The created consumer association.
- Parameters:
delete_secret_consumer(secret, ignore_missing=True, **attrs)โ Delete a consumer association from a secret. Unlinking, bestie.- Parameters:
secretโ Either the id of a secret or aSecretinstance (theopenstack.key_manager.v1.secret.Secretclass).ignore_missingโ When set toFalse,NotFoundException(theopenstack.exceptions.NotFoundExceptionclass) will be raised when the secret does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent secret.attrsโ Must includeservice,resource_type,resource_id.
- Returns:
None
- Parameters:
secret_consumers(secret, **query)โ List consumers for a secret. Get the whole squad of consumers.- Parameters:
secretโ Either the id of a secret or aSecretinstance (theopenstack.key_manager.v1.secret.Secretclass).
- Returns: A generator of
SecretConsumerobjects.
- Parameters:
โจ Load Balancer v2 API โจ
The LoadBalancer Class
Okay so the load_balancer high-level interface? It's literally available through the load_balancer member of a Connection object (that's the openstack.connection.Connection class). But heads up: the load_balancer member will only be added if the service is detected. No service, no member. Periodt.
Load Balancer Operations
And here's the class signature for this one โ yes, it's long, but we keep it exact:
class openstack.load_balancer.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_load_balancer(**attrs)โ Create a new load balancer from attributes. It's a whole new LB, slay.- Parameters:
attrsโ Keyword arguments which will be used to create aLoadBalancer(theopenstack.load_balancer.v2.load_balancer.LoadBalancerclass), comprised of the properties on theLoadBalancerclass.
- Returns: The results of load balancer creation.
- Parameters:
get_load_balancer(load_balancer)โ Get a load balancer. Fetching the LB details.- Parameters:
load_balancerโ The value can be the ID of a load balancer or aLoadBalancerinstance (theopenstack.load_balancer.v2.load_balancer.LoadBalancerclass).
- Returns: One
LoadBalancer(theopenstack.load_balancer.v2.load_balancer.LoadBalancerclass).
- Parameters:
get_load_balancer_statistics(load_balancer)โ Get the load balancer statistics. Stats, bestie!- Parameters:
load_balancerโ The value can be the ID of a load balancer or aLoadBalancerinstance (theopenstack.load_balancer.v2.load_balancer.LoadBalancerclass).
- Returns: One
LoadBalancerStats(theopenstack.load_balancer.v2.load_balancer.LoadBalancerStatsclass).
- Parameters:
load_balancers(**query)โ Retrieve a generator of load balancers. All the LBs, coming right up.- Returns: A generator of load balancer instances.
delete_load_balancer(load_balancer, ignore_missing=True, cascade=False)โ Delete a load balancer. ๐๏ธ- Parameters:
load_balancerโ Theload_balancercan be either the ID or aLoadBalancerinstance (theopenstack.load_balancer.v2.load_balancer.LoadBalancerclass).ignore_missingโ When set toFalse,NotFoundException(theopenstack.exceptions.NotFoundExceptionclass) will be raised when the load balancer does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent load balancer.cascadeโ If true will delete all child objects of the load balancer.
- Returns:
None
- Parameters:
find_load_balancer(name_or_id, ignore_missing=True)โ Find a single load balancer. Like a search but for one LB.- Parameters:
name_or_idโ The name or ID of a load balancer.ignore_missingโ When set toFalse,NotFoundException(theopenstack.exceptions.NotFoundExceptionclass) will be raised when the load balancer does not exist. When set toTrue, no exception will be set when attempting to find a nonexistent load balancer.
- Returns:
None
- Parameters:
update_load_balancer(load_balancer, **attrs)โ Update a load balancer. Glow-up time.- Parameters:
load_balancerโ Theload_balancercan be either the ID or aLoadBalancerinstance (theopenstack.load_balancer.v2.load_balancer.LoadBalancerclass).attrsโ The attributes to update on the load balancer represented byload_balancer.
- Returns: The updated
load_balancer.
- Parameters:
wait_for_load_balancer(name_or_id, status='ACTIVE', failures=['ERROR'], interval=2, wait=300)โ Wait for load balancer status. It's giving "are we there yet?" but for LBs.- Parameters:
name_or_idโ The name or ID of the load balancer.statusโ Desired status.failures(list) โ Statuses that would be interpreted as failures. Default to['ERROR'].intervalโ Number of seconds to wait between consecutive checks. Defaults to2.waitโ Maximum number of seconds to wait before the status to be reached. Defaults to300.
- Returns: The load balancer is returned on success.
- Parameters:
- Raises
ResourceTimeout<#openstack.exceptions.ResourceTimeout> if the transition to the status you want just... didn't happen inside the wait time you gave it. ๐ญ - Raises
ResourceFailure<#openstack.exceptions.ResourceFailure> if the resource has walked itself over to one of the failure statuses. yikes. - Raises
AttributeErrorif the resource doesn't even have a status attribute, bestie. like it's not even in the chat. ๐ failover_load_balancer(load_balancer)โ Failover a load balancer. dramatic but necessary โจ
Parameters
- load_balancer โ the value can be the ID of a load balancer or a
LoadBalancer<#openstack.load_balancer.v2.load_balancer.LoadBalancer> instance.
Returns
None
๐ธ Listener Operations ๐ธ
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
(yeah that's the whole constructor again, unedited, no cap โ copy it exactly if you're writing it down somewhere ๐ )
create_listener(**attrs)โ Create a new listener from attributes. it's giving new-listener energy ๐
Parameters
- attrs โ keyword arguments which will be used to create a
Listener<#openstack.load_balancer.v2.listener.Listener>, comprised of the properties on theListenerclass.
Returns
The results of listener creation
delete_listener(listener, ignore_missing=True)โ Delete a listener. bye girl ๐ฆ
Parameters
- listener โ the value can be either the ID of a listener or a
Listener<#openstack.load_balancer.v2.listener.Listener> instance. - ignore_missing โ when set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the listner does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent listener.
Returns
None
find_listener(name_or_id, ignore_missing=True)โ Find a single listener. detective mode ๐
Parameters
- name_or_id โ the name or ID of a listener.
- ignore_missing โ when set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns
One Listener <#openstack.load_balancer.v2.listener.Listener> or None
get_listener(listener)โ Get a single listener.
Parameters
- listener โ the value can be the ID of a listener or a
Listener<#openstack.load_balancer.v2.listener.Listener> instance.
Returns
One Listener <#openstack.load_balancer.v2.listener.Listener>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
get_listener_statistics(listener)โ Get the listener statistics. numbers girlies rise ๐
Parameters
- listener โ the value can be the ID of a listener or a
Listener<#openstack.load_balancer.v2.listener.Listener> instance.
Returns
One ListenerStats <#openstack.load_balancer.v2.listener.ListenerStats>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
listeners(**query)โ Return a generator of listeners. a whole little lineup โจ
Parameters
- query โ optional query parameters to be sent to limit the resources being returned. Valid parameters are:
Returns
A generator of listener objects
update_listener(listener, **attrs)โ Update a listener. glow-up time ๐
Parameters
- listener โ either the id of a listener or a
Listener<#openstack.load_balancer.v2.listener.Listener> instance. - attrs โ the attributes to update on the listener represented by listener.
Returns
The updated listener
๐ซถ Pool Operations ๐ซถ
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
(same constructor, character for character โ iconic of her honestly)
create_pool(**attrs)โ Create a new pool from attributes. pool party ๐โโ๏ธ
Parameters
- attrs โ keyword arguments which will be used to create a
Pool<#openstack.load_balancer.v2.pool.Pool>, comprised of the properties on thePoolclass.
Returns
The results of Pool creation
get_pool(pool)โ Get a pool.
Parameters
- pool โ value is either a pool ID or a
Pool<#openstack.load_balancer.v2.pool.Pool> instance.
Returns
One Pool <#openstack.load_balancer.v2.pool.Pool>
pools(**query)โ Retrieve a generator of pools.
Returns
A generator of Pool instances
delete_pool(pool, ignore_missing=True)โ Delete a pool.
Parameters
- pool โ the pool is either a pool ID or a
Pool<#openstack.load_balancer.v2.pool.Pool> instance - ignore_missing โ when set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the pool does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent pool.
Returns
The deleted pool.
find_pool(name_or_id, ignore_missing=True)โ Find a single pool.
Parameters
- name_or_id โ the name or ID of a pool
- ignore_missing โ when set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the pool does not exist. When set toTrue, no exception will be set when attempting to find a nonexistent pool.
Returns
None
update_pool(pool, **attrs)โ Update a pool.
Parameters
- pool โ either the id of a pool or a
Pool<#openstack.load_balancer.v2.pool.Pool> instance. - attrs โ the attributes to update on the pool represented by pool.
Returns
The updated pool
๐ Member Operations ๐
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
(yes bestie, the exact same one, do not retype it from memory ๐ญ)
create_member(pool, **attrs)โ Create a new member from attributes. welcome to the group chat ๐
Parameters
- pool โ the pool can be either the ID of a pool or a
Pool<#openstack.load_balancer.v2.pool.Pool> instance that the member will be created in. - attrs โ keyword arguments which will be used to create a
Member<#openstack.load_balancer.v2.member.Member>, comprised of the properties on theMemberclass.
Returns
The results of member creation
delete_member(member, pool, ignore_missing=True)โ Delete a member.
Parameters
- member โ the member can be either the ID of a member or a
Member<#openstack.load_balancer.v2.member.Member> instance.
poolโ okay so this is either the ID of a pool, or a wholePool<#openstack.load_balancer.v2.pool.Pool> instance that the member belongs to ๐ignore_missingโ set it toFalseand aNotFoundException<#openstack.exceptions.NotFoundException> gets raised the moment the member doesn't exist. Set it toTrueand nothing happens โ no exception when you try to delete a member that was never there. Iconic lazy-girl behaviour tbh โจ
Returns โ None ๐
find_member(name_or_id, pool, ignore_missing=True)
Find one single member. Just the one. Main character only ๐
Parameters
name_or_idโ the name or the ID of a member ๐ธpoolโ either the ID of a pool or aPool<#openstack.load_balancer.v2.pool.Pool> instance that the member belongs to ๐ซถignore_missingโ when it'sFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised if the resource doesn't exist. When it'sTrue, you just getNoneback when you go looking for a resource that isn't there. No drama ๐
Returns โ one Member <#openstack.load_balancer.v2.member.Member> or None โญ
get_member(member, pool)
Get a single member. Again, singular. We're not doing plurals here ๐
Parameters
memberโ can be the ID of a member or aMember<#openstack.load_balancer.v2.member.Member> instance ๐poolโ the ID of a pool, or aPool<#openstack.load_balancer.v2.pool.Pool> instance that the member belongs to ๐
Returns โ one Member <#openstack.load_balancer.v2.member.Member> ๐ซ
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found ๐ญ
members(pool, **query)
Return a generator of members โ so many members, a whole little squad ๐ง
Parameters
poolโ the ID of a pool, or aPool<#openstack.load_balancer.v2.pool.Pool> instance that the member belongs to ๐ฆqueryโ optional query parameters you send to limit the resources coming back at you. Valid parameters are:
Returns โ a generator of member objects โญ
update_member(member, pool, **attrs)
Update a member. Glow-up time ๐
Parameters
memberโ either the ID of a member or aMember<#openstack.load_balancer.v2.member.Member> instance ๐ธpoolโ the ID of a pool, or aPool<#openstack.load_balancer.v2.pool.Pool> instance that the member belongs to ๐attrsโ the attributes to update on the member represented bymemberโจ
Returns โ the updated member ๐ฅ
โจ Health Monitor Operations โจ
class openstack.load_balancer.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
find_health_monitor(name_or_id, ignore_missing=True)
Find a single health monitor ๐ฉบโจ
Parameters
name_or_idโ the name or the ID of a health monitor ๐ignore_missingโ set toFalseandNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the health monitor doesn't exist. Set toTrueand no exception is set when you're attempting to find a nonexistent health monitor. Bestie just shrugs ๐คทโโ๏ธ
Returns โ the openstack.load_balancer.v2.healthmonitor.HealthMonitor object matching the given name or id, or None if nothing matches ๐
Raises openstack.exceptions.DuplicateResource <#openstack.exceptions.DuplicateResource> if more than one resource is found for this request โ like, calm down, pick one ๐ญ
Raises openstack.exceptions.NotFoundException <#openstack.exceptions.NotFoundException> if nothing is found and ignore_missing is False ๐
create_health_monitor(**attrs)
Create a brand new health monitor out of attributes. Build-a-bear but for load balancing ๐งธ
Parameters
attrsโ keyword arguments that get used to create aHealthMonitor, made up of the properties on theHealthMonitorclass ๐
Returns โ the results of HealthMonitor creation โจ
get_health_monitor(healthmonitor)
Get a health monitor ๐
Parameters
healthmonitorโ the value can be the ID of a health monitor or aHealthMonitorinstance ๐
Returns โ one health monitor ๐ฆ
health_monitors(**query)
Retrieve a generator of health monitors โ a whole generator, so many of them ๐ธ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. Valid parameters are:'name','created_at','updated_at','delay','expected_codes','http_method','max_retries','max_retries_down','pool_id','provisioning_status','operating_status','timeout','project_id','type','url_path','is_admin_state_up'๐
Returns โ a generator of health monitor instances โญ
delete_health_monitor(healthmonitor, ignore_missing=True)
Delete a health monitor. Bye bestie ๐๐
Parameters
healthmonitorโ can be either the ID of the health monitor or aHealthMonitorinstance ๐ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when thehealthmonitordoesn't exist. When set toTrue, no exception gets set when you're attempting to delete a nonexistenthealthmonitor๐
Returns โ the deleted health monitor โจ
update_health_monitor(healthmonitor, **attrs)
Update a health monitor. Self-care era ๐งโโ๏ธ
Parameters
healthmonitorโ can be either the ID of the health monitor or aHealthMonitorinstance ๐attrsโ the attributes to update on the health monitor represented byhealthmonitor๐ฆ
Returns โ the updated health monitor ๐ฅ
โจ L7 Policy Operations โจ
class openstack.load_balancer.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_l7_policy(**attrs)
Create a new l7policy from attributes ๐
Parameters
attrsโ keyword arguments which will be used to create aL7Policy<#openstack.load_balancer.v2.l7_policy.L7Policy>, comprised of the properties on theL7Policyclass ๐
Returns โ the results of l7policy creation โจ
delete_l7_policy(l7_policy, ignore_missing=True)
Delete a l7policy ๐๏ธ๐
Parameters
l7_policyโ the value can be either the ID of a l7policy or aL7Policy<#openstack.load_balancer.v2.l7_policy.L7Policy> instance ๐ธignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the l7policy doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent l7policy โ she simply lets it go ๐ฆ
Returns โ None ๐
find_l7_policy(name_or_id, ignore_missing=True)
Find a single l7policy ๐
Parameters
name_or_idโ the name or ID of a l7policy ๐ignore_missingโ okay so when this isFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised the moment the resource doesn't exist. When it'sTrue? You just getNoneback when you try to find something that isn't there. No drama, no exception ๐
Returns โ one L7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy> or None, no cap
get_l7_policy(l7_policy)
Get a single l7policy. Just the one. The main character ๐
Parameters
l7_policyโ this value can be the ID of a l7policy, or an actualL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance. Either works, she's flexible โจ
Returns โ one L7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found ๐ญ like it's literally not there
l7_policies(**query)
Return a generator of l7policies. A whole lil stream of them ๐ธ
Parameters
queryโ optional query parameters you send over to limit the resources being returned. Valid parameters are:
bestie the list of valid parameters is literally empty in the source, I'm not making stuff up for you ๐ that's just how it is
Returns โ a generator of l7policy objects ๐ฆ
update_l7_policy(l7_policy, **attrs)
Update a l7policy. Glow-up time ๐
Parameters
l7_policyโ either the id of a l7policy or aL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance.attrsโ the attributes to update on the l7policy represented by l7policy.
Returns โ the updated l7policy ๐ฅ
โจ L7 Rule Operations โจ
class openstack.load_balancer.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_l7_rule(l7_policy, **attrs)
Create a shiny new l7rule from attributes โจ
Parameters
l7_policyโ the l7_policy can be either the ID of a l7policy, or anL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance that the l7rule is gonna be created in. It's giving "where do I live" energy ๐attrsโ keyword arguments that get used to create aL7Rule <#openstack.load_balancer.v2.l7_rule.L7Rule>, made up of the properties on theL7Ruleclass.
Returns โ the results of l7rule creation ๐
delete_l7_rule(l7rule, l7_policy, ignore_missing=True)
Delete a l7rule. Bye bestie ๐
Parameters
l7ruleโ the l7rule can be either the ID of a l7rule or aL7Rule <#openstack.load_balancer.v2.l7_rule.L7Rule>instance.l7_policyโ the l7_policy can be either the ID of a l7policy or anL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance that the l7rule belongs to.ignore_missingโ when it'sFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the l7rule does not exist. When it'sTrue, no exception will be set when you attempt to delete a nonexistent l7rule. Very chill of it ๐ง
Returns โ None
find_l7_rule(name_or_id, l7_policy, ignore_missing=True)
Find a single l7rule ๐
Parameters
name_or_idโ the name or ID of a l7rule.l7_policyโ the l7_policy can be either the ID of a l7policy or anL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance that the l7rule belongs to.ignore_missingโ when it'sFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the resource does not exist. When it'sTrue,Nonegets returned when you attempt to find a nonexistent resource ๐ซถ
Returns โ one L7Rule <#openstack.load_balancer.v2.l7_rule.L7Rule> or None
get_l7_rule(l7rule, l7_policy)
Get a single l7rule. One. Singular. Iconic ๐
Parameters
l7ruleโ the l7rule can be the ID of a l7rule or aL7Rule <#openstack.load_balancer.v2.l7_rule.L7Rule>instance.l7_policyโ the l7_policy can be either the ID of a l7policy or anL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance that the l7rule belongs to.
Returns โ one L7Rule <#openstack.load_balancer.v2.l7_rule.L7Rule>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found ๐ญ
l7_rules(l7_policy, **query)
Return a generator of l7rules ๐
Parameters
l7_policyโ the l7_policy can be either the ID of a l7_policy or anL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance that the l7rule belongs to.queryโ optional query parameters you send over to limit the resources being returned. Valid parameters are:
again, the source lists zero valid parameters here. Not me inventing new ones for the aesthetic ๐
Returns โ a generator of l7rule objects ๐ฆ
update_l7_rule(l7rule, l7_policy, **attrs)
Update a l7rule โจ
Parameters
l7ruleโ either the ID of a l7rule or aL7Rule <#openstack.load_balancer.v2.l7_rule.L7Rule>instance.l7_policyโ the l7_policy can be either the ID of a l7policy or anL7Policy <#openstack.load_balancer.v2.l7_policy.L7Policy>instance that the l7rule belongs to.attrsโ the attributes to update on the l7rule represented by l7rule.
Returns โ the updated l7rule ๐ฅ
๐ Provider Operations ๐
class openstack.load_balancer.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
providers(**query)
Retrieve a generator of providers ๐
Returns โ a generator of providers instances
provider_flavor_capabilities(provider, **query)
Retrieve a generator of provider flavor capabilities ๐
Returns โ a generator of provider flavor capabilities instances
๐ Flavor Profile Operations ๐
class openstack.load_balancer.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_flavor_profile(**attrs)
Create a new flavor profile from attributes โจ
Parameters
attrsโ keyword arguments that get used to create aFlavorProfile <#openstack.load_balancer.v2.flavor_profile.FlavorProfile>, made up of the properties on theFlavorProfileclass.
Returns โ the results of profile creation creation. Yes, "creation creation," that's what it says, and honestly? Slay ๐
get_flavor_profile(flavor_profile)
Get a flavor profile ๐
Parameters
flavor_profileโ this value can be the name of a flavor profile, or aFlavorProfile <#openstack.load_balancer.v2.flavor_profile.FlavorProfile>instance.
Returns โ one FlavorProfile <#openstack.load_balancer.v2.flavor_profile.FlavorProfile>
flavor_profiles(**query)
Retrieve a generator of flavor profiles ๐ธ
Returns โ a generator of flavor profiles instances
delete_flavor_profile(flavor_profile, ignore_missing=True)
Delete a flavor profile ๐
Parameters
-
๐
delete_flavor_profile(flavor_profile, ignore_missing=True)
Say bye to a flavor profile ๐
Parameters
flavor_profileโ the flavor profile can be either the ID or aFlavorProfileinstance (the full path isopenstack.load_balancer.v2.flavor_profile.FlavorProfile, iykyk)ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the flavor profile does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent flavor profile. lowkey the chill option fr fr
Returns
None
๐ find_flavor_profile(name_or_id, ignore_missing=True)
Find a single flavor profile, like a lil scavenger hunt ๐ต๏ธโโ๏ธ
Parameters
name_or_idโ the name or ID of a flavor profileignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the flavor profile does not exist. When set toTrue, no exception will be set when attempting to find a nonexistent flavor profile.
Returns
None
โจ update_flavor_profile(flavor_profile, **attrs)
Glow-up time for a flavor profile ๐
Parameters
flavor_profileโ the flavor_profile can be either the ID or aFlavorProfile(openstack.load_balancer.v2.flavor_profile.FlavorProfile) instanceattrsโ the attributes to update on the flavor profile represented byflavor_profile
Returns
The updated flavor profile
๐ Flavor Operations
class signature incoming, and yes it's the whole entire thing, exactly as written, no I'm not summarizing it bestie:
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ง create_flavor(**attrs)
Create a new flavor from attributes ๐ฆ
Parameters
attrsโ keyword arguments which will be used to create aFlavor(openstack.load_balancer.v2.flavor.Flavor), comprised of the properties on the Flavor class.
Returns
The results of flavor creation creation
not a typo of mine โ the docs fr said "creation creation" twice and honestly? main character energy. keeping it exactly as-is, no cap ๐
๐ get_flavor(flavor)
Get a flavor
Parameters
flavorโ the value can be the ID of a flavor orFlavor(openstack.load_balancer.v2.flavor.Flavor) instance.
Returns
One Flavor (openstack.load_balancer.v2.flavor.Flavor)
๐ flavors(**query)
Retrieve a generator of flavors
Returns
A generator of flavor instances
๐ delete_flavor(flavor, ignore_missing=True)
Delete a flavor
Parameters
flavorโ the flavor can be either the ID or aFlavor(openstack.load_balancer.v2.flavor.Flavor) instanceignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the flavor does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent flavor.
Returns
None
๐ฆ find_flavor(name_or_id, ignore_missing=True)
Find a single flavor
Parameters
name_or_idโ the name or ID of a flavorignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the flavor does not exist. When set toTrue, no exception will be set when attempting to find a nonexistent flavor.
Returns
None
๐ update_flavor(flavor, **attrs)
Update a flavor
Parameters
flavorโ the flavor can be either the ID or aFlavor(openstack.load_balancer.v2.flavor.Flavor) instanceattrsโ the attributes to update on the flavor represented byflavor.
Returns
The updated flavor
๐ Quota Operations
same Proxy class signature, same everything, here we go again (the manpage is obsessed with repeating it and honestly? consistent queen):
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ซถ quotas(**query)
Return a generator of quotas
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. Currently no query parameter is supported. (so likeโฆ bring nothing ๐ง)
Returns
A generator of quota objects
๐ธ get_quota(quota)
Get a quota
Parameters
quotaโ the value can be the ID of a quota or aQuota(openstack.load_balancer.v2.quota.Quota) instance. The ID of a quota is the same as the project ID for the quota. yes, they're the same thing, that's not a mistake ๐คฏ
Returns
One Quota (openstack.load_balancer.v2.quota.Quota)
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
โญ update_quota(quota, **attrs)
Update a quota
Parameters
quotaโ either the ID of a quota or aQuota(openstack.load_balancer.v2.quota.Quota) instance. The ID of a quota is the same as the project ID for the quota.attrsโ the attributes to update on the quota represented byquota.
Returns
The updated quota
๐ get_quota_default()
Get a default quota
Returns
One QuotaDefault
๐ฅ delete_quota(quota, ignore_missing=True)
Delete a quota (i.e. reset to the default quota) โ so it's less "delete" and more "rebirth" โจ
Parameters
quotaโ the value can be either the ID of a quota or aQuota(openstack.load_balancer.v2.quota.Quota) instance. The ID of a quota is the same as the project ID for the quota.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when quota does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent quota.
Returns
None
๐ฆ Amphora Operations
you guessed it, the Proxy class signature one more time, character for character:
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ง amphorae(**query)
Retrieve a generator of amphorae โ say it with me, amphorae ๐บ
Returns
A generator of amphora instances
๐ get_amphora(amphora)
Get a amphora
Parameters
amphoraโ the value can be the ID of an amphora orAmphora(openstack.load_balancer.v2.amphora.Amphora) instance.
Returns
One Amphora (openstack.load_balancer.v2.amphora.Amphora)
๐ find_amphora(amphora, ignore_missing=True)
Find a single amphora
Parameters
amphoraโ the ID or aAmphora(openstack.load_balancer.v2.amphora.Amphora) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the amphora does not exist. When set toTrue, no exception will be set when attempting to find a nonexistent amphora.
Returns
None
๐ configure_amphora(amphora)
Update the configuration of an amphora agent
amphoraโ the ID or anAmphora<#openstack.load_balancer.v2.amphora.Amphora> instance.
Returns
None
failover_amphora(amphora)โ failover an amphora ๐ซถ
Parameters
amphoraโ the ID or anAmphora<#openstack.load_balancer.v2.amphora.Amphora> instance.
Returns
None
๐ฆ Availability Zone Profile Operations
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_availability_zone_profile(**attrs)โ bestie, this makes a brand new availability zone profile straight from attributes โจ
Parameters
attrsโ keyword arguments that get used to create anAvailabilityZoneProfile<#openstack.load_balancer.v2.availability_zone_profile.AvailabilityZoneProfile>, built out of the properties on theAvailabilityZoneProfileclass. iykyk.
Returns
The results of profile creation
get_availability_zone_profile(availability_zone_profile)โ grab one availability zone profile, no cap ๐ธ
Parameters
availability_zone_profileโ the value here can be the ID of anavailability_zoneprofile or anAvailabilityZoneProfile<#openstack.load_balancer.v2.availability_zone_profile.AvailabilityZoneProfile> instance.
Returns
One AvailabilityZoneProfile <#openstack.load_balancer.v2.availability_zone_profile.AvailabilityZoneProfile>
availability_zone_profiles(**query)โ pulls you a generator of availability zone profiles, literally ๐
Returns
A generator of availability zone profiles instances
delete_availability_zone_profile(availability_zone_profile, ignore_missing=True)โ yeets an availability zone profile ๐
Parameters
availability_zone_profileโ theavailability_zone_profilecan be either the ID or anAvailabilityZoneProfile<#openstack.load_balancer.v2.availability_zone_profile.AvailabilityZoneProfile> instance.ignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the availability zone profile doesn't exist. When it's set toTrue, no exception gets set when you try to delete a nonexistent availability zone profile. ๐ซถ
Returns
None
find_availability_zone_profile(name_or_id, ignore_missing=True)โ finds you a single availability zone profile, iconic behaviour ๐
Parameters
name_or_idโ the name or ID of an availability zone profileignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the availability zone profile doesn't exist. When it's set toTrue, no exception gets set when you try to find a nonexistent availability zone profile.
Returns
None
update_availability_zone_profile(availability_zone_profile, **attrs)โ updates an availability zone profile โญ
Parameters
availability_zone_profileโ theavailability_zone_profilecan be either the ID or anAvailabilityZoneProfile<#openstack.load_balancer.v2.availability_zone_profile.AvailabilityZoneProfile> instance.attrsโ the attributes to update on the availability zone profile represented byavailability_zone_profile.
Returns
The updated availability zone profile
๐ Availability Zone Operations
class openstack.load_balancer.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_availability_zone(**attrs)โ creates a new availability zone from attributes, slay ๐
Parameters
attrsโ keyword arguments which will be used to create anAvailabilityZone<#openstack.load_balancer.v2.availability_zone.AvailabilityZone>, comprised of the properties on theAvailabilityZoneclass.
Returns
The results of availability_zone creation creation
get_availability_zone(availability_zone)โ gets you one availability zone ๐ง
Parameters
availability_zoneโ the value can be the ID of anavailability_zoneor anAvailabilityZone<#openstack.load_balancer.v2.availability_zone.AvailabilityZone> instance.
Returns
One AvailabilityZone <#openstack.load_balancer.v2.availability_zone.AvailabilityZone>
availability_zones(**query)โ retrieves a generator of availability zones, very demure ๐
Returns
A generator of availability zone instances
delete_availability_zone(availability_zone, ignore_missing=True)โ deletes anavailability_zone๐
Parameters
availability_zoneโ theavailability_zonecan be either the ID or anAvailabilityZone<#openstack.load_balancer.v2.availability_zone.AvailabilityZone> instance.ignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the availability zone doesn't exist. When it's set toTrue, no exception will be set when attempting to delete a nonexistent availability zone.
Returns
None
find_availability_zone(name_or_id, ignore_missing=True)โ finds a single availability zone, periodt โจ
Parameters
name_or_idโ the name or ID of an availability zoneignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the availability zone doesn't exist. When it's set toTrue, no exception will be set when attempting to find a nonexistent availability zone.
Returns
None
update_availability_zone(availability_zone, **attrs)โ updates an availability zone ๐ฅ
Parameters
availability_zoneโ theavailability_zonecan be either the ID or anAvailabilityZone<#openstack.load_balancer.v2.availability_zone.AvailabilityZone> instance.attrsโ the attributes to update on theavailability_zonerepresented byavailability_zone.
Returns
The updated availability_zone
๐ Message API v2
For details on how to use message, see Using OpenStack Message <> ๐
๐ The Message v2 Class
The message high-level interface is available through the message member of a Connection <#openstack.connection.Connection> object. The message member only gets added if the service is detected. lowkey magical.
๐ Message Operations
class openstack.message.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
post_message(queue_name, messages)โ posts messages to the given queue, go off ๐ฌ
Parameters
queue_nameโ the name of the target queue to post the message to.messagesโ list of messages body and TTL to post.:type messages: list
A string, and that string has the location of the messages you posted successfully. Slay, you posted. โจ
messages(queue_name, **query)
Grabs you a generator of messages โ a whole lil stream of them, like a feed. ๐ฆ
Parameters
queue_nameโ the name of the target queue you're querying messages from.queryโ optional query params you can send along to narrow down which messages come back. The available ones are:limit: asks for at most that many items to be returned from the query.marker: specifies the ID of the last-seen subscription. The move here is: use thelimitparam to make an initial limited request, then take the ID of the last-seen subscription from the response and feed it in as themarkerparam value on your next limited request. Paging, bestie, it's giving pagination. ๐echo: says whether the messages can be echoed back to the client that posted them.include_claimed: says whether the messages list should include the claimed messages.
Returns
A generator of message instances. A whole generator, so you can loop over it like it's your fyp. ๐
get_message(queue_name, message)
Gets you exactly one message. Iconic, singular, main character energy. ๐
Parameters
queue_nameโ the name of the target queue you're getting the message from.messageโ this value can be the name of a message, or aMessageinstance.
Returns
One Message.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no message matching the criteria could be found. ๐ญ Nothing matched, it's literally not there.
delete_message(queue_name, value, claim=None, ignore_missing=True)
Deletes a message. Gone. Reduced to atoms. ๐
Parameters
queue_nameโ the name of the target queue you're deleting the message from.valueโ this value can be either the name of a message or aMessageinstance.claimโ this value can be the ID, or aClaiminstance, of the claim seizing the message. If it'sNone, the message has not been claimed.ignore_missingโ when you set this toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the message doesn't exist. When it's set toTrue, no exception gets set when you attempt to delete a nonexistent message. Very chill of it, ngl.
Returns
None.
๐งบ Queue Operations
class openstack.message.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Yes babes, it's the same Proxy signature again. Three times in this page. She's consistent, we love that for her. ๐ซถ
create_queue(**attrs)
Makes a brand new queue out of attributes. Fresh out the box. ๐
Parameters
attrsโ keyword arguments that get used to create aQueue, made up of the properties on theQueueclass.
Returns
The results of queue creation.
get_queue(queue)
Gets you a queue. One singular queue. ๐ง
Parameters
queueโ this value can be the name of a queue or aQueueinstance.
Returns
One Queue.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no queue matching the name could be found.
queues(**query)
Gives you a generator of queues โ all of them, streaming at you. ๐ฆ
Parameters
queryโ optional query params to send along so you can restrict which queues come back. The available ones are:limit: asks for at most that many items to be returned from the query.marker: specifies the ID of the last-seen queue. Use thelimitparameter to make an initial limited request, then use the ID of the last-seen queue from the response as themarkerparameter value in a subsequent limited request. Same paging trick as before, iykyk. ๐
Returns
A generator of queue instances.
delete_queue(value, ignore_missing=True)
Deletes a queue. Bye bestie. ๐
Parameters
valueโ this value can be either the name of a queue or aQueueinstance.ignore_missingโ when you set this toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the queue doesn't exist. When it's set toTrue, no exception gets set when you attempt to delete a nonexistent queue.
Returns
The deleted queue.
๐๏ธ Claim Operations
class openstack.message.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Yup, the exact same signature. She said copy-paste is a valid aesthetic. โจ
create_claim(queue_name, **attrs)
Creates a new claim from attributes. Claiming things is so fetch. ๐ฅ
Parameters
queue_nameโ the name of the target queue to claim a message from.attrsโ keyword arguments that get used to create aClaim, made up of the properties on theClaimclass.
Returns
The results of claim creation.
get_claim(queue_name, claim)
Gets you a claim. One claim, no more, no less. ๐
Parameters
queue_nameโ the name of the target queue to claim a message from.claimโ this value can be either the ID of a claim or aClaiminstance.
Returns
One Claim.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no claim matching the criteria could be found.
update_claim(queue_name, claim, **attrs)
Updates an existing claim from attributes. Glow-up for your claim. ๐
Parameters
queue_nameโ the name of the target queue to claim a message from.claimโ this value can be either the ID of a claim or aClaiminstance.attrsโ keyword arguments that get used to update aClaim, made up of the properties on theClaimclass.
Returns
The results of claim update.
delete_claim(queue_name, claim, ignore_missing=True)
Deletes a claim. Claim revoked, vibe restored. ๐ฆ
Parameters
queue_nameโ the name of the target queue to claim messages from.claimโ this value can be either the ID of a claim or aClaiminstance.ignore_missingโ when you set this toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the claim doesn't exist. When it's set toTrue, no exception gets thrown when you attempt to delete a nonexistent claim.
Returns
The deleted claim.
๐ฌ Subscription Operations
class openstack.message.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Third time's the charm, same signature, same icon behaviour. ๐
create_subscription(queue_name, **attrs)
Creates a new subscription from attributes. Subscribing is literally self-care. ๐ธ
Parameters
queue_nameโ the name of the target queue you're subscribing on โจattrsโ keyword args that get used to create aSubscription, made up of the properties on theSubscriptionclass ๐
Returns The results of subscription creation ๐
subscriptions(queue_name, **query)
Pull a whole generator of subscriptions, bestie ๐ธ
Parameters
queue_nameโ the name of the target queue to subscribe on.queryโ optional query params you can send to restrict which subscriptions come back. The available ones are:limit: asks for at most that many items back from the query ๐ฅmarker: specifies the ID of the last-seen subscription. Uselimitto make your first limited request, then take the ID of the last-seen subscription from the response and drop it in as themarkervalue on your next limited request. iykyk ๐ง
Returns A generator of subscription instances ๐
get_subscription(queue_name, subscription)
Grab one singular subscription ๐
Parameters
queue_nameโ the name of the target queue of the subscription.messageโ the value can be the ID of a subscription or aSubscriptioninstance.
Returns One Subscription ๐ฆ
Raises NotFoundException <#openstack.exceptions.NotFoundException> when nothing matches the criteria. Sad but true ๐ญ
delete_subscription(queue_name, value, ignore_missing=True)
Yeet that subscription ๐
Parameters
queue_nameโ the name of the target queue to delete the subscription from.valueโ can be either the name of a subscription or aSubscriptioninstance.ignore_missingโ when it's set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised if the subscription doesn't exist. When it'sTrue, no exception is thrown when you attempt to delete a nonexistent subscription ๐ซถ
Returns The deleted subscription.
๐ Network API ๐
For the deets on how to use network, see Using OpenStack Network <>
โญ The Network Class โญ
The network high-level interface lives on the network member of a Connection <#openstack.connection.Connection> object. Heads up: that network member only gets added if the service is detected ๐
๐ฆ Network Operations ๐ฆ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Empty Returns sections in this stretch? Yeah, that's just how it is โ no extra lore, no cap ๐
dhcp_agent_hosting_networks(agent, **query)
A generator of networks hosted by a DHCP agent, slay โจ
Parameters
agentโ either the agent id or an instance ofAgent.queryโ kwargs query: optional query parameters to send so you can limit the resources being returned.
Returns A generator of networks ๐ธ
add_dhcp_agent_to_network(agent, network)
Put a DHCP Agent onto a network ๐ฅ
Parameters
agentโ either the agent id or an instance ofAgent.networkโNetworkinstance.
Returns (empty โ literally nothing listed here ๐)
remove_dhcp_agent_from_network(agent, network)
Take a DHCP Agent back off a network ๐ง
Parameters
agentโ either the agent id or an instance ofAgent.networkโNetworkinstance.
Returns (again, nothing listed ๐ฟ)
create_network(**attrs)
Spin up a brand new network from attributes, main character energy ๐
Parameters attrs โ keyword args used to create a Network <#openstack.network.v2.network.Network>, made up of the properties on the Network class.
Returns The results of network creation ๐
delete_network(network, ignore_missing=True, if_revision=None)
Delete a network. Bye bestie ๐
Parameters
networkโ the value can be either the ID of a network or aNetwork <#openstack.network.v2.network.Network>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the network doesn't exist. When set toTrue, no exception is set when attempting to delete a nonexistent network.if_revisionโ revision to put in theIf-Matchheader of the update request, to perform a compare-and-swap update ๐
Returns None
find_network(name_or_id, ignore_missing=True, **query)
Find one single network ๐ฆ
Parameters
name_or_idโ the name or ID of a network.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the resource doesn't exist. When set toTrue,Nonegets returned when attempting to find a nonexistent resource.queryโ any additional parameters passed into the underlying methods, like query filters.
Returns One Network <#openstack.network.v2.network.Network> or None โญ
get_network(network, *, fields=None)
Get a single network, periodt ๐
Parameters
networkโ the value can be the ID of a network or aNetwork <#openstack.network.v2.network.Network>instance.fieldsโ limit the resource fields to fetch. lowkey so useful ๐
Returns One Network <#openstack.network.v2.network.Network>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found ๐ญ
networks(**query)
Return a generator of networks ๐
Parameters query โ optional query parameters sent to limit the resources being returned. Available parameters include:
description: the network description.ipv4_address_scope_id: the ID of the IPv4 address scope for the network.ipv6_address_scope_id: the ID of the IPv6 address scope for the network.is_admin_state_up: network administrative stateis_port_security_enabled: the port security status.is_router_external: network is external or not.is_shared: whether the network is shared across projects.name: the name of the network.status: network statusproject_id: owner project IDprovider_network_type: network physical mechanismprovider_physical_network: physical networkprovider_segmentation_id: VLAN ID for VLAN networks or Tunnel ID for GENEVE/GRE/VXLAN networks ๐ง
Returns A generator of network objects ๐
update_network(network, if_revision=None, **attrs)
Update a network โจ
Parameters
networkโ either the id of a network or an instance of typeNetwork <#openstack.network.v2.network.Network>.if_revisionโ revision to put in theIf-Matchheader of the update request, to perform a compare-and-swap update.attrsโ the attributes to update on the network represented bynetwork.
Returns The updated network ๐ฅ
find_network_ip_availability(name_or_id, ignore_missing=True, **query)
Find the IP availability of a network ๐
Parameters
name_or_idโ the name or ID of a network.ignore_missingโ bestie, when this is set toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised the moment the resource doesn't exist. Set it toTrueand you just getNoneback when it goes looking for something that isn't there. No drama, no exception. ๐ซถqueryโ any extra params you wanna pass down into the underlying methods, like query filters and stuff.
๐ซ Returns
One NetworkIPAvailability <#openstack.network.v2.network_ip_availability.NetworkIPAvailability> or None.
โจ get_network_ip_availability(network, *, fields=None)
Get the IP availability of a network. Iconic little lookup tbh.
Parameters
networkโ this can be the ID of a network or aNetwork <#openstack.network.v2.network.Network>instance. Either one slays.fieldsโ limit the resource fields you actually fetch. Keep it lean, queen. ๐
Returns
One NetworkIPAvailability <#openstack.network.v2.network_ip_availability.NetworkIPAvailability>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
โจ network_ip_availabilities(**query)
Returns a generator of network ip availabilities. A whole generator, not just one โ we're feasting. ๐
Parameters
query โ
Optional query parameters you can send to limit which resources come back. The available ones include:
ip_version: the IP version of the networknetwork_id: ID of the network to use when listening for network IP availabilitynetwork_name: the name of the network for that particular network IP availabilityproject_id: the owner project ID
Returns
A generator of network ip availability objects: NetworkIPAvailability <#openstack.network.v2.network_ip_availability.NetworkIPAvailability>.
๐ Port Operations ๐
Okay so this whole section is just the proxy class again, same energy, different day:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
โจ create_port(**attrs)
Create a shiny new port from attributes. New port, who dis. ๐ฆ
Parameters
attrsโ keyword arguments used to create aPort <#openstack.network.v2.port.Port>, made up of the properties on thePortclass.
Returns
The results of port creation. ๐
โจ create_ports(data)
Create a bunch of ports from a list of attributes. Batch mode, we love efficiency.
Parameters
dataโ list of dicts of attributes that'll be used to create aPort <#openstack.network.v2.port.Port>, made up of the properties on thePortclass.
Returns
A generator of port objects.
โจ delete_port(port, ignore_missing=True, if_revision=None)
Delete a port. Bye bestie, you will not be missed (jk ily). ๐
Parameters
portโ the value can be either the ID of a port or aPort <#openstack.network.v2.port.Port>instance.ignore_missingโ when set toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>will be raised if the port doesn't exist. When set toTrue, no exception gets set when you try to delete a port that isn't there. Cozy deletion. ๐ซถif_revisionโ the revision to put in theIf-Matchheader of the update request, so it does a compare-and-swap update. Fancy.
Returns
None. That's it, that's the whole return.
โจ find_port(name_or_id, ignore_missing=True, **query)
Find one single port. Just one. The main character port. ๐
Parameters
name_or_idโ the name or ID of a port.ignore_missingโ when set toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>will be raised if the resource doesn't exist. When set toTrue,Nonewill be returned when you try to find a nonexistent resource. Soft launch failure. ๐queryโ any additional parameters passed into the underlying methods, like query filters and such.
Returns
One Port <#openstack.network.v2.port.Port> or None.
โจ get_port(port, *, fields=None)
Get a single port. Grabbing exactly what you asked for.
Parameters
portโ the value can be the ID of a port or aPort <#openstack.network.v2.port.Port>instance.fieldsโ limit the resource fields to fetch. Minimalism era. โจ
Returns
One Port <#openstack.network.v2.port.Port>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
โจ ports(**query)
Return a generator of ports. So many ports, so little time. ๐
Parameters
query โ
Optional query parameters to be sent to limit the resources being returned. Available parameters include:
description: the port description.device_id: port device ID.device_owner: port device owner (e.g.network:dhcp).ip_address: IP addresses of an allowed address pair.is_admin_state_up: the administrative state of the port.is_port_security_enabled: the port security status.mac_address: port MAC address.name: the port name.network_id: ID of the network that owns the ports.project_id: the ID of the project who owns the network.status: the port status. The value isACTIVEorDOWN.subnet_id: the ID of the subnet.
Returns
A generator of port objects. ๐
โจ update_port(port, if_revision=None, **attrs)
Update a port. Glow-up time. ๐
Parameters
portโ either the ID of a port or aPort <#openstack.network.v2.port.Port>instance.if_revisionโ the revision to put in theIf-Matchheader of the update request, so it performs a compare-and-swap update.attrsโ the attributes to update on the port represented byport.
Returns
The updated port. ๐ฅ
๐ Router Operations ๐
And once again, our beloved proxy class, appearing like it pays rent here:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
โจ create_router(**attrs)
Create a new router from attributes. Build-a-router workshop. ๐ง
Parameters
attrsโ keyword arguments used to create aRouter <#openstack.network.v2.router.Router>, made up of the properties on theRouterclass.
Returns
The results of router creation. ๐
โจ delete_router(router, ignore_missing=True, if_revision=None)
Delete a router. Sorry to this route. ๐ญ
Parameters
routerโ the value can be either the ID of a router or aRouter <#openstack.network.v2.router.Router>instance.ignore_missingโ when set toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the router doesn't exist. When set toTrue, no exception is set when you try to delete a nonexistent router. Peaceful exits only. โจif_revisionโ the revision to put in theIf-Matchheader of the update request, to perform a compare-and-swap update.
Returns
None.
โจ find_router(name_or_id, ignore_missing=True, **query)
Find a single router.
Parameters
name_or_idโ the name or ID of a router.ignore_missingโ ngl this one is a whole mood. Set it toFalseand the SDK will straight-up raiseNotFoundException <#openstack.exceptions.NotFoundException>if the resource isn't there. Set it toTrueand you just getNoneback when you go looking for something that doesn't exist. no drama, no crash ๐queryโ any extra params you wanna pass down into the underlying methods, like query filters and stuff.
Returns One Router <#openstack.network.v2.router.Router> or None
โจ get_router(router, *, fields=None)
Get a single router โ just the one, main character energy ๐
Parameters
routerโ the value can be the ID of a router or aRouter <#openstack.network.v2.router.Router>instance. either way works, we're flexible like that ๐ซถfieldsโ limit the resource fields to fetch. keep it light, bestie.
Returns One Router <#openstack.network.v2.router.Router>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. yeah. it'll let you know. loudly. ๐ญ
๐ฆ routers(**query)
Return a generator of routers โ like a whole little router parade, one at a time โจ
Parameters
query โ optional query parameters to be sent to limit the resources being returned. Valid parameters are:
description: The description of a router.flavor_id: The ID of the flavor.is_admin_state_up: Router administrative state is up or notis_distributed: The distributed state of a routeris_ha: The highly-available state of a routername: Router nameproject_id: The ID of the project this router is associated with.status: The status of the router.
Returns A generator of router objects
๐ update_router(router, if_revision=None, **attrs)
Update a router. glow-up time.
Parameters
routerโ either the id of a router or aRouter <#openstack.network.v2.router.Router>instance.if_revisionโ revision to put inIf-Matchheader of update request to perform compare-and-swap update. yes it's doing the fancy concurrency thing, we love a careful queen ๐ฅattrsโ the attributes to update on the router represented by router.
Returns The updated router
๐ add_interface_to_router(router, subnet=None, port=None, *, advertise_host=False)
Add Interface to a router โ giving it a little connection, a little something ๐ซ
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>subnetโ the ID or aSubnet <#openstack.network.v2.subnet.Subnet>instance of the subnet to add.portโ the ID or aPort <#openstack.network.v2.port.Port>instance of the port to add.advertise_hostโ whether to advertise the subnet's prefixes as host routes within the router's EVPN VNI.
Returns Router with updated interface
๐ธ remove_interface_from_router(router, subnet=None, port=None)
Remove Interface from a router โ breaking up, but make it clean ๐ฅ
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>subnetโ the ID or aSubnet <#openstack.network.v2.subnet.Subnet>instance of the subnet to remove.portโ the ID or aPort <#openstack.network.v2.port.Port>instance of the port to remove.
Returns Router with updated interface
๐ง add_extra_routes_to_router(router, body)
Add extra routes to a router โ extra routes, extra vibes, no cap โจ
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>bodyโ the request body as documented in the api-ref. (yes, go read the api-ref, iykyk)
Returns Router with updated extra routes
๐ remove_extra_routes_from_router(router, body)
Remove extra routes from a router โ cleaning house, respectfully ๐งน
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>bodyโ the request body as documented in the api-ref.
Returns Router with updated extra routes
๐ add_gateway_to_router(router, **body)
Add Gateway to a router โ the router gets a door now, iconic behavior ๐ช
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>bodyโ body with the gateway information
Returns Router with updated interface
๐ remove_gateway_from_router(router, **body)
Remove Gateway from a router โ closing the door behind you, dramatic but valid ๐
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>bodyโ body with the gateway information
Returns Router with updated interface
๐ add_external_gateways(router, body)
Add router external gateways โ plural. we're doing multiple gateways, we're thriving.
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>bodyโ body containing theexternal_gatewaysparameter.
Returns Router with added gateways
โญ update_external_gateways(router, body)
Update router external gateways โ same gateways, new you โจ
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>bodyโ body containing theexternal_gatewaysparameter.
Returns Router with updated gateways
๐ฆ remove_external_gateways(router, body)
Remove router external gateways โ bye bestie, you were so real ๐ซถ
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>bodyโ body containing theexternal_gatewaysparameter.
Returns Router without the removed gateways
๐ create_conntrack_helper(router, **attrs)
Create a new L3 conntrack helper from attributes โ manifesting a conntrack helper into existence ๐ซ
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>attrsโ keyword arguments which will be used to create aConntrackHelper, comprised of the properties on theConntrackHelperclass.
Returns The results of conntrack helper creation
๐ฅ conntrack_helpers(router, **query)
Return a generator of conntrack helpers โ a little conntrack helper assembly line ๐
Parameters
routerโ either the router ID or an instance ofRouter <#openstack.network.v2.router.Router>queryโ optional query parameters to be sent to limit the resources being returned.
Returns A generator of conntrack helper objects ConntrackHelper
๐ธ get_conntrack_helper(conntrack_helper, router)
Get a single L3 conntrack helper โ singular. one. the chosen one ๐
Parameters
conntrack_helperโ the value can be the ID of a L3 conntrack helper or aConntrackHelper, instance.routerโ the value can be the ID of aRouteror aRouter <#openstack.network.v2.router.Router>instance.
Returns One ConntrackHelper
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
๐ update_conntrack_helper(conntrack_helper, router, **attrs)
Update a L3 conntrack_helper โ new season, new helper arc โจ
Parameters
conntrack_helperโ the value can be the ID of a L3 conntrack helper or aConntrackHelper, instance.routerโ the value can be the ID of aRouteror aRouter <#openstack.network.v2.router.Router>instance.attrsโ the attributes to update on the L3 conntrack helper represented byconntrack_helper.
Returns The updated conntrack helper
๐ซถ delete_conntrack_helper(conntrack_helper, router, ignore_missing=True)
Delete a L3 conntrack_helper โ it's over, goodbye, and note that ignore_missing defaults to True right there in the signature ๐
Parameters
conntrack_helperโ the value can be the ID of a L3 conntrack helper or aConntrackHelper, instance.routerโ the value can be the ID of aRouteror aRouter <#openstack.network.v2.router.Router>instance.ignore_missingโ ok so when this isFalse, aNotFoundException<#openstack.exceptions.NotFoundException> gets raised if the floating ip doesn't exist. When it'sTrue? No exception, no drama, we just move on when you try to delete a nonexistent ip. ๐
Returns Nothing bestie, None.
๐ธ Floating IP Operations ๐ธ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
โจ create_ip(**attrs)
Make a brand new floating ip out of attributes. Chef's kiss, we love a fresh resource. ๐
Parameters
- attrs โ these are keyword arguments used to create a
FloatingIP<#openstack.network.v2.floating_ip.FloatingIP>, and they're made up of the properties on theFloatingIPclass. That's it, that's the vibe.
Returns The results of floating ip creation ๐
โจ delete_ip(floating_ip, ignore_missing=True, if_revision=None)
Yeet a floating ip. ๐๏ธ
Parameters
- floating_ip โ can be either the ID of a floating ip or a
FloatingIP<#openstack.network.v2.floating_ip.FloatingIP> instance. Either way works, pick your fighter. - ignore_missing โ set to
Falseand aNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the floating ip doesn't exist. Set it toTrueand no exception will be set when attempting to delete a nonexistent ip. - if_revision โ the revision to put in the
If-Matchheader of the update request, so it performs a compare-and-swap update. Fancy, I know. ๐
Returns None
โจ find_available_ip()
Find an available IP. The hunt for a free one begins. ๐
Returns One FloatingIP <#openstack.network.v2.floating_ip.FloatingIP> or None
โจ find_ip(name_or_id, ignore_missing=True, **query)
Find exactly one IP, no more no less.
Parameters
- name_or_id โ the name or ID of an IP.
- ignore_missing โ when set to
False, aNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource doesn't exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. Gentle. ๐ซถ - query โ any additional parameters to be passed into underlying methods, like query filters.
Returns One FloatingIP <#openstack.network.v2.floating_ip.FloatingIP> or None
โจ get_ip(floating_ip, *, fields=None)
Get a single floating ip. Just the one. Main character only. ๐
Parameters
- floating_ip โ the value can be the ID of a floating ip or a
FloatingIP<#openstack.network.v2.floating_ip.FloatingIP> instance. - fields โ limit the resource fields to fetch.
Returns One FloatingIP <#openstack.network.v2.floating_ip.FloatingIP>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
โจ ips(**query)
Return a generator of ips. So many ips, so little time.
Parameters
query โ
Optional query parameters to be sent to limit the resources being returned. The valid parameters are, and I quote:
description: The description of a floating IP.fixed_ip_address: The fixed IP address associated with a floating IP address.floating_ip_address: The IP address of a floating IP.floating_network_id: The ID of the network associated with a floating IP.port_id: The ID of the port to which a floating IP is associated.project_id: The ID of the project a floating IP is associated with.router_id: The ID of an associated router.status: The status of a floating IP, which can beACTIVEorDOWN.
Returns A generator of floating IP objects ๐
โจ update_ip(floating_ip, if_revision=None, **attrs)
Update a ip. Glow-up time. โจ
Parameters
- floating_ip โ either the id of a ip or a
FloatingIP<#openstack.network.v2.floating_ip.FloatingIP> instance. - if_revision โ the revision to put in the
If-Matchheader of the update request, so it performs a compare-and-swap update. - attrs โ the attributes to update on the ip represented by value.
Returns The updated ip ๐
๐ฆ Pool Operations ๐ฆ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ create_pool(**attrs)
Create a new pool from attributes. Pool party, everyone's invited. ๐
Parameters
- attrs โ keyword arguments which will be used to create a
Pool<#openstack.network.v2.pool.Pool>, comprised of the properties on thePoolclass.
Returns The results of pool creation ๐
๐ delete_pool(pool, ignore_missing=True)
Delete a pool. Bye bestie. ๐
Parameters
- pool โ the value can be either the ID of a pool or a
Pool<#openstack.network.v2.pool.Pool> instance. - ignore_missing โ when set to
False, aNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the pool doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent pool. Lowkey the nicest default.
Returns None
๐ find_pool(name_or_id, ignore_missing=True, **query)
Find a single pool. One pool. The pool. ๐
Parameters
- name_or_id โ the name or ID of a pool.
- ignore_missing โ when set to
False, aNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource doesn't exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. - query โ any additional parameters to be passed into underlying methods, such as query filters.
Returns One Pool <#openstack.network.v2.pool.Pool> or None
๐ get_pool(pool, *, fields=None)
Get a single pool. โจ
Parameters
- pool โ the value can be the ID of a pool or a
Pool<#openstack.network.v2.pool.Pool> instance. - fields โ limit the resource fields to fetch.
Returns One Pool <#openstack.network.v2.pool.Pool>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐
๐ pools(**query)
Return a generator of pools. Pool girl summer. ๐
Parameters
query โ
Optional query parameters to be sent to limit the resources being returned. The valid parameters are:
description: The description for the pool.is_admin_state_up: The administrative state of the pool.lb_algorithm: The load-balancer algorithm used, which is one ofround-robin,least-connectionsand so on.name: The name of the node pool.project_id: The ID of the project the pool is associated with.protocol: The protocol used by the pool, which is one ofTCP,HTTPorHTTPS.provider: The name of the provider of the load balancer service.subnet_id: The subnet on which the members of the pool are located.virtual_ip_id: The ID of the virtual IP used.
Returns A generator of pool objects ๐ธ
๐ update_pool(pool, **attrs)
Update a pool. Fresh fit, same pool. ๐ฅ
Parameters
poolโ either the id of a pool, or a wholePool<#openstack.network.v2.pool.Pool> instance, your call bestie.attrsโ the attributes you wanna update on the pool thatpoolpoints at.
Returns โ the updated pool โจ
create_pool_member(pool, **attrs)
Create a brand-new pool member out of attributes, slay.
Parameters
poolโ the pool can be either the ID of a pool or aPool<#openstack.network.v2.pool.Pool> instance that the member is gonna be created in.attrsโ keyword arguments that get used to create aPoolMember<#openstack.network.v2.pool_member.PoolMember>, made up of the properties on thePoolMemberclass.
Returns โ the results of pool member creation ๐
delete_pool_member(pool_member, pool, ignore_missing=True)
Delete a pool member, bye bestie ๐
Parameters
pool_memberโ the member can be either the ID of a pool member or aPoolMember<#openstack.network.v2.pool_member.PoolMember> instance.poolโ the pool can be either the ID of a pool or aPool<#openstack.network.v2.pool.Pool> instance that the member belongs to.ignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the pool member doesn't exist. When it's set toTrue, no exception gets set when you try to delete a nonexistent pool member.
Returns โ None
find_pool_member(name_or_id, pool, ignore_missing=True, **query)
Find one single pool member, like a little scavenger hunt ๐
Parameters
name_or_idโ the name or ID of a pool member.poolโ the pool can be either the ID of a pool or aPool<#openstack.network.v2.pool.Pool> instance that the member belongs to.ignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the resource doesn't exist. When it's set toTrue,Nonegets returned when you try to find a nonexistent resource.queryโ any extra parameters to be passed into the underlying methods, like query filters, iykyk.
Returns โ one PoolMember <#openstack.network.v2.pool_member.PoolMember> or None
get_pool_member(pool_member, pool, *, fields=None)
Get a single pool member, periodt.
Parameters
pool_memberโ the member can be the ID of a pool member or aPoolMember<#openstack.network.v2.pool_member.PoolMember> instance.poolโ the pool can be either the ID of a pool or aPool<#openstack.network.v2.pool.Pool> instance that the member belongs to.fieldsโ limit the resource fields you fetch.
Returns โ one PoolMember <#openstack.network.v2.pool_member.PoolMember>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
pool_members(pool, **query)
Return a generator of pool members ๐
Parameters
poolโ the pool can be either the ID of a pool or aPool<#openstack.network.v2.pool.Pool> instance that the member belongs to.queryโ Optional query parameters to be sent to limit the resources being returned. Valid parameters are:address: the IP address of the pool member.is_admin_state_up: the administrative state of the pool member.name: name of the pool member.project_id: the ID of the project this pool member is associated with.protocol_port: the port on which the application is hosted.subnet_id: subnet ID in which to access this pool member.weight: a positive integer value that indicates the relative portion of traffic that this member should receive from the pool.
Returns โ a generator of pool member objects โจ
update_pool_member(pool_member, pool, **attrs)
Update a pool member, glow-up time ๐
Parameters
pool_memberโ either the ID of a pool member or aPoolMember<#openstack.network.v2.pool_member.PoolMember> instance.poolโ the pool can be either the ID of a pool or aPool<#openstack.network.v2.pool.Pool> instance that the member belongs to.attrsโ the attributes you wanna update on the pool member thatpool_memberpoints at.
Returns โ the updated pool member ๐
๐ฆ Auto Allocated Topology Operations ๐ฆ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_auto_allocated_topology(project=None)
Get the auto-allocated topology of a given project, iconic behavior ngl.
Parameters
projectโ the value is the ID or name of a project.
Returns โ the auto-allocated topology ๐
delete_auto_allocated_topology(project=None, ignore_missing=False)
Delete auto-allocated topology. Gone, bye ๐<
Parameters
projectโ the value is the ID or name of a project.ignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the topology doesn't exist. When it's set toTrue, no exception gets raised when you try to delete nonexistant topology.
Returns โ None
validate_auto_allocated_topology(project=None)
Validate the resources for auto allocation, a little vibe check basically โญ
Parameters
projectโ the value is the ID or name of a project.
Returns โ whether all resources are correctly configured or not
๐ธ Default Security Group Rules Operations ๐ธ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_default_security_group_rule(**attrs)
Create a new default security group rule from attributes, no cap ๐ง
Parameters
attrsโ keyword arguments that get used to create aDefaultSecurityGroupRule, made up of the properties on theDefaultSecurityGroupRuleclass.
Returns โ the results of default security group rule creation ๐
delete_default_security_group_rule(default_security_group_rule, ignore_missing=True)
Delete a default security group rule.
Parameters
default_security_group_ruleโ the value can be either the ID of a default security group rule or aDefaultSecurityGroupRuleinstance.ignore_missingโ when it's set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> gets raised when the defaul security group rule doesn't exist. When it's set toTrue, no exception gets set when you try to delete a nonexistent default security group rule.
Returns โ None
find_default_security_group_rule(name_or_id, ignore_missing=True, **query)
Find a single default security group rule ๐ซถ
Parameters
name_or_idโ the ID of a default security group rule.ignore_missingโ so when you set this toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised the moment the resource doesn't exist. But set it toTrueand you just getNoneback when you try to find something that isn't there. Soft launch, no drama ๐queryโ any extra params that get passed down into the underlying methods, like query filters and stuff.
Returns
One DefaultSecurityGroupRule or None
get_default_security_group_rule(default_security_group_rule, *, fields=None)
Get one single default security group rule ๐
Parameters
default_security_group_ruleโ the value can be the ID of a default security group rule, or a wholeDefaultSecurityGroupRuleinstance.fieldsโ limits which resource fields get fetched.
Returns
DefaultSecurityGroupRule
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
default_security_group_rules(**query)
Returns a generator of default security group rules โจ
Parameters
query โ
optional query params you send to limit the resources coming back. Available parameters include:
description: the default security group rule descriptiondirection: default security group rule directionether_type: must beIPv4orIPv6, and addresses represented in CIDR must match the ingress or egress rule.protocol: default security group rule protocolremote_group_id: ID of a remote security group
Returns
A generator of default security group rule objects DefaultSecurityGroupRule
๐ Security Group Operations
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_security_group(**attrs)
Creates a brand new security group out of attributes ๐ซถ
Parameters
attrs โ keyword arguments that'll be used to create a SecurityGroup <#openstack.network.v2.security_group.SecurityGroup>, made up of the properties on the SecurityGroup class.
Returns
The results of security group creation
delete_security_group(security_group, ignore_missing=True, if_revision=None)
Deletes a security group โ๏ธ
Parameters
security_groupโ the value can be either the ID of a security group or aSecurityGroup <#openstack.network.v2.security_group.SecurityGroup>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the security group doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent security group.if_revisionโ revision to put in theIf-Matchheader of the update request, to perform a compare-and-swap update.
Returns
None
find_security_group(name_or_id, ignore_missing=True, **query)
Finds one single security group ๐
Parameters
name_or_idโ the name or ID of a security group.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the resource doesn't exist. When set toTrue,Nonegets returned when attempting to find a nonexistent resource.queryโ any additional parameters passed into the underlying methods, such as query filters.
Returns
One SecurityGroup <#openstack.network.v2.security_group.SecurityGroup> or None
get_security_group(security_group, *, fields=None)
Gets one single security group, no cap ๐
Parameters
security_groupโ the value can be the ID of a security group or aSecurityGroup <#openstack.network.v2.security_group.SecurityGroup>instance.fieldsโ limit the resource fields to fetch.
Returns
One SecurityGroup <#openstack.network.v2.security_group.SecurityGroup>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
security_groups(**query)
Returns a generator of security groups ๐
Parameters
query โ
optional query parameters sent to limit the resources being returned. Valid parameters are:
description: security group descriptionรฌd: the id of a security group, or list of security group idsname: the name of a security groupproject_id: the ID of the project this security group is associated with.
Returns
A generator of security group objects
update_security_group(security_group, if_revision=None, **attrs)
Updates a security group ๐ธ
Parameters
security_groupโ either the id of a security group or aSecurityGroup <#openstack.network.v2.security_group.SecurityGroup>instance.if_revisionโ revision to put in theIf-Matchheader of the update request, to perform a compare-and-swap update.attrsโ the attributes to update on the security group represented bysecurity_group.
Returns
The updated security group
create_security_group_rule(**attrs)
Creates a new security group rule from attributes ๐
Parameters
attrs โ keyword arguments used to create a SecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule>, made up of the properties on the SecurityGroupRule class.
Returns
The results of security group rule creation
create_security_group_rules(data)
Creates a bunch of new security group rules from a list of attributes โจ
Parameters
data โ list of dicts of attributes used to create a SecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule>, made up of the properties on the SecurityGroupRule class.
Returns
A generator of security group rule objects
delete_security_group_rule(security_group_rule, ignore_missing=True, if_revision=None)
Deletes a security group rule ๐
Parameters
security_group_ruleโ the value can be either the ID of a security group rule or aSecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the security group rule doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent security group rule.if_revisionโ revision to put in theIf-Matchheader of the update request, to perform a compare-and-swap update.
Returns
None
find_security_group_rule(name_or_id, ignore_missing=True, **query)
Finds one single security group rule ๐
Parameters
name_or_idโ the ID of a security group rule.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the resource doesn't exist. When set toTrue,Nonegets returned when attempting to find a nonexistent resource.queryโ any additional parameters passed into the underlying methods, such as query filters.
Returns
One SecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule> or None
get_security_group_rule(security_group_rule, *, fields=None)
okay so this one grabs a single security group rule โ one rule, no extras, main-character energy ๐โจ
Parameters
security_group_ruleโ the value can be the ID of a security group rule or aSecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule>instance.fieldsโ limit the resource fields to fetch.
Returns โ SecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
security_group_rules(**query)
returns a generator of security group rules, like a little parade of them ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. Available parameters include:description: the security group rule descriptiondirection: security group rule directionether_type: must beIPv4orIPv6, and addresses represented in CIDR must match the ingress or egress rule.project_id: the ID of the project this security group rule is associated with.protocol: security group rule protocolremote_group_id: ID of a remote security groupsecurity_group_id: ID of security group that owns the rules
Returns โ a generator of security group rule objects SecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule>
๐ Address Group Operations ๐
same Proxy class, still serving network-resource looks ๐
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_address_group(**attrs)
creates a new address group from attributes โ building it from the ground up, slay ๐งฑโจ
Parameters
attrsโ keyword arguments which will be used to create aAddressGroup <#openstack.network.v2.address_group.AddressGroup>, comprised of the properties on theAddressGroupclass.
Returns โ the results of address group creation
delete_address_group(address_group, ignore_missing=True)
deletes an address group. bye bestie ๐๐
Parameters
address_groupโ the value can be either the ID of an address group or aAddressGroup <#openstack.network.v2.address_group.AddressGroup>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the address group does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent address group.
Returns โ None
find_address_group(name_or_id, ignore_missing=True, **query)
finds a single address group. lowkey a scavenger hunt ๐๐ฆ
Parameters
name_or_idโ the name or ID of an address group.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns โ one AddressGroup <#openstack.network.v2.address_group.AddressGroup> or None
get_address_group(address_group, *, fields=None)
gets a single address group, no cap ๐ซถ
Parameters
address_groupโ the value can be the ID of an address group or aAddressGroup <#openstack.network.v2.address_group.AddressGroup>instance.fieldsโ limit the resource fields to fetch.
Returns โ one AddressGroup <#openstack.network.v2.address_group.AddressGroup>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
address_groups(**query)
returns a generator of address groups โ a whole lil lineup ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.name: address group namedescription: address group descriptionproject_id: owner project ID
Returns โ a generator of address group objects
update_address_group(address_group, **attrs)
updates an address group. glow-up time โจ๐
Parameters
address_groupโ either the ID of an address group or aAddressGroup <#openstack.network.v2.address_group.AddressGroup>instance.attrsโ the attributes to update on the address group represented by value.
Returns โ the updated address group
add_addresses_to_address_group(address_group, addresses)
adds addresses to a address group โ more the merrier tbh ๐
Parameters
address_groupโ either the ID of an address group or aAddressGroup <#openstack.network.v2.address_group.AddressGroup>instance.addressesโ list of address strings.
Returns โ AddressGroup with updated addresses
remove_addresses_from_address_group(address_group, addresses)
removes addresses from a address group โ cleaning house, we love to see it ๐งน๐
Parameters
address_groupโ either the ID of an address group or aAddressGroup <#openstack.network.v2.address_group.AddressGroup>instance.addressesโ list of address strings.
Returns โ AddressGroup with updated addresses
๐ธ Availability Zone Operations ๐ธ
class openstack.network.v2._proxy.Proxy(...)
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
availability_zones(**query)
returns a generator of availability zones โ collecting them like friendship bracelets ๐ฆ
Parameters
queryโ optional query parameters to be set to limit the returned resources. Valid parameters include:name: the name of an availability zone.resource: the type of resource for the availability zone.
Returns โ a generator of availability zone objects AvailabilityZone <#openstack.network.v2.availability_zone.AvailabilityZone>
โญ Address Scope Operations โญ
same Proxy class, same long signature, still iconic ๐
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_address_scope(**attrs)
creates a new address scope from attributes โ fresh scope, fresh vibes ๐ฅ
Parameters
attrsโ keyword arguments which will be used to create aAddressScope <#openstack.network.v2.address_scope.AddressScope>, comprised of the properties on theAddressScopeclass.
Returns โ the results of address scope creation
delete_address_scope(address_scope, ignore_missing=True)
deletes an address scope โ say bye to the scope ๐ซถ
Parameters
address_scopeโ the value can be either the ID of an address scope or aAddressScope <#openstack.network.v2.address_scope.AddressScope>instance.ignore_missingโ when this isFalse, aNotFoundException(openstack.exceptions.NotFoundException) gets yeeted at you the second the address scope doesn't exist. When it'sTrue, no exception gets set when you're out here attempting to delete a nonexistent address scope. Chill behavior fr.
Returns โ None. That's it, that's the whole return.
find_address_scope(name_or_id, ignore_missing=True, **query)
Find a single address scope. One (1) scope, identified, located, done. โจ
Parameters
name_or_idโ the name or the ID of an address scope. Either one works, no cap.ignore_missingโ set it toFalseand aNotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. Set it toTrueand you just getNoneback when you go attempting to find a nonexistent resource. No drama, no stack trace.queryโ any additional parameters to be passed into underlying methods. such as query filters. ๐
Returns โ one AddressScope (openstack.network.v2.address_scope.AddressScope) or None.
get_address_scope(address_scope, *, fields=None)
Get a single address scope. The main character scope, retrieved. ๐
Parameters
address_scopeโ the value can be the ID of an address scope or anAddressScope(openstack.network.v2.address_scope.AddressScope) instance.fieldsโ limit the resource fields to fetch. So you're not dragging the entire personality of the resource along with you.
Returns โ one AddressScope (openstack.network.v2.address_scope.AddressScope).
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. ๐ญ
address_scopes(**query)
Return a generator of address scopes. Not a list, bestie โ a generator. It gives you scopes one at a time like a little snack dispenser. ๐
Parameters
query โ optional query parameters to be sent to limit the resources being returned:
name: Address scope nameip_version: Address scope IP address versionproject_id: Owner project IDshared: Address scope is shared (boolean)
Returns โ a generator of address scope objects.
update_address_scope(address_scope, **attrs)
Update an address scope. Glow-up time. ๐ฅ
Parameters
address_scopeโ either the ID of an address scope or anAddressScope(openstack.network.v2.address_scope.AddressScope) instance.attrsโ the attributes to update on the address scope represented by value.
Returns โ the updated address scope. Look at her now. ๐
๐ธ Quota Operations ๐ธ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Yes the signature is long long. That is the whole thing, character for character, do not come for me. ๐
delete_quota(quota, ignore_missing=True)
Delete a quota (i.e. reset to the default quota). It's not gone-gone, it's back to factory settings. ๐
Parameters
quotaโ the value can be either the ID of a quota or aQuota(openstack.network.v2.quota.Quota) instance. The ID of a quota is the same as the project ID for the quota. That's just how it is, iykyk.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when quota does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent quota.
Returns โ None.
get_quota(quota, details=False)
Get a quota. ๐
Parameters
quotaโ the value can be the ID of a quota or aQuota(openstack.network.v2.quota.Quota) instance. The ID of a quota is the same as the project ID for the quota.detailsโ if set toTrue, details about quota usage will be returned. Receipts! ๐
Returns โ one Quota (openstack.network.v2.quota.Quota).
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
get_quota_default(quota)
Get a default quota. The blueprint version. The "before anyone touched it" version. โจ
Parameters
quota โ the value can be the ID of a default quota or a QuotaDefault instance. The ID of a default quota is the same as the project ID for the default quota.
Returns โ one QuotaDefault.
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
quotas(**query)
Return a generator of quotas. Again: generator energy, not list energy. ๐ฆ
Parameters
query โ optional query parameters to be sent to limit the resources being returned. Currently no query parameter is supported. Yeah. Zero. None. Empty. ๐
Returns โ a generator of quota objects.
update_quota(quota, **attrs)
Update a quota. โจ
Parameters
quotaโ either the ID of a quota or aQuota(openstack.network.v2.quota.Quota) instance. The ID of a quota is the same as the project ID for the quota.attrsโ the attributes to update on the quota represented by quota.
Returns โ the updated quota.
๐ QoS Operations ๐
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Same absolute unit of a signature, second appearance. She's consistent. ๐
create_qos_bandwidth_limit_rule(qos_policy, **attrs)
Create a new bandwidth limit rule. New rule, freshly spawned, slay. ๐ฅ
Parameters
attrsโ keyword arguments which will be used to create aQoSBandwidthLimitRule(openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule), comprised of the properties on theQoSBandwidthLimitRuleclass.qos_policyโ the value can be the ID of the QoS policy that the rule belongs or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.
Returns โ the results of resource creation.
delete_qos_bandwidth_limit_rule(qos_rule, qos_policy, ignore_missing=True)
Delete a bandwidth limit rule. Bye bestie ๐
Parameters
qos_ruleโ the value can be either the ID of a bandwidth limit rule or aQoSBandwidthLimitRule(openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule) instance.qos_policyโ the value can be the ID of the QoS policy that the rule belongs or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent bandwidth limit rule. Graceful exit, we love to see it.
Returns โ None.
find_qos_bandwidth_limit_rule(qos_rule_id, qos_policy, ignore_missing=True, **query)
Find a bandwidth limit rule. Go find her. ๐
Parameters
qos_rule_idโ the ID of a bandwidth limit rule.qos_policyโ the value can be the ID of the QoS policy that the rule belongs or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. Vibes: gentle.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns โ one QoSBandwidthLimitRule (openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule) or None.
get_qos_bandwidth_limit_rule(qos_rule, qos_policy)
okay so this one grabs you one single bandwidth limit rule. just the one. your fave. โจ
Parameters
qos_ruleโ the value can be the ID of a minimum bandwidth rule or aQoSBandwidthLimitRuleinstance (openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule). either way works bestie ๐ซถqos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).
Returns
one QoSBandwidthLimitRule (openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule) ๐
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. like, it's just not there. ๐ญ
qos_bandwidth_limit_rules(qos_policy, **query)
return a generator of bandwidth limit rules โ not a list, a generator, the way that it lazily hands you rules one at a time is honestly iconic ๐ธ
Parameters
qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).queryโ optional query parameters to be sent to limit the resources being returned. use them to filter, queen ๐
Returns
a generator of bandwidth limit rule objects: QoSBandwidthLimitRule (openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule)
update_qos_bandwidth_limit_rule(qos_rule, qos_policy, **attrs)
update a bandwidth limit rule. glow-up time ๐
Parameters
qos_ruleโ either the id of a bandwidth limit rule or aQoSBandwidthLimitRuleinstance (openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule).qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).attrsโ the attributes to update on the bandwidth limit rule represented byqos_rule.
Returns
the updated minimum bandwidth rule. (yes, the original says minimum. not me inventing lore, that's literally what it says ๐ญ)
create_qos_dscp_marking_rule(qos_policy, **attrs)
create a shiny new QoS DSCP marking rule โจ
Parameters
attrsโ keyword arguments which will be used to create aQoSDSCPMarkingRule(openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule), comprised of the properties on theQosDscpMarkingRuleclass.qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).
Returns
the results of router creation. (again โ that's what the page says, fr fr. router. for a DSCP marking rule. we don't question the docs, we just report them ๐)
delete_qos_dscp_marking_rule(qos_rule, qos_policy, ignore_missing=True)
delete a QoS DSCP marking rule. bye bestie ๐
Parameters
qos_ruleโ the value can be either the ID of a minimum bandwidth rule or aQoSDSCPMarkingRuleinstance (openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule).qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. when set toTrue, no exception will be set when attempting to delete a nonexistent minimum bandwidth rule.
Returns
None
find_qos_dscp_marking_rule(qos_rule_id, qos_policy, ignore_missing=True, **query)
find a QoS DSCP marking rule ๐
Parameters
qos_rule_idโ the ID of a QoS DSCP marking rule.qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. when set toTrue,Nonewill be returned when attempting to find a nonexistent resource. so like, no drama. chill. ๐งqueryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns
one QoSDSCPMarkingRule (openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule) or None
get_qos_dscp_marking_rule(qos_rule, qos_policy)
get a single QoS DSCP marking rule ๐
Parameters
qos_ruleโ the value can be the ID of a minimum bandwidth rule or aQoSDSCPMarkingRuleinstance (openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule).qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).
Returns
one QoSDSCPMarkingRule (openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule)
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. truly tragic ๐
qos_dscp_marking_rules(qos_policy, **query)
return a generator of QoS DSCP marking rules ๐
Parameters
qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).queryโ optional query parameters to be sent to limit the resources being returned.
Returns
a generator of QoS DSCP marking rule objects: QoSDSCPMarkingRule (openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule)
update_qos_dscp_marking_rule(qos_rule, qos_policy, **attrs)
update a QoS DSCP marking rule โจ
Parameters
qos_ruleโ either the id of a minimum bandwidth rule or aQoSDSCPMarkingRuleinstance (openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule).qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).attrsโ the attributes to update on the QoS DSCP marking rule represented byqos_rule.
Returns
the updated QoS DSCP marking rule ๐
create_qos_minimum_bandwidth_rule(qos_policy, **attrs)
create a new minimum bandwidth rule. minimum queen energy ๐ (the bare minimum is still a vibe)
Parameters
attrsโ keyword arguments which will be used to create aQoSMinimumBandwidthRule(openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule), comprised of the properties on theQoSMinimumBandwidthRuleclass.qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).
Returns
the results of resource creation ๐ฅ
delete_qos_minimum_bandwidth_rule(qos_rule, qos_policy, ignore_missing=True)
delete a minimum bandwidth rule ๐ฆ
Parameters
qos_ruleโ the value can be either the ID of a minimum bandwidth rule or aQoSMinimumBandwidthRuleinstance (openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule).qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. when set toTrue, no exception will be set when attempting to delete a nonexistent minimum bandwidth rule.
Returns
None
find_qos_minimum_bandwidth_rule(qos_rule_id, qos_policy, ignore_missing=True, **query)
find a minimum bandwidth rule ๐
Parameters
qos_rule_idโ the ID of a minimum bandwidth rule.qos_policyโ the value can be the ID of the QoS policy that the rule belongs to, or aQoSPolicyinstance (openstack.network.v2.qos_policy.QoSPolicy).ignore_missingโ bestie, when this isFalse, aNotFoundException(openstack.exceptions.NotFoundException) gets raised the moment the resource doesn't exist. When it'sTrue, you just getNoneback when you try to find something that's not there. No drama ๐queryโ any extra parameters you wanna pass down into the underlying methods, like query filters. โจ
Returns
One QoSMinimumBandwidthRule (openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule) or None. ๐
get_qos_minimum_bandwidth_rule(qos_rule, qos_policy)
Get a single minimum bandwidth rule. One. Just the one. ๐ฆ
Parameters
qos_ruleโ can be the ID of a minimum bandwidth rule, or an actualQoSMinimumBandwidthRule(openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule) instance.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.
Returns
One QoSMinimumBandwidthRule (openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule). ๐
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. Like, it's literally not there, babe ๐ญ
qos_minimum_bandwidth_rules(qos_policy, **query)
Return a generator of minimum bandwidth rules. A whole generator, so many rules, we love a lazy iterator moment ๐
Parameters
qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.queryโ optional query parameters sent along to limit the resources being returned.
Returns
A generator of minimum bandwidth rule objects: QoSMinimumBandwidthRule (openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule). ๐ธ
update_qos_minimum_bandwidth_rule(qos_rule, qos_policy, **attrs)
Update a minimum bandwidth rule. Glow-up time โจ
Parameters
qos_ruleโ either the id of a minimum bandwidth rule, or aQoSMinimumBandwidthRule(openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule) instance.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.attrsโ the attributes to update on the minimum bandwidth rule represented byqos_rule.
Returns
The updated minimum bandwidth rule. Slay ๐
create_qos_minimum_packet_rate_rule(qos_policy, **attrs)
Create a new minimum packet rate rule. New rule, new me ๐ฆ
Parameters
attrsโ keyword arguments used to create aQoSMinimumPacketRateRule(openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule), comprised of the properties on theQoSMinimumPacketRateRuleclass.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.
Returns
The results of resource creation. ๐
delete_qos_minimum_packet_rate_rule(qos_rule, qos_policy, ignore_missing=True)
Delete a minimum packet rate rule. Bye bestie ๐
Parameters
qos_ruleโ can be either the ID of a minimum packet rate rule, or aQoSMinimumPacketRateRule(openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule) instance.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.ignore_missingโ when set toFalse, aNotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent minimum packet rate rule. Lowkey forgiving, and we respect that ๐
Returns
None. That's it. That's the whole return. ๐
find_qos_minimum_packet_rate_rule(qos_rule_id, qos_policy, ignore_missing=True, **query)
Find a minimum packet rate rule. Detective mode ๐
Parameters
qos_rule_idโ the ID of a minimum packet rate rule.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.ignore_missingโ when set toFalse, aNotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods, such as query filters.
Returns
One QoSMinimumPacketRateRule (openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule) or None. โจ
get_qos_minimum_packet_rate_rule(qos_rule, qos_policy)
Get a single minimum packet rate rule. Singular. One single icon ๐
Parameters
qos_ruleโ can be the ID of a minimum packet rate rule, or aQoSMinimumPacketRateRule(openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule) instance.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.
Returns
One QoSMinimumPacketRateRule (openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule). ๐
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. Fr fr, if it's gone it's gone ๐ญ
qos_minimum_packet_rate_rules(qos_policy, **query)
Return a generator of minimum packet rate rules. Generators are giving main character energy ngl ๐
Parameters
qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of minimum packet rate rule objects: QoSMinimumPacketRateRule (openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule). ๐ง
update_qos_minimum_packet_rate_rule(qos_rule, qos_policy, **attrs)
Update a minimum packet rate rule. A little refresh, a little self-care ๐
Parameters
qos_ruleโ either the id of a minimum packet rate rule, or aQoSMinimumPacketRateRule(openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule) instance.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.attrsโ the attributes to update on the minimum packet rate rule represented byqos_rule.
Returns
The updated minimum packet rate rule. Ate. ๐
create_qos_packet_rate_limit_rule(qos_policy, **attrs)
Create a new packet rate limit rule. Brand new rule just dropped ๐
Parameters
attrsโ keyword arguments which will be used to create aQoSPacketRateLimitRule(openstack.network.v2.qos_packet_rate_limit_rule.QoSPacketRateLimitRule), comprised of the properties on theQoSPacketRateLimitRuleclass.qos_policyโ can be the ID of the QoS policy that the rule belongs to, or aQoSPolicy(openstack.network.v2.qos_policy.QoSPolicy) instance.
Returns
The results of resource creation. ๐ฆ
delete_qos_packet_rate_limit_rule(qos_rule, qos_policy, ignore_missing=True)
Delete a packet rate limit rule. Sayonara โ๏ธ
Parameters
qos_ruleโ can be either the ID of a packet rate limit rule, or aQoSPacketRateLimitRule(openstack.network.v2.qos_packet_rate_limit_rule.QoSPacketRateLimitRule) instance.qos_policyโ bestie this one takes either the ID of the QoS policy that the rule belongs to, or an actualQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>instance, your call ๐ignore_missingโ okay so if you set this toFalse, aNotFoundException <#openstack.exceptions.NotFoundException>gets raised when the resource does not exist. Set it toTrueand no exception will be set when attempting to delete a nonexistent minimum packet rate rule. no drama, no crash ๐
Returns: None
๐ find_qos_packet_rate_limit_rule(qos_rule_id, qos_policy, ignore_missing=True, **query)
Find a packet rate limit rule โจ
Parameters
qos_rule_idโ The ID of a packet rate limit rule.qos_policyโ The value can be the ID of the QoS policy that the rule belongs or aQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ Any additional parameters to be passed into underlying methods. such as query filters.
Returns: One QoSPacketRateLimitRule <#openstack.network.v2.qos_packet_rate_limit_rule.QoSPacketRateLimitRule> or None
๐ฏ get_qos_packet_rate_limit_rule(qos_rule, qos_policy)
Get a single packet rate limit rule โ literally just the one, queen ๐
Parameters
qos_ruleโ The value can be the ID of a packet rate limit rule or aQoSPacketRateLimitRule <#openstack.network.v2.qos_packet_rate_limit_rule.QoSPacketRateLimitRule>instance.qos_policyโ The value can be the ID of the QoS policy that the rule belongs or aQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>instance.
Returns: One QoSPacketRateLimitRule <#openstack.network.v2.qos_packet_rate_limit_rule.QoSPacketRateLimitRule>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ she's not there, bestie.
๐ update_qos_packet_rate_limit_rule(qos_rule, qos_policy, **attrs)
Update a minimum packet rate rule โ glow-up time ๐ธ
Parameters
qos_ruleโ Either the id of a minimum packet rate rule or aQoSPacketRateLimitRule <#openstack.network.v2.qos_packet_rate_limit_rule.QoSPacketRateLimitRule>instance.qos_policyโ The value can be the ID of the QoS policy that the rule belongs or aQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>instance.attrsโ The attributes to update on the minimum packet rate rule represented byqos_rule.
Returns: The updated minimum packet rate rule
๐ซ create_qos_policy(**attrs)
Create a new QoS policy from attributes โ building her from scratch, iconic ๐
Parameters
attrsโ Keyword arguments which will be used to create aQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>, comprised of the properties on theQoSPolicyclass.
Returns: The results of QoS policy creation
๐๏ธ delete_qos_policy(qos_policy, ignore_missing=True)
Delete a QoS policy โ say bye bye ๐
Parameters
qos_policyโ The value can be either the ID of a QoS policy or aQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the QoS policy does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent QoS policy. (yes it really says "no exception will be set", we're quoting the vibes exactly, don't come for me ๐)
Returns: None
๐ต๏ธ find_qos_policy(name_or_id, ignore_missing=True, **query)
Find a single QoS policy โ detective mode fr fr ๐
Parameters
name_or_idโ The name or ID of a QoS policy.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ Any additional parameters to be passed into underlying methods. such as query filters.
Returns: One QoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy> or None
๐ฅ get_qos_policy(qos_policy, *, fields=None)
Get a single QoS policy ๐
Parameters
qos_policyโ The value can be the ID of a QoS policy or aQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>instance.fieldsโ Limit the resource fields to fetch.
Returns: One QoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ค
๐ qos_policies(**query)
Return a generator of QoS policies โ so many of them, a whole vibe ๐
Parameters
query โ
Optional query parameters to be sent to limit the resources being returned. Valid parameters are:
description: The description of a QoS policy.is_shared: Whether the policy is shared among projects.name: The name of a QoS policy.project_id: The ID of the project who owns the network.
Returns: A generator of QoS policy objects
โ๏ธ update_qos_policy(qos_policy, **attrs)
Update a QoS policy โ she's evolving ๐
Parameters
qos_policyโ Either the id of a QoS policy or aQoSPolicy <#openstack.network.v2.qos_policy.QoSPolicy>instance.attrsโ The attributes to update on the QoS policy represented byqos_policy.
Returns: The updated QoS policy
๐ง find_qos_rule_type(rule_type_name, ignore_missing=True)
Find a single QoS rule type details โ the lore on one rule type ๐ฆ
Parameters
rule_type_nameโ The name of a QoS rule type.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns: One QoSRuleType <#openstack.network.v2.qos_rule_type.QoSRuleType> or None
๐ get_qos_rule_type(qos_rule_type, *, fields=None)
Get details about single QoS rule type โญ
Parameters
qos_rule_typeโ The value can be the name of a QoS policy rule type or aQoSRuleType <#openstack.network.v2.qos_rule_type.QoSRuleType>instance.fieldsโ Limit the resource fields to fetch.
Returns: One QoSRuleType <#openstack.network.v2.qos_rule_type.QoSRuleType>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐
๐จ qos_rule_types(**query)
Return a generator of QoS rule types ๐
Parameters
query โ
Optional query parameters to be sent to limit the resources returned. Valid parameters include:
type: The type of the QoS rule type.
Returns: A generator of QoS rule type objects
๐ฐ๏ธ Agent Operations
okay so this next bit has a big ol' constructor signature and bestie I need you to just breathe โ you don't have to type this out, it's the proxy class showing you all its little settings ๐ซถ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ค agents(**query)
Return a generator of network agents โ all the little helpers, lowkey obsessed ๐
Parameters
query โ
Optional query parameters to be sent to limit the resources being returned.
agent_type: Agent type.availability_zone: The availability zone for an agent.binaryโ the name of the agent's application binary. like, the executable itself ๐ฅ๏ธdescriptionโ the description of the agent. the lil blurb bestie ๐hostโ the host (host name or host address) the agent is running on ๐topicโ the message queue topic used ๐จis_admin_state_upโ the administrative state of the agent ๐is_aliveโ whether the agent is alive. vibe check ๐
Returns: a generator of agents โจ
delete_agent(agent, ignore_missing=True)
Delete a network agent ๐๏ธ
Parameters:
agentโ the value can be the ID of a agent or aAgent <#openstack.network.v2.agent.Agent>instance.ignore_missingโ when set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the agent does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent agent. (yes, "no exception will be set" โ that's the original wording, don't come for me ๐ญ)
Returns: None
get_agent(agent, *, fields=None)
Get a single network agent ๐ต๏ธโโ๏ธ
Parameters:
agentโ the value can be the ID of a agent or aAgent <#openstack.network.v2.agent.Agent>instance.fieldsโ limit the resource fields to fetch. only grab what u asked for ๐
Returns: one Agent <#openstack.network.v2.agent.Agent>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ซ
update_agent(agent, **attrs)
Update a network agent ๐ง
Parameters:
agentโ the value can be the ID of a agent or aAgent <#openstack.network.v2.agent.Agent>instance.attrsโ the attributes to update on the agent represented by value.
Returns: one Agent <#openstack.network.v2.agent.Agent>
network_hosting_dhcp_agents(network, **query)
A generator of DHCP agents hosted on a network ๐
Parameters:
networkโ the instance ofNetwork <#openstack.network.v2.network.Network>queryโ optional query parameters to be sent to limit the resources returned.
Returns: a generator of hosted DHCP agents ๐
routers_hosting_l3_agents(router, **query)
Return a generator of L3 agent hosting a router ๐ฐ๏ธ
Parameters:
routerโ either the router id or an instance ofRouter <#openstack.network.v2.router.Router>queryโ optional query parameters to be sent to limit the resources returned
Returns: a generator of Router L3 Agents
agent_hosted_routers(agent, **query)
Return a generator of routers hosted by a L3 agent ๐ฅ
Parameters:
agentโ either the agent id of an instance of Agentqueryโ optional query parameters to be sent to limit the resources returned
Returns: a generator of routers
add_router_to_agent(agent, router, *, ha_chassis_priority=None)
Add router to L3 agent โ
Parameters:
agentโ either the id of an agentAgent <#openstack.network.v2.agent.Agent>instancerouterโ a router instanceha_chassis_priorityโ optional HA_Chassis priority, that could be[0, 32767].
Returns: Agent with attached router ๐ซถ
remove_router_from_agent(agent, router)
Remove router from L3 agent โ
Parameters:
agentโ either the id of an agent or anAgent <#openstack.network.v2.agent.Agent>instancerouterโ a router instance
Returns: Agent with removed router
๐ RBAC Operations ๐
Okay so this is the whole RBAC era of the network proxy, and yes the class signature is a MOOD, it's giving "we accept everything" energy:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_rbac_policy(**attrs)
Create a new RBAC policy from attributes โจ
Parameters:
attrsโ keyword arguments which will be used to create aRBACPolicy <#openstack.network.v2.rbac_policy.RBACPolicy>, comprised of the properties on theRBACPolicyclass.
Returns: the results of RBAC policy creation ๐
delete_rbac_policy(rbac_policy, ignore_missing=True)
Delete a RBAC policy ๐๏ธ
Parameters:
rbac_policyโ the value can be either the ID of a RBAC policy or aRBACPolicy <#openstack.network.v2.rbac_policy.RBACPolicy>instance.ignore_missingโ when set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the RBAC policy does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent RBAC policy.
Returns: None
find_rbac_policy(rbac_policy, ignore_missing=True, **query)
Find a single RBAC policy ๐
Parameters:
rbac_policyโ the ID of a RBAC policy.ignore_missingโ when set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. (so chill of it tbh)queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns: one RBACPolicy <#openstack.network.v2.rbac_policy.RBACPolicy> or None
get_rbac_policy(rbac_policy, *, fields=None)
Get a single RBAC policy ๐
Parameters:
rbac_policyโ the value can be the ID of a RBAC policy or aRBACPolicy <#openstack.network.v2.rbac_policy.RBACPolicy>instance.fieldsโ limit the resource fields to fetch.
Returns: one RBACPolicy <#openstack.network.v2.rbac_policy.RBACPolicy>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
rbac_policies(**query)
Return a generator of RBAC policies ๐
Parameters:
queryโ optional query parameters to be sent to limit the resources being returned. available parameters include:actionโ RBAC policy actionobject_typeโ type of the object that the RBAC policy affectstarget_project_idโ ID of the project that the RBAC policy affectsproject_idโ owner project ID
Returns: a generator of rbac objects
update_rbac_policy(rbac_policy, **attrs)
Update a RBAC policy ๐ง
Parameters:
rbac_policyโ either the id of a RBAC policy or aRBACPolicy <#openstack.network.v2.rbac_policy.RBACPolicy>instance.attrsโ the attributes to update on the RBAC policy represented byrbac_policy.
Returns: the updated RBAC policy โจ
๐ Listener Operations ๐
And here's the listener era โ same proxy, same giant signature, no we're not retyping it differently bestie, it's literally identical:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_listener(**attrs)
Create a new listener from attributes ๐ง
Parameters:
attrsโ keyword arguments which will be used to create aListener <#openstack.network.v2.listener.Listener>, comprised of the properties on theListenerclass.
Returns: the results of listener creation ๐ฆ
delete_listener(listener, ignore_missing=True)
Delete a listener ๐๏ธ
listenerโ bestie, this is either the ID of a listner or aListenerinstance (openstack.network.v2.listener.Listener), your call ๐ignore_missingโ set it toFalseandNotFoundException(openstack.exceptions.NotFoundException) gets thrown the moment the listner doesn't exist. Set it toTrueand nothing happens when you try to delete a listener that was never there. no drama, no exception ๐ซถ
Returns None
โจ find_listener(name_or_id, ignore_missing=True, **query) โจ
Find a single listener ๐
Parameters
name_or_idโ the name or ID of a listener. that's it, that's the whole vibe.ignore_missingโFalsemeansNotFoundException(openstack.exceptions.NotFoundException) goes off when the resource doesn't exist.Truemeans you just getNoneback when you go looking for a resource that isn't there. gentle rejection, honestly ๐queryโ any extra params you wanna pass down into the underlying methods. like query filters and stuff โจ
Returns One Listener (openstack.network.v2.listener.Listener) or None
๐ธ get_listener(listener) ๐ธ
Get a single listener, just the one, main character energy ๐
Parameters listener โ the value can be the ID of a listener or a Listener (openstack.network.v2.listener.Listener) instance.
Returns One Listener (openstack.network.v2.listener.Listener)
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found. like, it's simply not there bestie ๐ญ
๐ฆ listeners(**query) ๐ฆ
Return a generator of listeners โ a whole lil stream of them, iconic ๐
Parameters query โ
Optional query parameters you send to limit the resources being returned. Valid parameters are:
connection_limit: The maximum number of connections permitted for the load-balancer.default_pool_id: The ID of the default pool.default_tls_container_ref: A reference to a container of TLS secret.description: The description of a listener.is_admin_state_up: The administrative state of the listener.name: The name of a listener.project_id: The ID of the project associated with a listener.protocol: The protocol of the listener.protocol_port: Port the listener will listen to.
Returns A generator of listener objects
๐ update_listener(listener, **attrs) ๐
Update a listener. glow-up time โจ
Parameters
listenerโ either the id of a listener or aListener(openstack.network.v2.listener.Listener) instance.attrsโ the attributes to update on the listener represented bylistener.
Returns The updated listener
๐ Subnet Operations ๐
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
โญ create_subnet(**attrs) โญ
Create a new subnet from attributes. brand new subnet, freshly served ๐
Parameters attrs โ keyword arguments which will be used to create a Subnet (openstack.network.v2.subnet.Subnet), comprised of the properties on the Subnet class.
Returns The results of subnet creation
๐ delete_subnet(subnet, ignore_missing=True, if_revision=None) ๐
Delete a subnet. bye bestie ๐
Parameters
subnetโ the value can be either the ID of a subnet or aSubnet(openstack.network.v2.subnet.Subnet) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the subnet does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent subnet. so chill.if_revisionโ revision to put inIf-Matchheader of update request to perform compare-and-swap update.
Returns None
๐ฅ find_subnet(name_or_id, ignore_missing=True, **query) ๐ฅ
Find a single subnet
Parameters
name_or_idโ the name or ID of a subnet.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns One Subnet (openstack.network.v2.subnet.Subnet) or None
๐ง get_subnet(subnet, *, fields=None) ๐ง
Get a single subnet
Parameters
subnetโ the value can be the ID of a subnet or aSubnet(openstack.network.v2.subnet.Subnet) instance.fieldsโ limit the resource fields to fetch. picky, and honestly? valid ๐
Returns One Subnet (openstack.network.v2.subnet.Subnet)
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
๐ subnets(**query) ๐
Return a generator of subnets
Parameters query โ
Optional query parameters to be sent to limit the resources being returned. Available parameters include:
cidr: Subnet CIDRdescription: The subnet descriptiongateway_ip: Subnet gateway IP addressip_version: Subnet IP address versionipv6_address_mode: The IPv6 address modeipv6_ra_mode: The IPv6 router advertisement modeis_dhcp_enabled: Subnet has DHCP enabled (boolean)name: Subnet namenetwork_id: ID of network that owns the subnetsproject_id: Owner project IDsubnet_pool_id: The subnet pool ID from which to obtain a CIDR.
Returns A generator of subnet objects
๐ update_subnet(subnet, if_revision=None, **attrs) ๐
Update a subnet
Parameters
subnetโ either the id of a subnet or aSubnet(openstack.network.v2.subnet.Subnet) instance.if_revisionโ revision to put inIf-Matchheader of update request to perform compare-and-swap update.attrsโ the attributes to update on the subnet represented bysubnet.
Returns The updated subnet
๐ create_subnet_pool(**attrs) ๐
Create a new subnet pool from attributes
Parameters attrs โ keyword arguments which will be used to create a SubnetPool (openstack.network.v2.subnet_pool.SubnetPool), comprised of the properties on the SubnetPool class.
Returns The results of subnet pool creation
๐ฆ delete_subnet_pool(subnet_pool, ignore_missing=True) ๐ฆ
Delete a subnet pool
Parameters
subnet_poolโ the value can be either the ID of a subnet pool or aSubnetPool(openstack.network.v2.subnet_pool.SubnetPool) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the subnet pool does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent subnet pool.
Returns None
๐ธ find_subnet_pool(name_or_id, ignore_missing=True, **query) ๐ธ
Find a single subnet pool
Parameters
name_or_idโ the name or ID of a subnet pool.ignore_missingโ when itโs set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>gets raised if the resource doesnโt exist. When itโsTrue, you just getNoneback when the thing youโre looking for isnโt there. chill find behavior, no cap โจqueryโ any extra parameters passed into the underlying methods. such as query filters. iykyk ๐ซถ
Returns: One SubnetPool <#openstack.network.v2.subnet_pool.SubnetPool> or None
๐ธ get_subnet_pool(subnet_pool, *, fields=None)
Get a single subnet pool. one pool, coming right up ๐
Parameters:
subnet_poolโ the value can be the ID of a subnet pool or aSubnetPool <#openstack.network.v2.subnet_pool.SubnetPool>instance.fieldsโ limit the resource fields to fetch.
Returns: One SubnetPool <#openstack.network.v2.subnet_pool.SubnetPool>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. so if itโs not there, it will absolutely let you know ๐ญ
๐ฆ subnet_pools(**query)
Return a generator of subnet pools. generator girlie behavior ๐
Parameters:
queryโ optional query parameters to be sent to limit the resources being returned. Available parameters include:address_scope_id: Subnet pool address scope IDdescription: The subnet pool descriptionip_version: The IP address familyis_default: Subnet pool is the default (boolean)is_shared: Subnet pool is shared (boolean)name: Subnet pool nameproject_id: Owner project ID
Returns: A generator of subnet pool objects
๐ update_subnet_pool(subnet_pool, **attrs)
Update a subnet pool. glow-up time โจ
Parameters:
subnet_poolโ either the ID of a subnet pool or aSubnetPool <#openstack.network.v2.subnet_pool.SubnetPool>instance.attrsโ the attributes to update on the subnet pool represented bysubnet_pool.
Returns: The updated subnet pool
๐ Load Balancer Operations ๐
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ create_load_balancer(**attrs)
Create a new load balancer from attributes. main character resource creation ๐
Parameters:
attrsโ keyword arguments which will be used to create aLoadBalancer <#openstack.network.v2.load_balancer.LoadBalancer>, comprised of the properties on theLoadBalancerclass.
Returns: The results of load balancer creation
๐ delete_load_balancer(load_balancer, ignore_missing=True)
Delete a load balancer. bye bestie ๐ซถ
Parameters:
load_balancerโ the value can be the ID of a load balancer or aLoadBalancer <#openstack.network.v2.load_balancer.LoadBalancer>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the load balancer does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent load balancer.
Returns: None
โญ find_load_balancer(name_or_id, ignore_missing=True, **query)
Find a single load balancer. scavenger hunt but make it cloud ๐ฅ
Parameters:
name_or_idโ the name or ID of a load balancer.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns: One LoadBalancer <#openstack.network.v2.load_balancer.LoadBalancer> or None
๐ get_load_balancer(load_balancer)
Get a single load balancer. just the one, iconic ๐ฆ
Parameters:
load_balancerโ the value can be the ID of a load balancer or aLoadBalancer <#openstack.network.v2.load_balancer.LoadBalancer>instance.
Returns: One LoadBalancer <#openstack.network.v2.load_balancer.LoadBalancer>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. no resource, no vibes ๐
๐ธ load_balancers(**query)
Return a generator of load balancers. a whole little lineup โจ
Parameters:
queryโ optional query parameters to be sent to limit the resources being returned.
Returns: A generator of load balancer objects
๐ update_load_balancer(load_balancer, **attrs)
Update a load balancer. little refresh, little slay ๐
Parameters:
load_balancerโ either the id of a load balancer or aLoadBalancer <#openstack.network.v2.load_balancer.LoadBalancer>instance.attrsโ the attributes to update on the load balancer represented byload_balancer.
Returns: The updated load balancer
๐ธ Health Monitor Operations ๐ธ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
๐ซถ create_health_monitor(**attrs)
Create a new health monitor from attributes. keeping an eye on things, respectfully ๐
Parameters:
attrsโ keyword arguments which will be used to create aHealthMonitor <#openstack.network.v2.health_monitor.HealthMonitor>, comprised of the properties on theHealthMonitorclass.
Returns: The results of health monitor creation
๐ฆ delete_health_monitor(health_monitor, ignore_missing=True)
Delete a health monitor. removing the watcher, dramatic but valid ๐ญ
Parameters:
health_monitorโ the value can be either the ID of a health monitor or aHealthMonitor <#openstack.network.v2.health_monitor.HealthMonitor>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the health monitor does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent health monitor.
Returns: None
๐ find_health_monitor(name_or_id, ignore_missing=True, **query)
Find a single health monitor. finding your fave monitor ๐
Parameters:
name_or_idโ the name or ID of a health monitor.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns: One HealthMonitor <#openstack.network.v2.health_monitor.HealthMonitor> or None
๐ get_health_monitor(health_monitor)
Get a single health monitor. one monitor, fully fetched โจ
Parameters:
health_monitorโ the value can be the ID of a health monitor or aHealthMonitor <#openstack.network.v2.health_monitor.HealthMonitor>instance.
Returns: One HealthMonitor <#openstack.network.v2.health_monitor.HealthMonitor>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. if itโs missing, itโs missing ๐
โญ health_monitors(**query)
Return a generator of health monitors. monitor generator era ๐
Parameters:
queryโ
Optional query parameters to be sent to limit the resources being returned, bestie โ valid ones are:
delayโ the time in milliseconds between sending probes. โฑ๏ธexpected_codesโ the expected HTTP codes for a pssing HTTP(S) monitor. ๐http_methodโ the HTTP method a monitor uses for requests.is_admin_state_upโ the administrative state of a health monitor.max_retriesโ the maximum consecutive health probe attempts.project_idโ the ID of the project this health monitor is associated with.timeoutโ the maximum number of milliseconds for a monitor to wait for a connection to be established before it times out.typeโ the type of probe sent by the load balancer for health check, which can bePING,TCP,HTTPorHTTPS.url_pathโ the path portion of a URI that will be probed.
Returns โ a generator of health monitor objects. โจ
update_health_monitor(health_monitor, **attrs)
Update a health monitor. ๐ซถ
Parameters
health_monitorโ either the id of a health monitor or aHealthMonitor <#openstack.network.v2.health_monitor.HealthMonitor>instance.attrsโ the attributes to update on the health monitor represented by value.
Returns โ the updated health monitor. ๐
๐ Metering Label Operations ๐
Okay so this is the proxy class signature, and it is long โ do not panic, just copy/paste energy:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_metering_label(**attrs)
Create a new metering label from attributes. ๐
Parameters
attrsโ keyword arguments which will be used to create aMeteringLabel <#openstack.network.v2.metering_label.MeteringLabel>, comprised of the properties on theMeteringLabelclass.
Returns โ the results of metering label creation. ๐ธ
delete_metering_label(metering_label, ignore_missing=True)
Delete a metering label. ๐ซถ
Parameters
metering_labelโ the value can be either the ID of a metering label or aMeteringLabel <#openstack.network.v2.metering_label.MeteringLabel>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the metering label does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent metering label. ๐ญ
Returns โ None.
find_metering_label(name_or_id, ignore_missing=True, **query)
Find a single metering label. ๐
Parameters
name_or_idโ the name or ID of a metering label.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns โ one MeteringLabel <#openstack.network.v2.metering_label.MeteringLabel> or None. ๐
get_metering_label(metering_label, *, fields=None)
Get a single metering label. โจ
Parameters
metering_labelโ the value can be the ID of a metering label or aMeteringLabel <#openstack.network.v2.metering_label.MeteringLabel>instance.fieldsโ limit the resource fields to fetch.
Returns โ one MeteringLabel <#openstack.network.v2.metering_label.MeteringLabel>. ๐
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
metering_labels(**query)
Return a generator of metering labels. ๐ฆ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. Valid parameters are:descriptionโ description of a metering label.nameโ name of a metering label.is_sharedโ boolean indicating whether a metering label is shared.project_idโ the ID of the project a metering label is associated with.
Returns โ a generator of metering label objects. โญ
update_metering_label(metering_label, **attrs)
Update a metering label. ๐
Parameters
metering_labelโ either the id of a metering label or aMeteringLabel <#openstack.network.v2.metering_label.MeteringLabel>instance.attrsโ the attributes to update on the metering label represented bymetering_label.
Returns โ the updated metering label. ๐
create_metering_label_rule(**attrs)
Create a new metering label rule from attributes. ๐
Parameters
attrsโ keyword arguments which will be used to create aMeteringLabelRule <#openstack.network.v2.metering_label_rule.MeteringLabelRule>, comprised of the properties on theMeteringLabelRuleclass.
Returns โ the results of metering label rule creation. ๐ธ
delete_metering_label_rule(metering_label_rule, ignore_missing=True)
Delete a metering label rule. ๐ซถ
Parameters
metering_label_ruleโ the value can be either the ID of a metering label rule or aMeteringLabelRule <#openstack.network.v2.metering_label_rule.MeteringLabelRule>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the metering label rule does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent metering label rule. ๐ญ
Returns โ None.
find_metering_label_rule(name_or_id, ignore_missing=True, **query)
Find a single metering label rule. ๐
Parameters
name_or_idโ the name or ID of a metering label rule.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns โ one MeteringLabelRule <#openstack.network.v2.metering_label_rule.MeteringLabelRule> or None. ๐
get_metering_label_rule(metering_label_rule, *, fields=None)
Get a single metering label rule. โจ
Parameters
metering_label_ruleโ the value can be the ID of a metering label rule or aMeteringLabelRule <#openstack.network.v2.metering_label_rule.MeteringLabelRule>instance.fieldsโ limit the resource fields to fetch.
Returns โ one MeteringLabelRule <#openstack.network.v2.metering_label_rule.MeteringLabelRule>. ๐
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
metering_label_rules(**query)
Return a generator of metering label rules. ๐ฆ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. Valid parameters are:directionโ the direction in which metering label rule is applied.metering_label_idโ the ID of a metering label this rule is associated with.project_idโ the ID of the project the metering label rule is associated with.
๐ Segment Operations ๐
Bestie, we're in segment territory now, and the proxy class is the exact same absolute unit as before โ like, literally identical signature, no cap, so imma paste it verbatim because I refuse to let a single character slip:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Okay so the segment methods themselves are these cuties ๐
create_segment(**attrs)
Make a brand new segment out of attributes. Manifesting a segment rn โจ
Parameters
- attrs โ keyword arguments that get used to create a
Segment <#openstack.network.v2.segment.Segment>, all made up of the properties on theSegmentclass.
Returns
The results of segment creation ๐ฑ
delete_segment(segment, ignore_missing=True)
Yeet a segment. Bye bestie ๐
Parameters
- segment โ the value can be either the ID of a segment or a
Segment <#openstack.network.v2.segment.Segment>instance. - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the segment does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent segment.
Returns
None (the void, the emptiness, the peace ๐ซถ)
find_segment(name_or_id, ignore_missing=True, **query)
Find one single segment. Detective mode activated ๐
Parameters
- name_or_id โ the name or ID of a segment.
- ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. - query โ any additional parameters to be passed into underlying methods. such as query filters.
Returns
One Segment <#openstack.network.v2.segment.Segment> or None
get_segment(segment, *, fields=None)
Grab a single segment โ like, just the one, very demure ๐
Parameters
- segment โ the value can be the ID of a segment or a
Segment <#openstack.network.v2.segment.Segment>instance. - fields โ limit the resource fields to fetch.
Returns
One Segment <#openstack.network.v2.segment.Segment>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
segments(**query)
Return a generator of segments โ an infinite scroll but make it networking ๐
Parameters
query โ
Optional query parameters to be sent to limit the resources being returned. Available parameters include:
- description: the segment description
- name: name of the segments
- network_id: ID of the network that owns the segments
- network_type: network type for the segments
- physical_network: physical network name for the segments
- segmentation_id: segmentation ID for the segments
Returns
A generator of segment objects
update_segment(segment, **attrs)
Update a segment. Glow-up arc, but for data ๐ฆ
Parameters
- segment โ either the id of a segment or a
Segment <#openstack.network.v2.segment.Segment>instance. - attrs โ the attributes to update on the segment represented by segment.
Returns
The update segment (that's the original wording, do not @ me ๐)
๐ Flavor Operations ๐
And now for flavors โ no, not the eating kind, bestie, these are network service flavors. The proxy signature? Same iconic specimen, same energy:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_flavor(**attrs)
Create a new network service flavor from attributes. Chef's kiss ๐จโ๐ณ๐
Parameters
- attrs โ keyword arguments which will be used to create a
Flavor <#openstack.network.v2.flavor.Flavor>, comprised of the properties on theFlavorclass.
Returns
The results of flavor creation โจ
delete_flavor(flavor, ignore_missing=True)
Delete a network service flavor. It's giving departure ๐
Parameters
- flavor โ the value can be either the ID of a flavor or a
Flavor <#openstack.network.v2.flavor.Flavor>instance. - ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the flavor does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent flavor.
Returns
None
find_flavor(name_or_id, ignore_missing=True, **query)
Find a single network service flavor. Highkey a scavenger hunt ๐ต๏ธโโ๏ธ
Parameters
- name_or_id โ the name or ID of a flavor.
- ignore_missing โ when set to
False,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. - query โ any additional parameters to be passed into underlying methods. such as query filters.
Returns
One Flavor <#openstack.network.v2.flavor.Flavor> or None
get_flavor(flavor, *, fields=None)
Get a single network service flavor. Just the one, thank you ๐
Parameters
- flavor โ the value can be the ID of a flavor or a
Flavor <#openstack.network.v2.flavor.Flavor>instance. - fields โ limit the resource fields to fetch.
Returns
One Flavor <#openstack.network.v2.flavor.Flavor>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐
update_flavor(flavor, **attrs)
Update a network service flavor โ transformation era ๐ฅ
Parameters
- flavor โ either the id of a flavor or a
Flavor <#openstack.network.v2.flavor.Flavor>instance. - attrs โ the attributes to update on the flavor represented by flavor.
Returns
The updated flavor
flavors(**query)
Return a generator of network service flavors. Collect them all, Pokรฉmon style ๐
Parameters
query โ
Optional query parameters to be sent to limit the resources being returned. Valid parameters include:
- description: the description of a flavor.
- is_enabled: whether a flavor is enabled.
- name: the name of a flavor.
- service_type: the service type to which a falvor applies.
Okay so that last one says falvor in the source and I am keeping it, typo and all, because the docs said it and I don't make the rules. We love a quirky original ๐๐
Returns
A generator of flavor objects
๐ Service Profile Operations
okay so this chunk is all about service flavor profiles โ the matchmaking between flavors and service profiles, basically. The constructor is the same big Proxy signature every time, so here it is exactly:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
associate_flavor_with_service_profile(flavor, service_profile)
Associate network flavor with service profile. Bestie, this is the โtheyโre together nowโ method. โจ
Parameters
flavorโ Either the id of a flavor or aFlavor <#openstack.network.v2.flavor.Flavor>instance.service_profileโ The value can be either the ID of a service profile or aServiceProfile <#openstack.network.v2.service_profile.ServiceProfile>instance.
Returns โ
disassociate_flavor_from_service_profile(flavor, service_profile)
Disassociate network flavor from service profile. The โwe need to talkโ method, lowkey. ๐
Parameters
flavorโ Either the id of a flavor or aFlavor <#openstack.network.v2.flavor.Flavor>instance.service_profileโ The value can be either the ID of a service profile or aServiceProfile <#openstack.network.v2.service_profile.ServiceProfile>instance.
Returns โ
create_service_profile(**attrs)
Create a new network service flavor profile from attributes. Itโs giving โmake a whole new profile from vibes and kwargs.โ ๐
Parameters
attrsโ Keyword arguments which will be used to create aServiceProfile <#openstack.network.v2.service_profile.ServiceProfile>, comprised of the properties on theServiceProfileclass.
Returns โ The results of service profile creation
delete_service_profile(service_profile, ignore_missing=True)
Delete a network service flavor profile. Poof, gone, no cap. ๐ซง
Parameters
service_profileโ The value can be either the ID of a service profile or aServiceProfile <#openstack.network.v2.service_profile.ServiceProfile>instance.ignore_missingโ When set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the service profile does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent service profile.
Returns โ None
find_service_profile(name_or_id, ignore_missing=True, **query)
Find a single network service flavor profile. Detective mode: on. ๐
Parameters
name_or_idโ The name or ID of a service profile.ignore_missingโ When set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ Any additional parameters to be passed into underlying methods. such as query filters.
Returns โ One ServiceProfile <#openstack.network.v2.service_profile.ServiceProfile> or None
get_service_profile(service_profile, *, fields=None)
Get a single network service flavor profile. This one pulls up the whole profile card. ๐
Parameters
service_profileโ The value can be the ID of aservice_profileor aServiceProfile <#openstack.network.v2.service_profile.ServiceProfile>instance.fieldsโ Limit the resource fields to fetch.
Returns โ One ServiceProfile <#openstack.network.v2.service_profile.ServiceProfile>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
service_profiles(**query)
Return a generator of network service flavor profiles. Itโs a whole scrollable feed of service profiles, fr fr. ๐ธ
Parameters
queryโ Optional query parameters to be sent to limit the resources returned. Available parameters inclue:description: The description of the service flavor profiledriver: Provider driver for the service flavor profileis_enabled: Whether the profile is enabledproject_id: The owner project ID
Returns โ A generator of service profile objects
update_service_profile(service_profile, **attrs)
Update a network flavor service profile. Glow-up time. โจ
Parameters
service_profileโ Either the id of a service profile or aServiceProfile <#openstack.network.v2.service_profile.ServiceProfile>instance.attrsโ The attributes to update on the service profile represented byservice_profile.
Returns โ The updated service profile
๐ท๏ธ Tag Operations
Same Proxy constructor, same exact signature. Weโre not retyping it in a different font, bestie โ here it is:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
set_tags(resource, tags)
Replace tags of a specified resource with specified tags. Out with the old tag vibes, in with the new. ๐
Parameters
resourceโResource <#openstack.resource.Resource>instance.tags("list") โ New tags to be set.
Returns โ The updated resource
๐ฆ VPNaaS Operations
Another Proxy constructor moment, same exact parameters. Iconic copy-paste behavior, honestly:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_vpn_endpoint_group(**attrs)
Create a new vpn endpoint group from attributes. New group, new VPN era. ๐ฅ
Parameters
attrsโ Keyword arguments which will be used to create aVpnEndpointGroup <#openstack.network.v2.vpn_endpoint_group.VpnEndpointGroup>, comprised of the properties on theVpnEndpointGroupclass.
Returns โ The results of vpn endpoint group creation.
delete_vpn_endpoint_group(vpn_endpoint_group, ignore_missing=True)
Delete a vpn service. (Yes, thatโs the wording, bestie โ keep it exactly as it is. ๐)
Parameters
vpn_endpoint_groupโ The value can be either the ID of a vpn service or aVpnEndpointGroup <#openstack.network.v2.vpn_endpoint_group.VpnEndpointGroup>instance.ignore_missingโ When set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the vpn service does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent vpn service.
Returns โ None
find_vpn_endpoint_group(name_or_id, ignore_missing=True, **query)
Find a single vpn service. Searching high and low. ๐
Parameters
name_or_idโ The name or ID of a vpn service.ignore_missingโ When set toFalseNotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ Any additional parameters to be passed into underlying methods. such as query filters.
Returns โ One VpnEndpointGroup <#openstack.network.v2.vpn_endpoint_group.VpnEndpointGroup> or None
get_vpn_endpoint_group(vpn_endpoint_group, *, fields=None)
Get a single vpn service. Pulling up the endpoint groupโs whole profile. ๐
Parameters
vpn_endpoint_groupโ The value can be the ID of a vpn service or aVpnEndpointGroup <#openstack.network.v2.vpn_endpoint_group.VpnEndpointGroup>instance.fieldsโ limits which resource fields get fetched โจ (yes, this is the tail of the previous one, we're rolling straight in, no awkward pause ๐ซถ)
๐ธ vpn_endpoint_groups(**query)
Returns a generator of vpn services, bestie โ a whole stream of them, one at a time ๐ซ
Parameters
queryโ optional query parameters that get sent along to limit the resources being returned.
Returns
A generator of vpn service objects โ VpnEndpointGroup (openstack.network.v2.vpn_endpoint_group.VpnEndpointGroup) ๐
๐ฆ update_vpn_endpoint_group(vpn_endpoint_group, **attrs)
Updates a vpn service. Glow-up time ๐
Parameters
vpn_endpoint_groupโ either the id of a vpn service or aVpnEndpointGroup(openstack.network.v2.vpn_endpoint_group.VpnEndpointGroup) instance.attrsโ the attributes to update on the VPN service represented by vpn_endpoint_group.
Returns
The updated vpnservice โจ
๐ create_vpn_ipsec_site_connection(**attrs)
Creates a brand new IPsec site connection from attributes. New connection just dropped ๐ฅ
Parameters
attrsโ keyword arguments which will be used to create aVpnIPSecSiteConnection(openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection), comprised of the properties on theIPSecSiteConnectionclass.
Returns
The results of IPsec site connection creation ๐
๐ find_vpn_ipsec_site_connection(name_or_id, ignore_missing=True, **query)
Finds a single IPsec site connection. Scavenger hunt but make it cloud โ๏ธ
Parameters
name_or_idโ the name or ID of an IPsec site connection.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. (Default isTrue, iykyk ๐ซ)queryโ any additional parameters to be passed into underlying methods such as query filters.
Returns
One VpnIPSecSiteConnection (openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection) or None
๐ง get_vpn_ipsec_site_connection(ipsec_site_connection, *, fields=None)
Gets a single IPsec site connection. Just the one, thanks ๐ซถ
Parameters
ipsec_site_connectionโ the value can be the ID of an IPsec site connection or aVpnIPSecSiteConnection(openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection) instance.fieldsโ limit the resource fields to fetch.
Returns
One VpnIPSecSiteConnection (openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection)
Raises
NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found ๐ญ
๐ vpn_ipsec_site_connections(**query)
Returns a generator of IPsec site connections โ the whole squad, delivered lazily ๐ซ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of IPsec site connection objects โ VpnIPSecSiteConnection (openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection)
๐ฅ update_vpn_ipsec_site_connection(ipsec_site_connection, **attrs)
Updates a IPsec site connection. It's giving main character energy โจ
ipsec_site_connection
Either the id of an IPsec site connection or a VpnIPSecSiteConnection (openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection) instance.
Parameters
attrsโ the attributes to update on the IPsec site connection represented by ipsec_site_connection.
Returns
The updated IPsec site connection ๐
๐ delete_vpn_ipsec_site_connection(ipsec_site_connection, ignore_missing=True)
Deletes a IPsec site connection. Gone, gone, gone ๐ซก
Parameters
ipsec_site_connectionโ the value can be either the ID of an IPsec site connection, or aVpnIPSecSiteConnection(openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the IPsec site connection does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent IPsec site connection.
Returns
None
๐ create_vpn_ike_policy(**attrs)
Creates a new ike policy from attributes. Fresh policy, fresh vibes ๐
Parameters
attrsโ keyword arguments which will be used to create aVpnIkePolicy(openstack.network.v2.vpn_ike_policy.VpnIkePolicy), comprised of the properties on theVpnIkePolicyclass.
Returns
The results of ike policy creation โจ
๐ธ find_vpn_ike_policy(name_or_id, ignore_missing=True, **query)
Finds a single ike policy. Detective era ๐ต๏ธโโ๏ธ
Parameters
name_or_idโ the name or ID of an IKE policy.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods such as query filters.
Returns
One VpnIkePolicy (openstack.network.v2.vpn_ike_policy.VpnIkePolicy) or None.
๐ฆ get_vpn_ike_policy(ike_policy, *, fields=None)
Gets a single ike policy. One (1) policy, served fresh ๐
Parameters
ike_policyโ the value can be the ID of an IKE policy or aVpnIkePolicy(openstack.network.v2.vpn_ike_policy.VpnIkePolicy) instance.fieldsโ limit the resource fields to fetch.
Returns
One VpnIkePolicy (openstack.network.v2.vpn_ike_policy.VpnIkePolicy)
Raises
NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found ๐ญ
โญ vpn_ike_policies(**query)
Returns a generator of IKE policies โ plural, plentiful, powerful ๐ซ
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of ike policy objects
๐ update_vpn_ike_policy(ike_policy, **attrs)
Updates an IKE policy. She's evolving ๐
ike_policy
Either the ID of an IKE policy or a VpnIkePolicy (openstack.network.v2.vpn_ike_policy.VpnIkePolicy) instance.
Parameters
attrsโ the attributes to update on the ike policy represented by ike_policy.
Returns
The updated ike policy โจ
๐ delete_vpn_ike_policy(ike_policy, ignore_missing=True)
Deletes an IKE policy. Byeee, no notes ๐ซถ
Parameters
ike_policyโ the value can be either the ID of an ike policy, or aVpnIkePolicy(openstack.network.v2.vpn_ike_policy.VpnIkePolicy) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the ike policy does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent ike policy.
Returns
None
๐ง create_vpn_ipsec_policy(**attrs)
Creates a new IPsec policy from attributes. Building it from scratch, obsessed ๐จ
Parameters
attrsโ keyword arguments which will be used to create aVpnIpsecPolicy(openstack.network.v2.vpn_ipsec_policy.VpnIpsecPolicy), comprised of the properties on theVpnIpsecPolicyclass.
Returns
The results of IPsec policy creation ๐
๐ซ find_vpn_ipsec_policy(name_or_id, ignore_missing=True, **query)
Finds a single IPsec policy. One singular icon ๐
Parameters
name_or_idโ the name or ID of an IPsec policy.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any extra parameters you want passed down into the underlying methods, like query filters.
Returns โ one VpnIpsecPolicy (openstack.network.v2.vpn_ipsec_policy.VpnIpsecPolicy) or None.
get_vpn_ipsec_policy(ipsec_policy, *, fields=None) โ grab a single IPsec policy, no cap.
Parameters
ipsec_policyโ this can be the ID of anIPcecpolicy or aVpnIpsecPolicy(openstack.network.v2.vpn_ipsec_policy.VpnIpsecPolicy) instance. (yes bestie, the original really saysIPcecโ we keep it exactly as-is ๐ )fieldsโ limit the resource fields to fetch.
Returns โ one VpnIpsecPolicy (openstack.network.v2.vpn_ipsec_policy.VpnIpsecPolicy).
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
vpn_ipsec_policies(**query) โ return a generator of IPsec policies. Itโs giving โall the policies, please.โ โจ
Parameters
queryโ optional query parameters sent along to limit the resources being returned.
Returns โ a generator of IPsec policy objects.
update_vpn_ipsec_policy(ipsec_policy, **attrs) โ update an IPsec policy.
Ipsec_policy โ either the id of an IPsec policy or a VpnIpsecPolicy (openstack.network.v2.vpn_ipsec_policy.VpnIpsecPolicy) instance.
Parameters
attrsโ the attributes to update on the IPsec policy represented byipsec_policy.
Returns โ the updated IPsec policy.
delete_vpn_ipsec_policy(ipsec_policy, ignore_missing=True) โ delete an IPsec policy. Bye bestie ๐
Parameters
ipsec_policyโ the value can be either the ID of an IPsec policy, or aVpnIpsecPolicy(openstack.network.v2.vpn_ipsec_policy.VpnIpsecPolicy) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the IPsec policy does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent IPsec policy.
Returns โ None.
create_vpn_service(**attrs) โ create a new vpn service from attributes. Main character creation energy ๐ฅ
Parameters
attrsโ keyword arguments which will be used to create aVpnService(openstack.network.v2.vpn_service.VpnService), comprised of the properties on theVpnServiceclass.
Returns โ the results of vpn service creation.
delete_vpn_service(vpn_service, ignore_missing=True) โ delete a vpn service.
Parameters
vpn_serviceโ the value can be either the ID of a vpn service or aVpnService(openstack.network.v2.vpn_service.VpnService) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the vpn service does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent vpn service.
Returns โ None.
find_vpn_service(name_or_id, ignore_missing=True, **query) โ find a single vpn service. Lowkey a scavenger hunt ๐ต๏ธโโ๏ธ
Parameters
name_or_idโ the name or ID of a vpn service.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns โ one VpnService (openstack.network.v2.vpn_service.VpnService) or None.
get_vpn_service(vpn_service, *, fields=None) โ get a single vpn service.
Parameters
vpn_serviceโ the value can be the ID of a vpn service or aVpnService(openstack.network.v2.vpn_service.VpnService) instance.fieldsโ limit the resource fields to fetch.
Returns โ one VpnService (openstack.network.v2.vpn_service.VpnService).
Raises โ NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
vpn_services(**query) โ return a generator of vpn services.
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of vpn service objects.
update_vpn_service(vpn_service, **attrs) โ update a vpn service.
Parameters
vpn_serviceโ either the id of a vpn service or aVpnService(openstack.network.v2.vpn_service.VpnService) instance.attrsโ the attributes to update on the VPN service represented byvpn_service.
Returns โ the updated vpnservice.
๐ธ Extension Operations
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
find_extension(name_or_id, ignore_missing=True, **query) โ find a single extension. Obsessed with finding things โจ
Parameters
name_or_idโ the name or ID of an extension.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns โ one Extension (openstack.network.v2.extension.Extension) or None.
extensions(**query) โ return a generator of extensions.
Parameters
queryโ optional query parameters to be sent to limit the resources being returned. Currently no parameter is supported.
Returns โ a generator of extension objects.
๐ฆ Service Provider Operations
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
service_providers(**query) โ return a generator of service providers. Itโs giving โprovider paradeโ ๐
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of service provider objects.
๐ Local IP Operations
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_local_ip(**attrs) โ create a new local ip from attributes. Slay ๐
Parameters
attrsโ keyword arguments which will be used to create aLocalIP(openstack.network.v2.local_ip.LocalIP), comprised of the properties on theLocalIPclass.
Returns โ the results of local ip creation.
delete_local_ip(local_ip, ignore_missing=True, if_revision=None) โ delete a local ip.
Parameters
- local_ip โ bestie this one's flexible: either the ID of a local ip or an actual
LocalIPinstance.- ignore_missing โ set it to
Falseand you get aNotFoundExceptionwhen the local ip doesn't exist, no cap. Set it toTrueand nothing blows up when you try to delete a nonexistent ip, it justโฆ doesn't. - if_revision โ the revision that goes into the
If-Matchheader of the update request, so you can do a compare-and-swap update. fancy โจ
- ignore_missing โ set it to
Returns
None โ that's it, that's the whole vibe.
find_local_ip(name_or_id, ignore_missing=True, **query)
Find a local IP ๐
Parameters
- name_or_id โ the name or ID of an local IP. (yes, "an local IP", we don't gatekeep grammar here ๐ )
- ignore_missing โ
Falsemeans aNotFoundExceptiongets raised when the resource doesn't exist.Truemeans you getNoneback when you try to find a nonexistent resource. choose your fighter. - query โ any extra params passed into the underlying methods, like query filters.
Returns
One LocalIP or None ๐ซถ
get_local_ip(local_ip, *, fields=None)
Get a single local ip ๐
Parameters
- local_ip โ either the ID of a local ip or a
LocalIPinstance. - fields โ limit the resource fields you fetch. less is more, lowkey.
Returns
One LocalIP ๐
Raises NotFoundException when no resource can be found. ๐ญ
local_ips(**query)
Return a generator of local ips ๐
Parameters
query โ optional query parameters sent along to limit the resources being returned:
name: Local IP namedescription: Local IP descriptionproject_id: Owner project IDnetwork_id: Local IP networklocal_port_id: Local port IDlocal_ip_address: The IP address of a Local IPip_mode: The Local IP mode
Returns
A generator of local ip objects.
update_local_ip(local_ip, if_revision=None, **attrs)
Update a local ip โจ
Parameters
- local_ip โ either the id of a local ip or a
LocalIPinstance. - if_revision โ revision to put in the
If-Matchheader of the update request, for that compare-and-swap update energy. - attrs โ the attributes to update on the ip represented by value.
Returns
The updated ip ๐ฅ
create_local_ip_association(local_ip, **attrs)
Create a new local ip association from attributes ๐
Parameters
- local_ip โ the value can be the ID of a Local IP or a
LocalIPinstance. - attrs โ keyword arguments used to create a
LocalIPAssociation, comprised of the properties on theLocalIPclass.
Returns
The results of local ip association creation. it's giving new resource ๐ฆ
delete_local_ip_association(local_ip, fixed_port_id, ignore_missing=True, if_revision=None)
Delete a local ip association ๐
Parameters
- local_ip โ the value can be the ID of a Local IP or a
LocalIPinstance. - fixed_port_id โ either the fixed port ID or a
LocalIPAssociationinstance (the docs literally say:class:~openstack.network.v2.local_ip_association.LocalIPAssociationand we respect it). - ignore_missing โ set to
Falseand aNotFoundExceptiongets raised when the local ip association doesn't exist. set toTrueand no exception gets set when you attempt to delete a nonexistent ip. - if_revision โ revision to put in the
If-Matchheader of the update request, for the compare-and-swap update.
Returns
None ๐
find_local_ip_association(name_or_id, local_ip, ignore_missing=True, **query)
Find a local ip association ๐
Parameters
- name_or_id โ the name or ID of local ip association. (two spaces in the original, iconic)
- local_ip โ the ID of a Local IP or a
LocalIPinstance. - ignore_missing โ
FalseraisesNotFoundExceptionwhen the resource doesn't exist.TruereturnsNonewhen you're hunting a nonexistent resource. - query โ any additional parameters passed into underlying methods, such as query filters.
Returns
One LocalIPAssociation or None. ๐
get_local_ip_association(local_ip_association, local_ip, *, fields=None)
Get a single local ip association ๐
Parameters
- local_ip โ the ID of a Local IP or a
LocalIPinstance. - local_ip_association โ the ID of a local ip association or a
LocalIPAssociationinstance. - fields โ limit the resource fields to fetch.
Returns
One LocalIPAssociation โจ
Raises NotFoundException when no resource can be found. ๐ญ
local_ip_associations(local_ip, **query)
Return a generator of local ip associations ๐
Parameters
- local_ip โ the ID of a Local IP or a
LocalIPinstance. - query โ optional query parameters sent to limit the resources being returned:
fixed_port_id: The ID of the port to which a local IP is associatedfixed_ip: The fixed ip address associated with a a Local IP (the double "a a" is canon, we stan)host: Host where local ip is associated
Returns
A generator of local ip association objects LocalIPAssociation. ๐ซถ
๐ธ Ndp Proxy Operations ๐ธ
okay so this whole section is the proxy class, and it's a lot. here's the signature in full, exactly as it appears, do not come for me:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
like, look at all those kwargs. main character energy fr fr ๐
create_ndp_proxy(**attrs)
Create a new ndp proxy from attributes ๐ฆ
Parameters
- attrs โ keyword arguments which will be used to create a
NDPProxxy, comprised of the properties on theNDPProxyclass. (yes,NDPProxxywith two x's โ that's what the page says, and we do not edit the source, bestie ๐ )
Returns
The results of ndp proxy creation. ๐ฅ
get_ndp_proxy(ndp_proxy, *, fields=None)
Get a single ndp proxy ๐
Parameters
- ndp_proxy โ the value can be the ID of a ndp proxy or a
NDPProxyinstance. - fields โ limit the resource fields to fetch.
Returns
One NDPProxy โจ
Raises NotFoundException when no resource can be found. ๐ญ
find_ndp_proxy(ndp_proxy_id, ignore_missing=True, **query)
Find a single ndp proxy ๐
Parameters
- ndp_proxy_id โ the ID of a ndp proxy.
ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) gets raised if the resource doesnโt exist. When itโsTrue, you getNoneback when you try to find a nonexistent resource. Bestie, itโs the chill setting ๐queryโ any extra parameters passed into the underlying methods, like query filters.- Returns: One
NDPProxy(openstack.network.v2.ndp_proxy.NDPProxy) orNone
delete_ndp_proxy(ndp_proxy, ignore_missing=True)โ delete a ndp proxy โจndp_proxyโ the value can be the ID of a ndp proxy or anNDPProxy(openstack.network.v2.ndp_proxy.NDPProxy) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the router does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent ndp proxy.- Returns:
None
ndp_proxies(**query)โ return a generator of ndp proxies ๐ฆqueryโ optional query parameters sent to limit the resources being returned. Valid parameters are:router_idโ the ID of the routerport_idโ the ID of internal port.ip_addressโ the internal IP address
- Returns: A generator of port forwarding objects
update_ndp_proxy(ndp_proxy, **attrs)โ update a ndp proxy ๐ndp_proxyโ the value can be the ID of a ndp proxy or anNDPProxy(openstack.network.v2.ndp_proxy.NDPProxy) instance.attrsโ the attributes to update on the ip represented by value.- Returns: The updated ndp_proxy
๐ฆ BGP Operations ๐ฆ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_bgp_peer(**attrs)โ create a new BGP Peer from attributes โจdelete_bgp_peer(peer, ignore_missing=True)โ delete a BGP Peerfind_bgp_peer(name_or_id, ignore_missing=True, **query)โ find a single BGP Peerget_bgp_peer(peer)โ get a single BGP Peerupdate_bgp_peer(peer, **attrs)โ update a BGP Peerbgp_peers(**query)โ return a generator of BGP Peerscreate_bgp_speaker(**attrs)โ create a new BGP Speaker ๐delete_bgp_speaker(speaker, ignore_missing=True)โ delete a BGP Speakerfind_bgp_speaker(name_or_id, ignore_missing=True, **query)โ find a single BGP Peer (yes, the source says Peer here, not Speaker โ not me, bestie ๐)get_bgp_speaker(speaker)โ get a single BGP Speakerupdate_bgp_speaker(speaker, **attrs)โ update a BGP Speakerbgp_speakers(**query)โ return a generator of BGP Peers (source wording again ๐)add_bgp_peer_to_speaker(speaker, peer)โ bind the BGP peer to the specified BGP Speaker.remove_bgp_peer_from_speaker(speaker, peer)โ unbind the BGP peer from a BGP Speaker.add_gateway_network_to_speaker(speaker, network)โ add a network to the specified BGP speaker.remove_gateway_network_from_speaker(speaker, network)โ remove a network from the specified BGP speaker.get_advertised_routes_of_speaker(speaker)โ list all routes advertised by the specified BGP Speaker.get_bgp_dragents_hosting_speaker(speaker)โ list all BGP dynamic agents which are hosting the specified BGP Speaker.add_bgp_speaker_to_dragent(bgp_agent, bgp_speaker)โ add a BGP Speaker to the specified dynamic routing agent.get_bgp_speakers_hosted_by_dragent(bgp_agent)โ list all BGP Speakers hosted on the specified dynamic routing agent.remove_bgp_speaker_from_dragent(bgp_agent, bgp_speaker)โ delete the BGP Speaker hosted by the specified dynamic routing agent.
๐ธ Tap As A Service Operations ๐ธ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_tap_flow(**attrs)โ create a new Tap Flow from attributes โจdelete_tap_flow(tap_flow, ignore_missing=True)โ delete a Tap Flowfind_tap_flow(name_or_id, ignore_missing=True, **query)โ find a single Tap Service (source says Service for the flow finder, iconic ๐)get_tap_flow(tap_flow, *, fields=None)โ get a single Tap Flow ๐ซถtap_flowโ the value can be the ID of a tap flow or aTapFlow(openstack.network.v2.tap_flow.TapFlow) instance.fieldsโ limit the resource fields to fetch.- Returns: One
TapFlow(openstack.network.v2.tap_flow.TapFlow) - Raises:
NotFoundException(openstack.exceptions.NotFoundException) when no resource can be found.
update_tap_flow(tap_flow, **attrs)โ update a Tap Flowtap_flows(**query)โ return a generator of Tap Flowscreate_tap_service(**attrs)โ create a new Tap Service from attributes ๐delete_tap_service(tap_service, ignore_missing=True)โ delete a Tap Servicefind_tap_service(name_or_id, ignore_missing=True, **query)โ find a single Tap Serviceupdate_tap_service(tap_service, **attrs)โ update a Tap Servicetap_services(**query)โ return a generator of Tap Services
๐ BGPVPN operations ๐
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_bgpvpn(**attrs)โ create a new BGPVPN ๐attrsโ keyword arguments which will be used to create aBgpVpn(openstack.network.v2.bgpvpn.BgpVpn), comprised of the properties on the BGPVPN class. For details, see the Neutron api-ref.- Returns: The result of BGPVPN creation
delete_bgpvpn(bgpvpn, ignore_missing=True)โ delete a BGPVPNbgpvpnโ the value can be either the ID of a bgpvpn or aBgpVpn(openstack.network.v2.bgpvpn.BgpVpn) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the BGPVPN does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent BGPVPN.- Returns:
None
find_bgpvpn(name_or_id, ignore_missing=True, **query)โ find a single BGPVPN ๐name_or_idโ the name or ID of a BGPVPN.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods, such as query filters.- Returns: One BGPVPN or
None
get_bgpvpn(bgpvpn, *, fields=None)โ get a single BGPVPN ๐bgpvpnโ the value can be the ID of a BGPVPN or aBgpVpn(openstack.network.v2.bgpvpn.BgpVpn) instance.fieldsโ limit the resource fields to fetch.
Returns โ one BgpVpn <#openstack.network.v2.bgpvpn.BgpVpn> object, bestie. โจ
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. Like, if it's not there, it's not there. ๐
update_bgpvpn(bgpvpn, **attrs)
Update a BGPVPN. Glow-up szn. ๐
Parameters
- bgpvpn โ either the ID of a BGPVPN or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - attrs โ the attributes to update on the BGPVPN represented by value.
Returns โ the updated BGPVPN. ๐
bgpvpns(**query)
Return a generator of BGP VPNs. Not a list, a generator, okay? she yields.
Parameters
- query โ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of BgpVpn objects.
create_bgpvpn_network_association(bgpvpn, **attrs)
Create a new BGPVPN Network Association. new friend unlocked ๐ซถ
Parameters
- bgpvpn โ the value can be either the ID of a bgpvpn or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - attrs โ keyword arguments which will be used to create a
BgpVpnNetworkAssociation, comprised of the properties on theBgpVpnNetworkAssociationclass.
Returns โ the results of BgpVpnNetworkAssociation creation.
delete_bgpvpn_network_association(bgpvpn, net_association, ignore_missing=True)
Delete a BGPVPN Network Association. it's giving closure ๐ธ
Parameters
- bgpvpn โ the value can be either the ID of a bgpvpn or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - net_association โ the value can be either the ID of a
bgpvpn_network_associationor aBgpVpnNetworkAssociationinstance. - ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when theBgpVpnNetworkAssociationdoes not exist. When set toTrue, no exception will be set when attempting to delete a nonexistentBgpVpnNetworkAssociation.
Returns โ None.
get_bgpvpn_network_association(bgpvpn, net_association, *, fields=None)
Get a signle BGPVPN Network Association. (yes, "signle", the docs said what they said, we respect the typo ๐ญ)
Parameters
- bgpvpn โ the value can be the ID of a BGPVPN or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - net_association โ the value can be the ID of a
BgpVpnNetworkAssociationor aBgpVpnNetworkAssociationinstance. - fields โ limit the resource fields to fetch. only the cute parts โจ
Returns โ one BgpVpnNetworkAssociation.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
bgpvpn_network_associations(bgpvpn, **query)
Return a generator of BGP VPN Network Associations.
Param bgpvpn: the value can be the ID of a BGPVPN or a BgpVpn <#openstack.network.v2.bgpvpn.BgpVpn> instance.
Parameters
- query โ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of BgpVpnNetworkAssociation objects.
create_bgpvpn_port_association(bgpvpn, **attrs)
Create a new BGPVPN Port Association. another one, we love to see it ๐
Parameters
- bgpvpn โ the value can be either the ID of a bgpvpn or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - attrs โ keyword arguments which will be used to create a
BgpVpnPortAssociation, comprised of the properties on theBgpVpnPortAssociationclass.
Returns โ the results of BgpVpnPortAssociation creation.
delete_bgpvpn_port_association(bgpvpn, port_association, ignore_missing=True)
Delete a BGPVPN Port Association. bye bestie ๐
Parameters
- bgpvpn โ the value can be either the ID of a bgpvpn or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - port_association โ the value can be either the ID of a
bgpvpn_port_associationor aBgpVpnPortAssociationinstance. - ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when theBgpVpnPortAssociationdoes not exist. When set toTrue, no exception will be set when attempting to delete a nonexistentBgpVpnPortAssociation.
Returns โ None.
find_bgpvpn_port_association(name_or_id, bgpvpn_id, ignore_missing=True, **query)
Find a single BGPVPN Port Association. detective mode ๐
Parameters
- name_or_id โ the name or ID of a
BgpVpnNetworkAssociation. - bgpvpn_id โ the value can be the ID of a BGPVPN.
- ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. - query โ any additional parameters to be passed into underlying methods. such as query filters.
Returns โ one BGPVPN or None.
get_bgpvpn_port_association(bgpvpn, port_association, *, fields=None)
Get a signle BGPVPN Port Association. (again with the "signle" โ iconic typo, no notes ๐)
Parameters
- bgpvpn โ the value can be the ID of a BGPVPN or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - port_association โ the value can be the ID of a
BgpVpnPortAssociationor aBgpVpnPortAssociationinstance. - fields โ limit the resource fields to fetch.
Returns โ one BgpVpnPortAssociation.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_bgpvpn_port_association(bgpvpn, port_association, **attrs)
Update a BPGPN Port Association. (yes, "BPGPN" โ original spelling, we keep it fr fr ๐)
Parameters
- bgpvpn โ either the ID of a BGPVPN or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - port_association โ the value can be the ID of a
BgpVpnPortAssociationor aBgpVpnPortAssociationinstance. - attrs โ the attributes to update on the BGPVPN represented by value.
Returns โ the updated BgpVpnPortAssociation.
bgpvpn_port_associations(bgpvpn, **query)
Return a generator of BGP VPN Port Associations.
Param bgpvpn: the value can be the ID of a BGPVPN or a BgpVpn <#openstack.network.v2.bgpvpn.BgpVpn> instance.
Parameters
- query โ optional query parameters to be sent to limit the resources being returned.
Returns โ a generator of BgpVpnNetworkAssociation objects. (yes it says BgpVpnNetworkAssociation in the Port one too โ that's what the page says, so that's what you get ๐ซถ)
create_bgpvpn_router_association(bgpvpn, **attrs)
Create a new BGPVPN Router Association. routers need love too ๐
Parameters
- bgpvpn โ the value can be either the ID of a bgpvpn or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - attrs โ keyword arguments which will be used to create a
BgpVpnRouterAssociation, comprised of the properties on theBgpVpnRouterAssociationclass.
Returns โ the results of BgpVpnRouterAssociation creation.
delete_bgpvpn_router_association(bgpvpn, router_association, ignore_missing=True)
Delete a BGPVPN Router Association. closing the group chat ๐
Parameters
- bgpvpn โ the value can be either the ID of a bgpvpn or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. - router_association โ the value can be either the ID of a
bgpvpn_router_associationor aBgpVpnRouterAssociationinstance. - ignore_missing โ when set to
False,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when theBgpVpnRouterAssociationdoes not exist. When set toTrue, no exception will be set when attempting to delete a nonexistentBgpVpnRouterAsociation. (yup,BgpVpnRouterAsociationโ one "s", lowercase "soc"... we're just quoting the source, don't come for me ๐ญ)
Returns โ None.
get_bgpvpn_router_association(bgpvpn, router_association, *, fields=None)
Get a signle BGPVPN Router Association. third "signle" of the day, it's a tradition at this point โจ
Parameters
- bgpvpn โ the value can be the ID of a BGPVPN or a
BgpVpn<#openstack.network.v2.bgpvpn.BgpVpn> instance. router_associationโ the value can be the ID of aBgpVpnRouterAssociationor aBgpVpnRouterAssociationinstance. ๐ซถfieldsโ limit the resource fields to fetch. Only grab what you asked for, no extra luggage bestie.
Returns โ one BgpVpnRouterAssociation. Just the one. A single.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐
update_bgpvpn_router_association(bgpvpn, router_association, **attrs)
Update a BPGPN Router Association. (Yes, we know โ the docstring says "BPGPN". We're not fixing it, we're respecting it. Character for character, bestie. ๐ )
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of BgpVpnNetworkAssociation objects.
Okay so yes, this Returns line says Network Association for a method about Router Associations, and it says "generator" for a method that updates. That's what the page says, so that's what you get. Do not come for me, come for the docstring. ๐ Not my words, not my problem.
bgpvpn_router_associations(bgpvpn, **query)
Return a generator of BGP VPN router Associations. All of them. A whole little stream of them, served up fresh. โจ
Param bgpvpn: The value can be the ID of a BGPVPN or a BgpVpn <#openstack.network.v2.bgpvpn.BgpVpn> instance.
Parameters
queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of BgpVpnRouterAssociation objects.
๐ฆ SFC operations ๐ฆ
class openstack.network.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
ik that signature is giving "final boss of keyword arguments" ๐ญ but here she is, all of it, no cap. The Proxy class lives at openstack.network.v2._proxy.Proxy and she takes a session plus that whole buffet of keyword-only config. Go off, honestly. ๐
create_sfc_flow_classifier(**attrs)
Create a new Flow Classifier from attributes. Fresh out the box, custom-built, your very own. ๐
Parameters
attrsโ keyword arguments which will be used to create aSfcFlowClassifier<#openstack.network.v2.sfc_flow_classifier.SfcFlowClassifier>, comprised of the properties on theSfcFlowClassifierclass.
Returns
The results of SFC Flow Classifier creation.
delete_sfc_flow_classifier(flow_classifier, ignore_missing=True)
Delete a Flow Classifier. Gone. Poof. ๐จ
Parameters
flow_classifierโ the value can be either the ID of a flow classifier or aSfcFlowClassifier<#openstack.network.v2.sfc_flow_classifier.SfcFlowClassifier> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the flow classifier does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent flow classifier.
Note the double space in "when the flow classifier does not exist" โ that's the original's double space, preserved with love. ๐ซถ
Returns
None. Nothing. That's the whole vibe.
find_sfc_flow_classifier(name_or_id, ignore_missing=True, **query)
Find a single Flow Classifier. Detective mode: activated. ๐
Parameters
name_or_idโ the name or ID of an SFC flow classifier.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns
One SfcFlowClassifier or None. Found it or didn't, no drama either way. ๐ฆ
get_sfc_flow_classifier(flow_classifier)
Get a single Flow Classifier. Just the one, hand-delivered. ๐
Parameters
flow_classifierโ the value can be the ID of an SFC flow classifier or aSfcFlowClassifier<#openstack.network.v2.sfc_flow_classifier.SfcFlowClassifier> instance.
Returns
SfcFlowClassifier <#openstack.network.v2.sfc_flow_classifier.SfcFlowClassifier>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_sfc_flow_classifier(flow_classifier, **attrs)
Update a Flow Classifier. Glow-up time. โจ
Parameters
flow_classifierโ the value can be the ID of a Flow ClassifierSfcFlowClassifier<#openstack.network.v2.sfc_flow_classifier.SfcFlowClassifier>, instance.attrsโ the attributes to update on the Flow Classifier.
Returns
The updated Flow Classifier.
create_sfc_port_chain(**attrs)
Create a new Port Chain from attributes. Link by link, bestie. โ๏ธ
Parameters
attrsโ keyword arguments which will be used to create aSfcPortChain<#openstack.network.v2.sfc_port_chain.SfcPortChain>, comprised of the properties on theSfcPortchainclass.
Returns
The results of SFC Port Chain creation.
delete_sfc_port_chain(port_chain, ignore_missing=True)
Delete a Port Chain. Breaking the chain, respectfully. ๐
Parameters
port_chainโ the value can be either the ID of a port chain or aSfcPortChain<#openstack.network.v2.sfc_port_chain.SfcPortChain> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the port chain does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent port chain.
Returns
None
find_sfc_port_chain(name_or_id, ignore_missing=True, **query)
Find a single Port Chain.
Parameters
name_or_idโ the name or ID of an SFC port chain.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.
Returns
One SfcPortChain or None. ๐ธ
get_sfc_port_chain(port_chain)
Get a signle Port Chain.
"signle" โ nope, that's not a typo I made, that's the page's own spelling and I'm keeping it fr fr. ๐ญ Original text is sacred. ๐ซถ
Parameters
port_chainโ the value can be the ID of an SFC port chain or aSfcPortChain<#openstack.network.v2.sfc_port_chain.SfcPortChain> instance.
Returns
SfcPortchain
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_sfc_port_chain(port_chain, **attrs)
Update a Port Chain. New chain, who dis. ๐ฅ
Parameters
port_chainโ the value can be the ID of a Port ChainSfcPortChain<#openstack.network.v2.sfc_port_chain.SfcPortChain>, instance.attrsโ the attributes to update on the Port Chain.
Returns
The updated Port Chain.
create_sfc_port_pair(**attrs)
Create a new Port Pair from attributes. Two ports, one pair, iconic duo energy. ๐ฏ
Parameters
attrsโ keyword arguments which will be used to create aSfcPortPair<#openstack.network.v2.sfc_port_pair.SfcPortPair>, comprised of the properties on theSfcPortPairclass.
Returns
The results of SFC Port Pair creation.
delete_sfc_port_pair(port_pair, ignore_missing=True)
Delete a Port Pair. Separating the duo. Sad but necessary. ๐ญ
Parameters
port_pairโ the value can be either the ID of a port pair or aSfcPortPair<#openstack.network.v2.sfc_port_pair.SfcPortPair> instance.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the port pair does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent port pair.
Returns
None
find_sfc_port_pair(name_or_id, ignore_missing=True, **query)
Find a single Port Pair. ๐
Parameters
name_or_idโ the name or ID of an SFC port pair.ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.queryโ any additional parameters to be passed into underlying methods. such as query filters.get_sfc_port_pair(port_pair)โ Get a signle Port Pair ๐
Parameters
- port_pair โ The value can be the ID of an SFC port pair or a
SfcPortPair<#openstack.network.v2.sfc_port_pair.SfcPortPair> instance.
Returns
SfcPortPair <#openstack.network.v2.sfc_port_pair.SfcPortPair>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
update_sfc_port_pair(port_pair, **attrs)โ Update a Port Pair โจ
Parameters
- port_pair โ The value can be the ID of a Port Pair
SfcPortPair<#openstack.network.v2.sfc_port_pair.SfcPortPair>, instance. - attrs โ The attributes to update on the Port Pair
Returns
The updated Port Pair. ๐ซถ
create_sfc_port_pair_group(**attrs)โ Create a new Port Pair Group from attributes ๐ธ
Parameters
- attrs โ Keyword arguments which will be used to create a
SfcPortPairGroup<#openstack.network.v2.sfc_port_pair_group.SfcPortPairGroup>, comprised of the properties on theSfcPortPairGroupclass.
Returns
The results of SFC Port Pair Group creation ๐
delete_sfc_port_pair_group(port_pair_group, ignore_missing=True)โ Delete a Port Pair Group ๐
Parameters
- port_pair_group โ The value can be either the ID of a port pair group or a
SfcPortPairGroupinstance. - ignore_missing โ When set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the port pair group does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent port pair group.
Returns
None
find_sfc_port_pair_group(name_or_id, ignore_missing=True, **query)โ Find a single Port Pair Group ๐
Parameters
- name_or_id โ The name or ID of an SFC port pair group.
- ignore_missing โ When set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. - query โ Any additional parameters to be passed into underlying methods. such as query filters.
Returns
One SfcPortPairGroup or None
get_sfc_port_pair_group(port_pair_group)โ Get a signle Port Pair Group ๐
Parameters
- port_pair_group โ The value can be the ID of an SFC port pair group or a
SfcPortPairGroup<#openstack.network.v2.sfc_port_pair_group.SfcPortPairGroup> instance.
Returns
SfcPortPairGroup <#openstack.network.v2.sfc_port_pair_group.SfcPortPairGroup>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
update_sfc_port_pair_group(port_pair_group, **attrs)โ Update a Port Pair Group โจ
Parameters
- port_pair_group โ The value can be the ID of a Port Pair Group
SfcPortPairGroup<#openstack.network.v2.sfc_port_pair_group.SfcPortPairGroup>, instance. - attrs โ The attributes to update on the Port Pair Group
Returns
The updated Port Pair Group. ๐ซถ
create_sfc_service_graph(**attrs)โ Create a new Service Graph from attributes ๐
Parameters
- attrs โ Keyword arguments which will be used to create a
SfcServiceGraph<#openstack.network.v2.sfc_service_graph.SfcServiceGraph>, comprised of the properties on theSfcServiceGraphclass.
Returns
The results of SFC Service Graph creation ๐
delete_sfc_service_graph(service_graph, ignore_missing=True)โ Delete a Service Graph ๐
Parameters
- service_graph โ The value can be either the ID of a service graph or a
SfcServiceGraph<#openstack.network.v2.sfc_service_graph.SfcServiceGraph> instance. - ignore_missing โ When set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the service graph does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent service graph.
Returns
None
find_sfc_service_graph(name_or_id, ignore_missing=True, **query)โ Find a single Service Graph ๐
Parameters
- name_or_id โ The name or ID of an SFC service graph.
- ignore_missing โ When set to
FalseNotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. - query โ Any additional parameters to be passed into underlying methods. such as query filters.
Returns
One SfcServiceGraph or None
get_sfc_service_graph(service_graph)โ Get a signle Service Graph ๐
Parameters
- service_graph โ The value can be the ID of an SFC service graph or a
SfcServiceGraph<#openstack.network.v2.sfc_service_graph.SfcServiceGraph> instance.
Returns
SfcServiceGraph <#openstack.network.v2.sfc_service_graph.SfcServiceGraph>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
update_sfc_service_graph(service_graph, **attrs)โ Update a Service Graph โจ
Parameters
- service_graph โ The value can be the ID of a Service Graph
SfcServiceGraph<#openstack.network.v2.sfc_service_graph.SfcServiceGraph>, instance. - attrs โ The attributes to update on the Service Graph
Returns
The updated Service Graph. ๐ซถ
๐ฆ Tap Mirror operations
okay so the whole tap mirror situation lives on this proxy class, and here's literally the entire signature bestie, don't skip a single keyword-only arg, iykyk:
class openstack.network.v2._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_tap_mirror(**attrs)โ Create a new Tap Mirror from attributes โจdelete_tap_mirror(tap_mirror, ignore_missing=True)โ Delete a Tap Mirror ๐find_tap_mirror(name_or_id, ignore_missing=True, **query)โ Find a single Tap Mirror ๐get_tap_mirror(tap_mirror, *, fields=None)โ Get a signle Tap Mirror ๐
Parameters
- tap_mirror โ The value can be the ID of a tap mirror or a
TapMirror<#openstack.network.v2.tap_mirror.TapMirror> instance. - fields โ Limit the resource fields to fetch.
Returns
One TapMirror <#openstack.network.v2.tap_mirror.TapMirror>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found. ๐ญ
update_tap_mirror(tap_mirror, **attrs)โ Update a Tap Mirror โจtap_mirrors(**query)โ Return a generator of Tap Mirrors ๐
๐ Object Store API
For details on how to use this API, see Using OpenStack Object Store <>
๐ The Object Store Class
The Object Store high-level interface is exposed as the object_store object on Connection <#openstack.connection.Connection> objects. literally so convenient, you just reach for it and it's there ๐
๐ Account Operations
here's the class for the account ops, full signature, no cap:
class openstack.object_store.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_account_metadata()
Get the metadata for this account. That's it, that's the vibe โจ
set_account_metadata(**metadata)
Set metadata for this account. ๐
Parameters
metadataโ Key/value pairs to be set as metadata on the container. Custom metadata can be set. Custom metadata are keys and values defined by the user.
delete_account_metadata(keys)
Delete metadata for this account. Bye-bye ๐
Parameters
keysโ The keys of metadata to be deleted.
๐งบ Container Operations ๐งบ
Okay bestie, this is where it gets good. Same Proxy class, same energy:
class openstack.object_store.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
containers(**query)
Obtain Container objects for this account. Like, all of them. ๐
Parameters
queryโ Optional query parameters to be sent to limit the resources being returned.
create_container(name, **attrs)
Create a new container from attributes ๐ธ
Parameters
containerโ Name of the container to create.attrsโ Keyword arguments which will be used to create aContainer <#openstack.object_store.v1.container.Container>, comprised of the properties on the Container class.
Returns
The results of container creation.
delete_container(container, ignore_missing=True)
Delete a container. Gone. Reduced to atoms ๐
Parameters
containerโ The value can be either the name of a container or aContainer <#openstack.object_store.v1.container.Container>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the container does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent server.
Returns
None
get_container_metadata(container)
Get metadata for a container ๐
Parameters
containerโ The value can be the name of a container or aContainer <#openstack.object_store.v1.container.Container>instance.
Returns
One Container <#openstack.object_store.v1.container.Container>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
set_container_metadata(container, refresh=True, **metadata)
Set metadata for a container. Iconic behaviour honestly ๐
Parameters
containerโ The value can be the name of a container or aContainer <#openstack.object_store.v1.container.Container>instance.refreshโ Flag to trigger refresh of container object re-fetch.metadataโ Key/value pairs to be set as metadata on the container. Both custom and system metadata can be set. Custom metadata are keys and values defined by the user. System metadata are keys defined by the Object Store and values defined by the user. The system metadata keys are:content_typeis_content_type_detectedversions_locationread_ACLwrite_ACLsync_tosync_key
delete_container_metadata(container, keys)
Delete metadata for a container. Clearing out the vibes ๐งน
Parameters
containerโ The value can be the ID of a container or aContainer <#openstack.object_store.v1.container.Container>instance.keysโ The keys of metadata to be deleted.
๐ฆ Object Operations ๐ฆ
Bestie we are so close. Same class, third time's the charm:
class openstack.object_store.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
objects(container, **query)
Return a generator that yields the Container's objects. It's giving "infinite scroll but make it cloud storage" ๐
Parameters
containerโ A container object or the name of a container that you want to retrieve objects from.queryโ Optional query parameters to be sent to limit the resources being returned.
get_object(obj, container=None, resp_chunk_size=1024, outfile=None, remember_content=False)
Get the data associated with an object. The main character of this whole section, lowkey ๐ซถ
Parameters
objโ The value can be the name of an object or aObject <#openstack.object_store.v1.obj.Object>instance.containerโ The value can be the name of a container or aContainer <#openstack.object_store.v1.container.Container>instance.resp_chunk_sizeโ chunk size of data to read. Only used if the results are being written to a file or stream isTrue. (optional, defaults to 1k)outfileโ Write the object to a file instead of returning the contents. If this option is given, body in the return tuple will beNone. outfile can either be a file path given as a string, or a File like object.remember_contentโ Flag whether object data should be saved as data property of the Object. When left as false and outfile is not defined data will not be saved and need to be fetched separately.
Returns
Instance of the Object <#openstack.object_store.v1.obj.Object> objects.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
download_object(obj, container=None, **attrs)
Download the data contained inside an object. Snatch it, bestie ๐
Parameters
objโ The value can be the name of an object or aObject <#openstack.object_store.v1.obj.Object>instance.containerโ The value can be the name of a container or aContainer <#openstack.object_store.v1.container.Container>instance.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
upload_object(container, name, filename=None, md5=None, sha256=None, segment_size=None, use_slo=True, metadata=None, generate_checksums=None, data=None, **headers)
Create a file object. Automatically uses large-object segments if needed โ like she does the most, effortlessly โจ
Parameters
containerโ The name of the container to store the file in. This container will be created if it does not exist already.nameโ Name for the object within the container.filenameโ The path to the local file whose contents will be uploaded. Mutually exclusive withdata.dataโ The content to upload to the object. Mutually exclusive withfilename.md5โ A hexadecimal md5 of the file. (Optional), if it is known and can be passed here, it will save repeating the expensive md5 process. It is assumed to be accurate.sha256โ A hexadecimal sha256 of the file. (Optional) Seemd5.segment_sizeโ Break the uploaded object into segments of this many bytes. (Optional) SDK will attempt to discover the maximum value for this from the server if it is not specified, or will use a reasonable default.headersโ These will be passed through to the object creation API as HTTP Headers.use_sloโ If the object is large enough to need to be a Large Object, use a static rather than dynamic object. Static Objects will delete segment objects when the manifest object is deleted. (optional, defaults toTrue)
heads up fr:filenameanddataare mutually exclusive โ pick one, don't do both ๐
generate_checksumsโ Whether to generate checksums on the client side that get added to headers for later prevention of double uploads of identical data. (optional, defaults toTrue)metadataโ This dict will get changed into headers that set metadata of the object
Raises SDKException (openstack.exceptions.SDKException) on operation error.
copy_object()
Copy an object. Literally just copy it, bestie. Slay.
delete_object(obj, ignore_missing=True, container=None)
Delete an object. Yeet.
objโ The value can be either the name of an object or aContainer <#openstack.object_store.v1.container.Container>instance.containerโ The value can be the ID of a container or aContainer <#openstack.object_store.v1.container.Container>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the object does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent server. (Yes, it says server โ that's the original wording, no cap ๐ญ)
Returns None
get_object_metadata(obj, container=None)
Get metadata for an object.
objโ The value can be the name of an object or aObject <#openstack.object_store.v1.obj.Object>instance.containerโ The value can be the ID of a container or aContainer <#openstack.object_store.v1.container.Container>instance.
Returns One Object <#openstack.object_store.v1.obj.Object>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
set_object_metadata(obj, container=None, **metadata)
Set metadata for an object.
Note: This method will do an extra HEAD call.
objโ The value can be the name of an object or aObject <#openstack.object_store.v1.obj.Object>instance.containerโ The value can be the name of a container or aContainer <#openstack.object_store.v1.container.Container>instance.metadataโ Key/value pairs to be set as metadata on the container. Both custom and system metadata can be set. Custom metadata are keys and values defined by the user. System metadata are keys defined by the Object Store and values defined by the user. The system metadata keys are:content_typecontent_encodingcontent_dispositiondelete_afterdelete_atis_content_type_detected
delete_object_metadata(obj, container=None, keys=None)
Delete metadata for an object.
objโ The value can be the name of an object or aObject <#openstack.object_store.v1.obj.Object>instance.containerโ The value can be the ID of a container or aContainer <#openstack.object_store.v1.container.Container>instance.keysโ The keys of metadata to be deleted.
๐ผ Orchestration API ๐ผ
For details on how to use orchestration, see Using OpenStack Orchestration <>.
The Orchestration Class
The orchestration high-level interface is available through the orchestration member of a Connection <#openstack.connection.Connection> object. The orchestration member will only be added if the service is detected.
Stack Operations
class openstack.orchestration.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_stack(preview=False, **attrs)
Create a new stack from attributes.
previewโ WhenTrue, a preview endpoint will be used to verify the template. Default:Falseattrsโ Keyword arguments which will be used to create aStack <#openstack.orchestration.v1.stack.Stack>, comprised of the properties on the Stack class.
Returns The results of stack creation
find_stack(name_or_id, ignore_missing=True, resolve_outputs=True)
Find a single stack.
name_or_idโ The name or ID of a stack.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue, None will be returned when attempting to find a nonexistent resource.
Returns One Stack <#openstack.orchestration.v1.stack.Stack> or None
stacks(**query)
Return a generator of stacks.
queryโ Optional query parameters to be sent to limit the resources being returned.
Returns A generator of stack objects
get_stack(stack, resolve_outputs=True)
Get a single stack.
stackโ The value can be the ID of a stack or aStack <#openstack.orchestration.v1.stack.Stack>instance.resolve_outputsโ Whether stack should contain outputs resolved.
Returns One Stack <#openstack.orchestration.v1.stack.Stack>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
update_stack(stack, *, preview=False, **attrs)
Update a stack.
stackโ The value can be the ID of a stack or aStack <#openstack.orchestration.v1.stack.Stack>instance.attrsโ The attributes to update on the stack represented by value.
Returns The updated stack
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
delete_stack(stack, ignore_missing=True)
Delete a stack.
stackโ The value can be either the ID of a stack or aStack <#openstack.orchestration.v1.stack.Stack>instance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the stack does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent stack.
Returns None
export_stack(stack)
Get the stack data in JSON format.
stackโ The value can be the ID or a name or an instance ofStack <#openstack.orchestration.v1.stack.Stack>
Returns A dictionary containing the stack data.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
get_stack_template(stack)
Get template used by a stack.
stackโ The value can be the ID of a stack or an instance ofStack <#openstack.orchestration.v1.stack.Stack>
Returns One object of StackTemplate <#openstack.orchestration.v1.stack_template.StackTemplate>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
get_stack_environment(stack)
Get environment used by a stack.
stackโ The value can be the ID of a stack or an instance ofStack <#openstack.orchestration.v1.stack.Stack>
Returns One object of StackEnvironment <#openstack.orchestration.v1.stack_environment.StackEnvironment>
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no resource can be found.
๐ Stack Resource Operations
Okay bestie, real talk โ every single one of these sections is literally the same Proxy class, so I'm not gonna make you sit through the whole constructor signature a million times. But the first time? We're doing it properly, 'cause that's the icon we're dealing with ๐
class openstack.orchestration.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
Like, that's the whole glow-up list. Every kwarg. We're not skipping a single one, periodt.
resources(stack, **query)
โจ Returns you a generator of resources โจ โ a whole lil stream of them, one at a time, like scrolling your fyp.
Parameters:
- stack โ ngl this one's flexible: it can be an actual stack object, OR just the name of a stack whose resources you wanna list ๐ซถ
- query โ optional query params you send along to limit which resources come back (a little filter, a little curation, we love to see it)
Returns: a generator of resource objects โ but only if the stack actually exists AND has resources in it. If the stack can't be found? Exception. Immediately. No vibes. ๐
The resource objects it hands you are Resource (#openstack.orchestration.v1.resource.Resource) โ that's the type, bestie.
Raises: NotFoundException (#openstack.exceptions.NotFoundException) when the stack cannot be found. Like, it's gone gone.
๐ Stack Action Operations
Same Proxy class, same constructor signature, same energy:
class openstack.orchestration.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
check_stack(stack)
Checks a stack's status. ๐
And here's the thing โ this is an asynchronous action, so there's literally no other way to check the result than to track the stack's status yourself. No instant answer, no shortcut, that's just the deal. ๐
Parameters:
- stack โ either the ID of a stack, or an actual instance of
Stack(#openstack.orchestration.v1.stack.Stack)
Returns: None. That's it. That's the whole return. ๐
suspend_stack(stack)
Suspends a stack's status. Putting it on pause, putting it in airplane mode โ๏ธ
Parameters:
- stack โ again, either the ID of a stack or an instance of
Stack(#openstack.orchestration.v1.stack.Stack)
Returns: None
resume_stack(stack)
Resumes a stack's status โ un-pausing it, bringing it back online, the comeback era ๐
Parameters:
- stack โ either the ID of a stack or an instance of
Stack(#openstack.orchestration.v1.stack.Stack)
Returns: None
๐ฆ Stack Event Operations
You guessed it โ same Proxy class, same giant signature, here it is once more in all its glory:
class openstack.orchestration.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
stack_events(stack, resource_name=None, **attr)
Gets you stack events โ the receipts, the timeline, the lore ๐
Parameters:
- stack โ the value can be the ID of a stack or an instance of
Stack(#openstack.orchestration.v1.stack.Stack) - resource_name โ the name of the resource. And here's the tea: if
resource_nameis notNone, thebase_pathchanges. Yes, it literally switches up the path on you. Lowkey important ๐จ
Returns: a generator of stack_events objects. A whole stream of them, bestie ๐
๐ธ Stack Template Operations
Same Proxy class, same constructor, same everything โ one more time for the people in the back:
class openstack.orchestration.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
validate_template(template, environment=None, template_url=None, ignore_errors=None)
Validates a template. A whole vibe check for your template, fr fr โ
Parameters:
- template โ the stack template that the validation is performed on
- environment โ a JSON environment for the stack, if you've got one to provide
- template_url โ a URI to the location containing the stack template for validation. This one's only required if the template parameter is
None. And heads up: this parameter gets ignored if template is specified. Pick a lane, you know? ๐ - ignore_errors โ a string containing comma separated error codes to ignore. Currently the only valid error code is
'99001'โ that's the one and only, don't try to sneak others in ๐
Returns: the result of template validation
Raises:
InvalidRequest(#openstack.exceptions.InvalidRequest) if neither template nor template_url is provided โ like, you gotta give it somethingHttpException(#openstack.exceptions.HttpException) if the template fails the validation โ the template did not slay, and it will be told ๐ญ
๐ Software Configuration Operations
Last Proxy class of this part, same iconic signature, here we go:
class openstack.orchestration.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_software_config(**attrs)
Creates a brand new software config out of attributes ๐ฑ
Parameters:
- attrs โ keyword arguments that'll be used to create a
SoftwareConfig(#openstack.orchestration.v1.software_config.SoftwareConfig), made up of the properties on theSoftwareConfigclass
Returns: the results of software config creation, as a SoftwareConfig (#openstack.orchestration.v1.software_config.SoftwareConfig)
software_configs(**query)
Returns a generator of software configs ๐ง โ a lil stream of them
Parameters:
- query โ optional query parameters sent along to limit the software configs returned
Returns: a generator of software config objects, SoftwareConfig (#openstack.orchestration.v1.software_config.SoftwareConfig)
get_software_config(software_config)
Gets you all the details about one specific software config ๐
Parameters:
- software_config โ the value can be the ID of a software config, or an instace of
SoftwareConfig(#openstack.orchestration.v1.software_config.SoftwareConfig) โ yes, that's how the original spells it, "instace", we're keeping it, character for character bestie ๐ซถ
Returns: an object of type SoftwareConfig (#openstack.orchestration.v1.software_config.SoftwareConfig)
delete_software_config(software_config, ignore_missing=True)
Deletes a software config. Gone. Poof. ๐ฆ
Parameters:
- software_config โ either the ID of a software config or an instance of
SoftwareConfig(#openstack.orchestration.v1.software_config.SoftwareConfig) - ignore_missing โ when set to
False,NotFoundException(#openstack.exceptions.NotFoundException) gets raised when the software config doesn't exist. When set toTrue, no exception will be set when attempting to delete a nonexistent software config. (That's literally what the original says โ "no exception will be set" โ so we're keeping it exactly as-is, no editing โจ)
Returns: None
๐ ๏ธ Software Deployment Operations
okay bestie, buckle up โ here's the proxy object for software deployments, and yes I'm giving you the entire constructor signature because we don't gatekeep parameters in this house ๐
class openstack.orchestration.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
every single one of those kwargs is right there โ service_type, service_name, interface, region_name, endpoint_override, version, auth, user_agent, connect_retries, logger, allow, additional_headers, client_name, client_version, allow_version_hack, global_request_id, min_version, max_version, default_microversion, status_code_retries, retriable_status_codes, raise_exc, rate_limit, concurrency, connect_retry_delay, status_code_retry_delay, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client. iconic. no notes. โจ
๐ธ create_software_deployment(**attrs)
make a whole new software deployment out of attributes, slay.
- Parameters
attrsโ keyword arguments that get used to create aSoftwareDeployment<#openstack.orchestration.v1.software_deployment.SoftwareDeployment>, made up of the properties on theSoftwareDeploymentclass.
- Returns โ the results of software deployment creation ๐ซถ
๐ธ software_deployments(**query)
hands you a generator of software deployments. very demure, very lazy-evaluated.
- Parameters
queryโ optional query parameters that get sent along to limit the software deployments returned.
- Returns โ a generator of software deployment objects:
SoftwareDeployment<#openstack.orchestration.v1.software_deployment.SoftwareDeployment>
๐ธ get_software_deployment(software_deployment)
grab the deets on one specific software deployment resource ๐
- Parameters
software_deploymentโ the value can be the ID of a software deployment, or an instance ofSoftwareDeployment<#openstack.orchestration.v1.software_deployment.SoftwareDeployment>,
- Returns โ an object of type
SoftwareDeployment<#openstack.orchestration.v1.software_deployment.SoftwareDeployment>
๐ธ delete_software_deployment(software_deployment, ignore_missing=True)
bye bye software deployment ๐
- Parameters
software_deploymentโ the value can be either the ID of a software deployment or an instance ofSoftwareDeployment<#openstack.orchestration.v1.software_deployment.SoftwareDeployment>ignore_missingโ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the software deployment does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent software deployment.
- Returns โ
None
๐ธ update_software_deployment(software_deployment, **attrs)
update a software deployment, glow-up edition โจ
- Parameters
serverโ either the ID of a software deployment or an instance ofSoftwareDeployment<#openstack.orchestration.v1.software_deployment.SoftwareDeployment>. (yes, the docs literally label this bulletserverhere even though the parameter in the signature issoftware_deploymentโ just reporting what's written, don't come for me ๐)attrsโ the attributes to update on the software deployment represented bysoftware_deployment.
- Returns โ the updated software deployment
๐ซ Placement API
The Placement Class
the placement high-level interface is available through the placement member of a Connection <#openstack.connection.Connection> object. heads up though: the placement member will only be added if the service is detected ๐
Allocation Candidates
class openstack.placement.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
same full signature, every kwarg, absolutely no crumbs left behind ๐
allocation_candidates(**query) โ retrieve a generator of allocation candidates. each yielded AllocationCandidate <#openstack.placement.v1.allocation_candidate.AllocationCandidate> represents one candidate set of allocations, and contains:
allocationsโ adictmapping resource provider UUID to the resources to request from that provider.mappingsโ adictmapping request-group suffixes to provider UUIDs (available from microversion1.34).provider_summariesโ adictkeyed by resource provider UUID with capacity and trait information for providers in this candidate.
Parameters
queryโ Query parameters forwarded directly to placement. common parameters include:resourcesโ a comma-separatedCLASS:AMOUNTstring, e.g.VCPU:1,DISK_GB:10,MEMORY_MB:512requiredโ comma-separated required (or!-prefixed forbidden) traitsmember_ofโ aggregate UUID filterin_treeโ restrict to a resource provider subtreelimitโ maximum number of candidates to returngroup_policyโisolateornoneroot_requiredโ traits required on the root providersame_subtreeโ request-group suffixes that must share a tree
numbered variants (resources1, required1, member_of1, in_tree1, โฆ) are accepted for granular request groups. iykyk ๐ง
Returns โ a generator of AllocationCandidate <#openstack.placement.v1.allocation_candidate.AllocationCandidate> instances.
Allocations
class openstack.placement.v1._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
third time's the charm, same signature, still every single kwarg ๐
get_allocation(consumer) โ get allocations for a consumer.
- Parameters
consumerโ the UUID of the consumer, or anAllocation<#openstack.placement.v1.allocation.Allocation> instance.
- Returns โ an instance of
Allocation<#openstack.placement.v1.allocation.Allocation> with all allocations for the given consumer. - Raises โ
NotFoundException<#openstack.exceptions.NotFoundException> when no allocations for the consumer could be found. ๐ญ
update_allocation(consumer, **attrs) โ set or update allocations for a consumer.
creates or replaces all allocation records for the consumer identified by consumer. and fr fr, if allocations already exist for this consumer they are replaced โ not merged, not patched, replaced. ๐
- Parameters
consumerโ the UUID of the consumer, or anAllocation<#openstack.placement.v1.allocation.Allocation> instance.attrsโ keyword arguments which will be used to update theAllocation<#openstack.placement.v1.allocation.Allocation>, comprised of the properties on theAllocationclass. at a minimum,allocations,project_id, anduser_idmust be provided when creating new allocations.
- Returns โ the updated
Allocation<#openstack.placement.v1.allocation.Allocation>.
create_allocations(allocations) โ create or update allocations for multiple consumers. multitasking queen ๐
- Parameters
allocationsโ adictkeyed by consumer UUID. each value must containallocations,project_id,user_id, andconsumer_generation; from microversion1.38consumer_typeis also required. pass an emptyallocationsvalue for a consumer to remove all of their allocations.
- Returns โ
None - Raises โ
ConflictException<#openstack.exceptions.ConflictException> if any resource provider or consumer generation does not match, or if there is insufficient inventory. ๐
delete_allocation(consumer, ignore_missing=True) โ delete all allocations for a consumer.
- Parameters
consumerโ the UUID of the consumer, or anAllocation<#openstack.placement.v1.allocation.Allocation> instance.
ignore_missingโ set it toFalseand aNotFoundException <#openstack.exceptions.NotFoundException>gets raised when there are literally no allocations for the consumer. Set it toTrueand no exception gets raised when you try to delete allocations for a consumer that has none. ๐ซถ
Returns โ None
โจ Usages โจ
class openstack.placement.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
usages(project_id, user_id=None, consumer_type=None) โ gives you a generator of resource usages for a project. Each yielded Usage <#openstack.placement.v1.usage.Usage> is one consumer type and contains the total resource consumption by consumers of that type inside the given project. ๐
Parameters
project_idโ the UUID of the project you're reporting usage for.user_idโ the UUID of the user to filter by even more. Optional.consumer_typeโ the consumer type to filter by. Optional; requires placement microversion1.38or later.
Returns โ a generator of Usage <#openstack.placement.v1.usage.Usage> instances.
๐ Resource Classes ๐
class openstack.placement.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_resource_class(**attrs) โ creates a brand-new resource class from attributes. โจ
Parameters
attrsโ keyword arguments used to create aResourceClass <#openstack.placement.v1.resource_class.ResourceClass>, made up of the properties on theResourceClassclass.
Returns โ the results of resource class creation.
delete_resource_class(resource_class, ignore_missing=True) โ deletes a resource class. ๐
Parameters
resource_classโ the value can be either the ID of a resource class or anResourceClass <#openstack.placement.v1.resource_class.ResourceClass>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource class does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent resource class.
Returns โ None
update_resource_class(resource_class, **attrs) โ updates a resource class. ๐ฆ
Parameters
resource_classโ the value can be either the ID of a resource class or anResourceClass <#openstack.placement.v1.resource_class.ResourceClass>instance.attrsโ the attributes to update on the resource class represented byresource_class.
Returns โ the updated resource class.
get_resource_class(resource_class) โ gets a single resource_class. ๐ฅ
Parameters
resource_classโ the value can be either the ID of a resource class or anResourceClass <#openstack.placement.v1.resource_class.ResourceClass>instance.
Returns โ an instance of ResourceClass <#openstack.placement.v1.resource_class.ResourceClass>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource class matching the criteria could be found.
resource_classes(**query) โ retrieves a generator of resource classs. Yes, that's the word in the docs โ we're keeping it, bestie ๐ญ
Parameters
queryโ optional query parameters sent to restrict the resource classs to be returned.
Returns โ a generator of resource class instances.
๐ Resource Providers ๐
class openstack.placement.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_resource_provider(**attrs) โ creates a new resource provider from attributes. ๐
Parameters
attrsโ keyword arguments used to create aResourceProvider <#openstack.placement.v1.resource_provider.ResourceProvider>, made up of the properties on theResourceProviderclass.
Returns โ the results of resource provider creation.
delete_resource_provider(resource_provider, ignore_missing=True) โ deletes a resource provider. โญ
Parameters
resource_providerโ the value can be either the ID of a resource provider or anResourceProvider <#openstack.placement.v1.resource_provider.ResourceProvider>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource provider does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent resource provider.
Returns โ None
update_resource_provider(resource_provider, **attrs) โ updates a resource provider. ๐ธ
Parameters
resource_providerโ the value can be either the ID of a resource provider or anResourceProvider <#openstack.placement.v1.resource_provider.ResourceProvider>instance.attrsโ the attributes to update on the resource provider represented byresource_provider.
Returns โ the updated resource provider.
get_resource_provider(resource_provider) โ gets a single resource_provider. ๐ฅ
Parameters
resource_providerโ the value can be either the ID of a resource provider or anResourceProvider <#openstack.placement.v1.resource_provider.ResourceProvider>instance.
Returns โ an instance of ResourceProvider <#openstack.placement.v1.resource_provider.ResourceProvider>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource provider matching the criteria could be found.
find_resource_provider(name_or_id, ignore_missing=True) โ finds a single resource_provider. ๐ซถ
Parameters
name_or_idโ the name or ID of a resource provider.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns โ an instance of ResourceProvider <#openstack.placement.v1.resource_provider.ResourceProvider>
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when no resource provider matching the criteria could be found.
resource_providers(**query) โ retrieves a generator of resource providers. ๐
Parameters
queryโ optional query parameters sent to restrict the resource providers to be returned.
Returns โ a generator of resource provider instances.
get_resource_provider_aggregates(resource_provider) โ gets a list of aggregates for a resource provider. ๐
โ ๏ธ Deprecated since version 4.14.0: use fetch_resource_provider_aggregates() instead. ๐
Okay so set_resource_provider_aggregates(resource_provider, *aggregates) is the one that updates aggregates for a resource provider. Very โnew phone who disโ energy for aggregates.
Parameters
resource_providerโ the value can be either the ID of a resource provider or anResourceProviderinstance (openstack.placement.v1.resource_provider.ResourceProvider). ๐ซถaggregatesโ a list of aggregates. Heads up bestie: these aggregates will replace all aggregates currently present. Itโs a full reset, not a little touch-up. โจ
Returns
An instance of ResourceProvider (openstack.placement.v1.resource_provider.ResourceProvider) with the aggregates attribute populated with the updated value. Obsessed, honestly. ๐
Raises
NotFoundException (openstack.exceptions.NotFoundException) when no resource provider matching the criteria could be found. Rude but fair. ๐ญ
fetch_resource_provider_usages(resource_provider)
Fetch usages for a specific resource provider. Itโs giving โso how much are you actually using, bestie?โ ๐
Parameters
resource_provider โ the value can be either the ID of a resource provider or a ResourceProvider (openstack.placement.v1.resource_provider.ResourceProvider) instance.
Returns
An instance of ResourceProvider (openstack.placement.v1.resource_provider.ResourceProvider) with the usages attribute populated. Slay. โจ
Raises
NotFoundException (openstack.exceptions.NotFoundException) when no resource provider matching the criteria could be found. ๐
๐ Resource Provider Allocations ๐
The proxy class is literally this whole mood:
class openstack.placement.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
resource_provider_allocations(resource_provider, **query)
Retrieve a generator of resource provider allocations. Generator, not a list โ keep that in mind, bestie. ๐
Parameters
resource_providerโ either the ID of a resource provider or aResourceProvider(openstack.placement.v1.resource_provider.ResourceProvider) instance.queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of resource provider inventory allocations. ๐ซ
๐ Resource Provider Inventories ๐
Same proxy class, same big signature, still iconic:
class openstack.placement.v1._proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
create_resource_provider_inventory(resource_provider, resource_class, *, total, **attrs)
Create a new resource provider inventory from attributes. New inventory just dropped. ๐๏ธ
Parameters
resource_providerโ either the ID of a resource provider or aResourceProvider(openstack.placement.v1.resource_provider.ResourceProvider) instance.resource_classโ the value can be either the ID of a resource class or anResourceClass(openstack.placement.v1.resource_class.ResourceClass) instance.totalโ the actual amount of the resource that the provider can accommodate. The real number, no cap. ๐ขattrsโ keyword arguments which will be used to create aResourceProviderInventory(openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory), comprised of the properties on theResourceProviderInventoryclass.
Returns
The results of resource provider inventory creation. ๐
delete_resource_provider_inventory(resource_provider_inventory, resource_provider=None, ignore_missing=True)
Delete a resource provider inventory. Bye-bye, inventory bestie. ๐
Parameters
resource_provider_inventoryโ the value can be either the ID of a resource provider or anResourceProviderInventory(openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory) instance.resource_providerโ either the ID of a resource provider or aResourceProvider(openstack.placement.v1.resource_provider.ResourceProvider) instance. This value must be specified whenresource_provider_inventoryis an ID.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource provider inventory does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent resource provider inventory. ๐ซถ
Returns
None.
update_resource_provider_inventory(resource_provider_inventory, resource_provider=None, *, resource_provider_generation=None, **attrs)
Update a resource providerโs inventory. Little refresh, but make it API. โจ
Parameters
resource_provider_inventoryโ the value can be either the ID of a resource provider inventory or anResourceProviderInventory(openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory) instance.resource_providerโ either the ID of a resource provider or aResourceProvider(openstack.placement.v1.resource_provider.ResourceProvider) instance. This value must be specified whenresource_provider_inventoryis an ID.
Attrs kwargs
The attributes to update on the resource provider inventory represented by resource_provider_inventory. ๐
Returns
The updated resource provider inventory.
get_resource_provider_inventory(resource_provider_inventory, resource_provider=None)
Get a single resource_provider_inventory. One inventory, no group chat. ๐
Parameters
resource_provider_inventoryโ the value can be either the ID of a resource provider inventory or anResourceProviderInventory(openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory) instance.resource_providerโ either the ID of a resource provider or aResourceProvider(openstack.placement.v1.resource_provider.ResourceProvider) instance. This value must be specified whenresource_provider_inventoryis an ID.
Returns
An instance of ResourceProviderInventory (openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory).
Raises
NotFoundException (openstack.exceptions.NotFoundException) when no resource provider inventory matching the criteria could be found. ๐ญ
resource_provider_inventories(resource_provider, **query)
Retrieve a generator of resource provider inventories. Again: generator, not a list. ๐
Parameters
resource_providerโ either the ID of a resource provider or aResourceProvider(openstack.placement.v1.resource_provider.ResourceProvider) instance.queryโ optional query parameters to be sent to limit the resources being returned.
Returns
A generator of resource provider inventory instances. ๐
set_resource_provider_inventories(resource_provider, inventories, resource_provider_generation)
Replace all inventories for a resource provider in a single request. Big main character move: one request, all the inventories. ๐
Parameters
resource_providerโ the value can be either the ID of a resource provider or aResourceProvider(openstack.placement.v1.resource_provider.ResourceProvider) instance.inventoriesโ Adictmapping resource class names to inventory configuration dicts (keys:total, and optionallyallocation_ratio,max_unit,min_unit,reserved,step_size). Pass an emptydictto remove all inventories. ๐๏ธresource_provider_generationโ The current generation of the resource provider, used to detect concurrent updates. ๐
Returns โ The resource provider with its generation updated to reflect the new state. โจ
Raises โ ConflictException if the generation does not match or allocations prevent removal. ๐ฅ
delete_resource_provider_inventories(resource_provider)โ Delete all inventory records for a resource provider. ๐งน- Parameters
resource_providerโ The value can be either the ID of a resource provider or aResourceProviderinstance.
- Returns โ
None - Raises โ
ConflictExceptionif there are active allocations against the resource provider. ๐ฌ
- Parameters
โจ Traits โจ
class openstack.placement.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_trait(name)โ Create a new trait. ๐ฑ- Parameters
nameโ The name of the new trait.
- Returns โ The results of trait creation.
- Parameters
delete_trait(trait, ignore_missing=True)โ Delete a trait. ๐ซก- Parameters
traitโ The value can be either the ID of a trait or aTraitinstance.ignore_missingโ When set toFalse,NotFoundExceptionwill be raised when the resource provider inventory does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent resource provider inventory.
- Returns โ
None
- Parameters
get_trait(trait)โ Get a single trait. ๐- Parameters
traitโ The value can be either the ID of a trait or aTraitinstance.
- Returns โ An instance of
ResourceProviderInventory - Raises โ
NotFoundExceptionwhen no trait matching the criteria could be found.
- Parameters
traits(**query)โ Retrieve a generator of traits. ๐- Parameters
queryโ Optional query parameters to be sent to limit the resources being returned.
- Returns โ A generator of trait objects.
- Parameters
๐ Resource Provider Trait ๐
class openstack.placement.v1._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_resource_provider_trait(resource_provider)โ Get a resource providerโs trait. ๐ง- Parameters
resource_providerโ The value can be either the ID of a resource provider or an instance ofResourceProviderTrait.
- Returns โ An instance of
ResourceProviderTrait.
- Parameters
set_resource_provider_trait(resource_provider_trait, **attrs)โ Update a resource providerโs trait. ๐ ๏ธ- Parameters
resource_provider_traitโ An instance ofResourceProviderTrait.
- Attrs kwargs โ The attributes to update on the resource provider trait represented by
resource_provider_trait. - Returns โ The updated resource provider trait.
- Parameters
delete_resource_provider_trait(resource_provider, ignore_missing=True)โ Dissociate all traits from a resource provider. โ๏ธ- Parameters
resource_providerโ The value can be either the ID of a resource provider or aResourceProviderinstance.ignore_missingโ When set toFalse,NotFoundExceptionwill be raised when the resource provider does not exist. When set toTrue, no exception will be raised when attempting to delete traits for a nonexistent resource provider.
- Returns โ
None
- Parameters
๐ฆ Shared File System API ๐ฆ
๐ The Shared File System Class ๐
The high-level interface for accessing the shared file systems service API is available through the shared_file_system member of a Connection object. The shared_file_system member will only be added if the service is detected. share is an alias of the shared_file_system member. ๐
๐ Availability Zone Operation ๐
Interact with Availability Zones supported by the Shared File Systems service. ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
availability_zones()โ Retrieve shared file system availability zones. ๐บ๏ธ- Returns โ A generator of availability zone resources.
๐ธ Limit Operations ๐ธ
Get absolute limits of resources supported by the Shared File Systems service. ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
limits(**query)โ Lists all share limits. ๐- Parameters
queryโ Optional query parameters to be sent to limit the share limits being returned.
- Returns โ A generator of manila share limits resources.
- Parameters
โญ Quota Class Set Operations โญ
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_quota_class_set(quota_class_set)โ Get quota class set. ๐๏ธ- Parameters
quota_class_setโ The name of the quota class or aQuotaClassSetinstance.
- Returns โ A
QuotaClassSet.
- Parameters
update_quota_class_set(quota_class_set, **attrs)
okay so this one updates a quota class set. Parameters:
quota_class_setโ The name of the quota class ๐attrsโ The attributes to update on the quota class set โจ
Returns: the updated quota class set ๐ซถ
๐ Quota Set Operations ๐
bestie, this is the quota-set corner of the proxy. same iconic class signature, no cap:
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
get_quota_set(project, **query)
Retrieves a specific metadata item for the Quota Set. yes that is literally what it says, and we respect it ๐ซ
Returns: A QuotaSets ๐ธ
update_quota_set(project, **attrs)
Updates details of a quota set. slay, let's edit.
Parameters:
projectโ ID or instance ofProject <#openstack.identity.v3.project.Project>of the project for which the quota should be updated. ๐attrsโ The attributes to update on the quota set. โจ
Returns: The updated quota set ๐
revert_quota_set(project)
Reset quota set for a project. it's giving "undo button" energy.
Parameters:
projectโ ID or instance ofProject <#openstack.identity.v3.project.Project>of the project for which the quota should be reset. ๐
Returns: None ๐ซถ
๐ Service Operations ๐
Interact with services supported by the Shared File Systems service. main character service-management moment.
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
services(**query)
Lists all services. cute. let's see what's running.
Parameters:
queryโ Optional query parameters to be sent to limit the services being returned. Available parameters include:host: The service host name.binary: The service binary name.zone: The availability zone.state: The current state of the service. A valid value isupordown.status: The service status, which isenabledordisabled.
Returns: A generator of manila service resources. ๐ฆ
disable_service(service, host, binary, *, disable_reason=None)
Disable a service. not me hitting the off switch ๐
Parameters:
serviceโ Either the ID of a service or aService <#openstack.shared_file_system.v2.service.Service>instance.hostโ The host where service runs.binaryโ The name of service.disable_reasonโ The reason for disabling the service.
Returns: Updated service instance ๐ธ
enable_service(service, host, binary)
Enable a service. and we're back on, periodt โจ
Parameters:
serviceโ Either the ID of a service or aService <#openstack.shared_file_system.v2.service.Service>instance.hostโ The host where service runs.binaryโ The name of service.
Returns: Updated service instance ๐
ensure_shares_service(host)
Run ensure shares on a back end. very "go check on the shares" of it all.
Parameters:
hostโ The host to run ensure shares on.
๐ Share Operations ๐
Interact with Shares supported by the Shared File Systems service. this is the share girlie section fr fr.
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
shares(details=True, **query)
Lists all shares with details. obsessed with a detailed list ๐
Parameters:
queryโ Optional query parameters to be sent to limit the shares being returned. Available parameters include:status: Filters by a share statusshare_server_id: The UUID of the share server.metadata: One or more metadata key and value pairs as a url encoded dictionary of strings.extra_specs: The extra specifications as a set of one or more key-value pairs.share_type_id: The UUID of a share type to query resources by.name: The user defined name of the resource to filter resources by.snapshot_id: The UUID of the share's base snapshot to filter the request based on.host: The host name of the resource to query with.share_network_id: The UUID of the share network to filter resources by.project_id: The ID of the project that owns the resource.is_public: A boolean query parameter that, when set totrue, allows retrieving public resources that belong to all projects.share_group_id: The UUID of a share group to filter resource.export_location_id: The export location UUID that can be used to filter shares or share instances.export_location_path: The export location path that can be used to filter shares or share instances.name~: The name pattern that can be used to filter shares, share snapshots, share networks or share groups.description~: The description pattern that can be used to filter shares, share snapshots, share networks or share groups.with_count: Whether to show count in API response or not, default isFalse.limit: The maximum number of shares to return.offset: The offset to define start point of share or share group listing.sort_key: The key to sort a list of shares.sort_dir: The direction to sort a list of shares. A valid value isasc, ordesc.
Returns: Details of shares resources ๐
find_share(name_or_id, ignore_missing=True, **query)
Find a single share. detective mode: activated ๐
Parameters:
name_or_idโ The name or ID of a share.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. ๐ซถqueryโ Any additional parameters to be passed into underlying methods. such as query filters.
Returns: One Share <#openstack.shared_file_system.v2.share.Share> or None ๐ฆ
get_share(share)
Lists details of a single share. just one little share, as a treat.
Parameters:
shareโ The value can be the ID of a share or aShare <#openstack.shared_file_system.v2.share.Share>instance.
Returns: Details of the identified share ๐
delete_share(share, ignore_missing=True, *, force=False)
Deletes a single share. okay bye bestie ๐
Parameters:
shareโ The value can be either the ID of a share or aShare <#openstack.shared_file_system.v2.share.Share>instance.ignore_missingโ set this toFalseand you'll get aNotFoundException <#openstack.exceptions.NotFoundException>thrown at you whenever the share doesn't exist. Set it toTrueand it justโฆ doesn't care. No exception when you try to delete a share that isn't there. Honestly? Self-care. ๐forceโ set toTrueand the share deletion gets forced immediately. No waiting around, no queuing, just yeet. ๐ฅ
Returns โ None
update_share(share, **attrs)
Updates the details of a single share. Glow-up time โจ
Parameters
shareโ the ID of the share you're updatingattrsโ the attributes you want to update on that share
Returns โ the updated share, looking all fresh ๐
create_share(**attrs)
Makes a brand new share out of attributes. Baby's first share, so proud ๐ฅน
Parameters
attrsโ the attributes used to create a Shares, made up of the properties on the Shares class. Important one, bestie:sizeandshareare required to create a share. No cap.
Returns โ the details of the new share ๐
revert_share_to_snapshot(share, snapshot)
Reverts a share back to the snapshot you specify โ and heads up, it has to be the most recent snapshot known to manila. The way it's gotta be the latest one, no exceptions ๐
Parameters
shareโ the ID of the share to revertsnapshotโ the ID of the snapshot to revert to
Returns โ the result of the revert
manage_share(protocol, export_path, service_host, **params)
Manages a share. Very "adopting a stray" energy ๐พ
Parameters
protocolโ the shared file systems protocol of this shareexport_pathโ the export path, formatted according to the protocolservice_hostโ the manage-share service hostparamsโ optional parameters to be sent. The available ones are:name: the user defined name of the resource.share_type: the name or ID of the share type to be used to create the resource.driver_options: a set of one or more key and value pairs, as a dictionary of strings, that describe driver options.is_public: the level of visibility for the share.description: the user defiend description of the resource. (yes that typo is theirs, we keep it ๐)share_server_id: the UUID of the share server.
Returns โ the share that was managed ๐ซถ
unmanage_share(share)
Unmanages the share with the given share ID. Letting it go, it's not you it's me ๐ญ
Parameters
shareโ the ID of the share to unmanage
Returns โ None
resize_share(share, new_size, no_shrink=False, no_extend=False, force=False)
Resizes a share, extending or shrinking it as needed. Growth arc, or shrinkage arc, either way ๐ธ
Parameters
shareโ the ID of the share to resizenew_sizeโ the new size of the share, in GiBs. Ifnew_sizeis the same as the current size, then literally nothing happens. Nothing. Zip.no_shrinkโ if set toTrue, the given share is not shrunk, even if shrinking is required to get it to the given size. Useful for extending shares up to a minimum size while not shrinking shares down to the given size. Defaults toFalse.no_extendโ if set toTrue, the given share is not extended, even if extending is required to get it to the given size. Useful for shrinking shares down to a maximum size while not extending smaller shares up to that maximum. Defaults toFalse.forceโ whether or not force should be used, in the case where the share should be extended.
Returns โ None
soft_delete_share(share)
Soft deletes a share. Gentle deletion. Soft launch into the void ๐ฆ
Parameters
shareโ the value can be either the ID of a share or aShare <#openstack.shared_file_system.v2.share.Share>instance.
Returns โ None
restore_share(share)
Restores the share with the given share ID. Bringing it back, main character return arc ๐
Parameters
shareโ the value can be either the ID of a share or aShare <#openstack.shared_file_system.v2.share.Share>instance.
Returns โ None
reset_share_status(share, status)
Resets a share to the status you specify. Factory reset but make it cloud โ๏ธ
Parameters
shareโ the ID of the share or the share object to resetstatusโ the status to reset the share to. Possible values include:available,error, andinvalid.
Returns โ None
๐ Share Access Rule Operations ๐
Create, View, and Delete access rules for shares from the Shared File Systems service. Access rules can also have their deletion and visibility restricted during creation. A lock reason can also be specified. And the deletion restriction can be removed during the access removal. So many little knobs, we love a configurable queen ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
access_rules(share, **query)
Lists the access rules on a share. Read the room, read the rules ๐
Returns โ a generator of the share access rules
get_access_rule(access_rule)
Lists details of an access rule. Getting the full dossier ๐
Parameters
access_ruleโ the value can be the ID of an access rule or aShareAccessRule <#openstack.shared_file_system.v2.share_access_rule.ShareAccessRule>instance.
Returns โ the details of the identified access rule
create_access_rule(share, **attrs)
Creates an access rule from attributes. New rule just dropped โจ
Parameters
shareโ the ID of the shareattrsโ the attributes used to create a ShareAccessRules, made up of the properties on the ShareAccessRules class.
Returns โ the details of the new access rule
delete_access_rule(access_rule, share, ignore_missing=True, *, unrestrict=False)
Deletes an access rule. Bye bestie ๐
Parameters
access_ruleโ the value can be either the ID of an access rule or aShareAccessRule <#openstack.shared_file_system.v2.share_access_rule.ShareAccessRule>instance.shareโ the ID of the share.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the access rule does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent access rule. (Default isTrue, so it's forgiving by default, love that for you ๐)unrestrictโ if Manila must attempt removing locks while deleting.
Returns โ requests.models.Response HTTP response from the internal requests client
๐ฏ Share Group Operations ๐ฏ
Interact with Share groups supported by the Shared File Systems service. Squad goals, but storage โ๏ธ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
share_groups(**query)
Lists all share groups. Roll call! ๐ฃ๏ธ
Parameters
queryโ optional query parameters to send along to limit the share groups being returned. The available ones are:status: filters by a share group status.name: the user defined name of the resource to filter resources by.description: the user defined description text that can be used to filter resources.project_id: the project ID of the user or service.
share_server_idโ the UUID of the share server ๐ฅ๏ธsnapshot_idโ the UUID of the share's base snapshot, so you can filter the request based on it ๐ธhostโ the host name for the back end ๐share_network_idโ the UUID of the share network you wanna filter resources by ๐share_group_type_idโ the share group type ID, used to filter share groups ๐๏ธshare_group_snapshot_idโ the source share group snapshot ID, for listing the share group ๐ซshare_typesโ a list of one or more share type IDs. Lets you filter share groups โจlimitโ the max number of share groups members to return ๐ขoffsetโ the offset that defines the start point of the share or share group listing ๐sort_keyโ the key to sort a list of shares ๐sort_dirโ the direction to sort a list of shares โ๏ธname~โ the name pattern you can use to filter shares, share snapshots, share networks or share groups ๐description~โ the description pattern you can use to filter shares, share snapshots, share networks or share groups ๐
Returns
A generator of manila share group resources ๐
get_share_group(share_group)
Lists details for a share group. Like, the full tea ๐
Parameters
- share_group โ the value can be the ID of a share group or a
ShareGroup <#openstack.shared_file_system.v2.share_group.ShareGroup>instance.
Returns
Details of the identified share group โจ
find_share_group(name_or_id, ignore_missing=True)
Finds a single share group. Just the one. No cap ๐ฏ
Parameters
- name_or_id โ the name or ID of a share group.
- ignore_missing โ when it's set to
False,NotFoundException <#openstack.exceptions.NotFoundException>gets raised if the resource doesn't exist. When it'sTrue,Nonegets returned instead when you try to find a resource that isn't there ๐
Returns
One ShareGroup <#openstack.shared_file_system.v2.share_group.ShareGroup> or None
create_share_group(**attrs)
Creates a share group from attributes. Build-a-group workshop ๐ ๏ธ
Returns
Details of the new share group ๐
update_share_group(share_group, **attrs)
Updates details of a single share group. Glow-up time ๐
Parameters
- share_group โ the ID of the share group
Returns
Updated details of the identified share group โจ
delete_share_group(share_group, ignore_missing=True)
Deletes a single share group. Gone, bye ๐
Parameters
- share_group โ the value can be either the ID of a share group or a
ShareGroup <#openstack.shared_file_system.v2.share_group.ShareGroup>instance. - ignore_missing โ when it's set to
False,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the share group doesn't exist. When it'sTrue, no exception gets set when you try to delete a share group that isn't there ๐
Returns
The deleted share group.
๐ฆ Share Group Snapshot Operations ๐ฆ
Interact with Share Group Snapshots by the Shared File Systems service. Literally its whole job ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
share_group_snapshots(details=True, **query)
Lists all share group snapshots. The whole collection, bestie ๐๏ธ
Parameters
query โ
Optional query parameters that get sent along to limit the share group snapshots being returned. The available parameters include:
project_idโ the ID of the project that owns the resource ๐ท๏ธnameโ the user defined name of the resource, for filtering resources ๐descriptionโ the user defined description text that can be used to filter resources ๐statusโ filters by a share status ๐ฆshare_group_idโ the UUID of a share group to filter resource ๐limitโ the max number of share group snapshot members to return ๐ขoffsetโ the offset that defines the start point of the share or share group listing ๐sort_keyโ the key to sort a list of shares ๐sort_dirโ the direction to sort a list of shares. A valid value isasc, ordescโ๏ธ
Returns
Details of share group snapshots resources โจ
get_share_group_snapshot(group_snapshot)
Show share group snapshot details. Spill the details, honestly ๐
Parameters
- group_snapshot โ the value can be the ID of a share group snapshot or a
ShareGroupSnapshot <#openstack.shared_file_system.v2.share_group_snapshot.ShareGroupSnapshot>instance.
Returns
Details of the group snapshot ๐
create_share_group_snapshot(share_group, **attrs)
Creates a point-in-time snapshot copy of a share group. Freeze frame, but make it storage ๐ธ
Parameters
- share_group โ ID of the share group to have the snapshot taken.
- attrs โ attributes which will be used to create a
ShareGroupSnapshots,
Returns
Details of the new snapshot ๐
reset_share_group_snapshot_status(group_snapshot, status)
Reset share group snapshot state. Ctrl+Z for the state machine, kinda ๐
Parameters
- group_snapshot โ the ID of the share group snapshot to reset
- status โ the state of the share group snapshot to be set, a valid value is
"creating","error","available","deleting","error_deleting".
update_share_group_snapshot(group_snapshot, **attrs)
Updates a share group snapshot โจ
Parameters
- group_snapshot โ the ID of the share group snapshot to update
- attrs โ the attributes to update on the share group snapshot
Returns
the updated share group snapshot ๐
delete_share_group_snapshot(group_snapshot, ignore_missing=True)
Deletes a share group snapshot. Yeet ๐๏ธ
Parameters
- group_snapshot โ the value can be either the ID of a share group snapshot or a
ShareGroupSnapshot <#openstack.shared_file_system.v2.share_group_snapshot.ShareGroupSnapshot>instance. - ignore_missing โ when it's set to
False,NotFoundException <#openstack.exceptions.NotFoundException>gets raised when the share group snapshot doesn't exist. When it'sTrue, no exception gets set when you try to delete a share group snapshot that isn't there ๐
Returns
None
๐ Share Instance Operations ๐
Admins can list, show information for, explicitly set the state of, and force-delete share instances within the Shared File Systems Service. Admin business only, fr fr ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
share_instances(**query)
Lists all share instances ๐
Parameters
query โ
Optional query parameters that get sent along to limit the share instances being returned. The available parameters include:
export_location_idโ the export location UUID that can be used to filter share instances ๐export_location_pathโ the export location path that can be used to filter share instances ๐ค๏ธ
Returns
Details of share instances resources โจ
get_share_instance(share_instance)
Shows details for a single share instance ๐
Parameters
share_instanceโ the value can be the UUID of a share instance or aShareInstanceinstance. ๐ฆ
Returns โ Details of the identified share instance
reset_share_instance_status(share_instance, status)
Explicitly updates the state of a share instance. ๐
Parameters
share_instanceโ The UUID of the share instance to reset.statusโ The share or share instance status to be set.
Returns โ None
delete_share_instance(share_instance, ignore_missing=True)
Force-deletes a share instance ๐ญ๐ฅ
Parameters
share_instanceโ The value can be either the ID of a share instance or aShareInstanceinstance.ignore_missingโ When set toFalseNotFoundExceptionwill be raised when the share instance does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent share instance.
Returns โ None
๐ธ Share Metadata Operations โจ
List, Get, Create, Update, and Delete metadata for shares from the Shared File Systems service. ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
get_share_metadata(share)
Lists all metadata for a share. ๐ง
๐จ Deprecated since version4.14.0: Usefetch_share_metadata()instead.
get_share_metadata_item(share, key)
Retrieves a specific metadata item from a share by its key. ๐
๐จ Deprecated since version4.14.0: Usefetch_share_metadata_item()instead.
create_share_metadata(share, **metadata)
Creates share metadata as key-value pairs. ๐
๐จ Deprecated since version4.14.0: Useset_share_metadata()instead.
update_share_metadata(share, metadata, replace=False)
Updates metadata of given share. โจ
๐จ Deprecated since version4.14.0: Useset_share_metadata()instead.
delete_share_metadata(share, keys, ignore_missing=True)
Deletes metadata for a share. ๐ซถ
Parameters
shareโ The value can be either the ID of a share or aShareinstance.keysโ The list of share metadata keys to be deleted.ignore_missingโ When set toTrue, missing keys will be logged but not cause a failure. When set toFalse, missing keys will be included in the failure list.
Returns โ None
๐ Share Network Operations ๐
Create and manipulate Share Networks with the Shared File Systems service. ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
share_networks(details=True, **query)
Lists all share networks with details. ๐ฆ
Parameters
queryโ Optional query parameters to be sent to limit the resources being returned. Available parameters include:name~: The user defined name of the resource to filter resources by.project_id: The ID of the user or service making the request.description~: The description pattern that can be used to filter shares, share snapshots, share networks or share groups.all_projects: (Admin only). Defines whether to list the requested resources for all projects.
Returns โ Details of shares networks
get_share_network(share_network)
Lists details of a single share network. ๐ธ
Parameters
share_networkโ The value can be the ID of a share network or aShareNetworkinstance.
Returns โ Details of the identified share network
delete_share_network(share_network, ignore_missing=True)
Deletes a single share network. ๐
Parameters
share_networkโ The value can be either the ID of a share network or aShareNetworkinstance.ignore_missingโ When set toFalseNotFoundExceptionwill be raised when the share network does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent share network.
Returns โ None
update_share_network(share_network, **attrs)
Updates details of a single share network. โจ
Parameters
share_networkโ The ID of the share network to update.attrsโ The attributes to update on the share network.
Returns โ the updated share network
create_share_network(**attrs)
Creates a share network from attributes. ๐
Returns โ Details of the new share network
Parameters
attrsโ Attributes which will be used to create aShareNetwork,comprised of the properties on theShareNetworkclass.
๐ฆ Share Network Subnet Operations ๐
Create and manipulate Share Network Subnets with the Shared File Systems service. โญ
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
share_network_subnets(share_network)
Lists all share network subnets with details. ๐
Parameters
share_networkโ The id of the share network for which Share Network Subnets should be listed.
Returns โ A generator of manila share network subnets
get_share_network_subnet(share_network, share_network_subnet)
Lists details of a single share network subnet. ๐ฅ
Parameters
share_networkโ The value can be the ID of a share network or aShareNetworkinstance.share_network_subnetโ The value can be the ID of a share network subnet or aShareNetworkSubnetinstance.
Returns โ Details of the identified share network subnet
create_share_network_subnet(share_network, **attrs)
Creates a share network subnet from attributes. ๐ง
Parameters
share_networkโ The id of the share network wthin which the the Share Network Subnet should be created.attrsโ Attributes which will be used to create a share network subnet.
Returns โ Details of the new share network subnet.
delete_share_network_subnet(share_network, share_network_subnet, ignore_missing=True)
Deletes a share network subnet. ๐ฅ
Parameters
โฆand the params it takes:
share_networkโ ngl you can pass either the ID of a share network or an actualShareNetworkinstance, whichever you have lying around ๐share_network_subnetโ same energy: either the ID of a share network subnet or aShareNetworkSubnetinstance.ignore_missingโ set this toFalseand boom,NotFoundExceptiongets raised when the share network subnet doesn't exist. Set it toTrueand literally nothing happens when you try to delete a nonexistent share network subnet โ no exception, no drama, no cap.
Returns
None โ that's it, that's the whole return value, bestie ๐
fetch_share_network_subnet_metadata(share_network, share_network_subnet)
Lists, like, all the metadata of a given share network subnet. Every last crumb ๐
Parameters
share_networkโ the ID of a share network or aShareNetworkinstance.share_network_subnetโ the ID of a share network subnet or aShareNetworkSubnetinstance.
Returns
Details of the identified share network subnet, including its metadata. Iconic.
fetch_share_network_subnet_metadata_item(share_network, share_network_subnet, key)
Retrieve one specific subnet metadata item, by key. Very "I know exactly what I'm looking for" of you โจ
Parameters
share_networkโ the ID of a share network or aShareNetworkinstance.share_network_subnetโ the ID of a share network subnet or aShareNetworkSubnetinstance.keyโ the key of the Share Network Subnet Metadata.
Returns
A single metadata key and value pair. One (1) little guy ๐
set_share_network_subnet_metadata(share_network, share_network_subnet, *, replace=False, **metadata)
Updates metadata of given share network subnet. Glow-up time ๐ธ
Parameters
share_networkโ the ID of a share network or aShareNetworkinstance.share_network_subnetโ the ID of a share network subnet or aShareNetworkSubnetinstance.metadataโ the metadata to be created.
Returns
Details of the identified share network subnet.
delete_share_network_subnet_metadata(share_network, share_network_subnet, keys, ignore_missing=True)
Deletes one or more subnet metadata items, identified by their keys. Bye bestie ๐
Parameters
share_networkโ the ID of a share network or aShareNetworkinstance.share_network_subnetโ the ID of a share network subnet or aShareNetworkSubnetinstance.keysโ the keys of the metadata items to be deleted.
Returns
None โ nothing back, just vibes ๐ซถ
๐ Share Replica Operations ๐
Interact with share replicas, which the Shared File Systems service supports. Copies upon copies, we love redundancy ๐
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ซ create_share_replica(share, **attrs)
Creates a share replica from attributes. New replica just dropped ๐ฅ
Parameters
shareโ Id of the share for which share replica is to be created.attrsโ optional attributes which will be used to create. Available parameters include:availability_zone: availability zone in which replica should be created.
Returns
Details of the new share replica.
๐ซ share_replicas(**attrs)
List all share replicas with all details. The full tea โ
Parameters
attrsโ optional parameters to limit the share replicas being returned. Available parameters include:share_id: id of the share for which share replicas are wantedcolumns: list of columns to be displayed in the returned list
Returns
A generator of share replicas.
๐ซ get_share_replica(share_replica)
List details of a single share replica. Just the one, main character style ๐
Parameters
share_replicaโ Id of the share replica.
Returns
Details of the identified share replica.
๐ซ delete_share_replica(share_replica, ignore_missing=True, force=False)
Delete a share replica. Gone, reduced to atoms ๐
Parameters
share_replicaโ Id of the share replica.
Returns
Result of delete on share replica.
๐ซ reset_share_replica_status(share_replica, status)
Reset status of the share replica. Factory reset but make it storage ๐ง
Parameters
share_replicaโ Id of the share replica.statusโ set the status to the share replica. Possible values include:available,error,creating,deleting, orerror_deleting.
Returns
None.
๐ซ reset_share_replica_state(share_replica, replica_state)
Reset replica_state of the share replica. Different reset, same energy โจ
Parameters
share_replicaโ Id of the share replica.replica_stateโ the replica state of a share replica. Possible values include:active,in_sync,out_of_sync, anderror.
Returns
None.
๐ซ promote_share_replica(share_replica)
Promote share replica. Give it a lil promotion, it earned it ๐
Parameters
share_replicaโ Id of the share replica.
Returns
None.
๐ซ resync_share_replica(share_replica)
Resync share replica. Get it back in sync with the group chat ๐ซถ
Parameters
share_replicaโ Id of the share replica.
Returns
None.
๐ฆ Share Snapshot Operations ๐ฆ
Interact with Share Snapshots, which the Shared File Systems service supports. Freeze frame, but for storage ๐ธ
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
๐ธ share_snapshots(details=True, **query)
Lists all share snapshots with details. All of them. Every single one ๐
Parameters
queryโ optional query parameters to be sent to limit the snapshots being returned. Available parameters include:project_id: the ID of the user or service making the API request.
Returns
A generator of manila share snapshot resources.
๐ธ get_share_snapshot(snapshot)
Lists details of a single share snapshot. Spotlight on one ๐ค
Parameters
snapshotโ the value can be the ID of a share snapshot or aShareSnapshotinstance.
Returns
Details of the identified share snapshot.
๐ธ create_share_snapshot(**attrs)
Creates a share snapshot from attributes. New snapshot, who dis ๐
Returns
Details of the new share snapshot.
update_share_snapshot(snapshot, **attrs)
Okay bestie, this is the little glow-up button for one share โจ
Parameters
snapshotโ The ID of the snapshot to updateattrsโ The attributes to update on the snapshot
Returns: the updated share snapshot โ iconic ๐
delete_share_snapshot(snapshot, ignore_missing=True, *, force=False)
Deletes a single share snapshot. Bye-bye, snapshot ๐ซถ
Parameters
snapshotโ The value can be either the ID of a share snapshot or aShareSnapshotinstance (class pathopenstack.shared_file_system.v2.share_snapshot.ShareSnapshot).ignore_missingโ When set toFalse,NotFoundException(class pathopenstack.exceptions.NotFoundException) will be raised when the share snapshot does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent share snapshot.forceโ When set toTrue, the share snapshot deletion will be forced immediately.
Returns: None
๐จ Heads up: force=True means the deletion is forced immediately. No chill, no waiting around.
reset_share_snapshot_status(snapshot, status)
Reset status of share snapshot. A little reset era for your snapshot ๐ธ
Parameters
snapshotโ The ID of the snapshot or the snapshot object to resetstatusโ The status of the snapshot to reset to.
Returns: None
manage_share_snapshot(share, provider_location, **params)
Manage a share snapshot. Bringing it under your wing ๐
Parameters
shareโ The ID of the share that has snapshot which should be managed.provider_locationโ Provider location of the snapshot on the backend.paramsโ Optional parameters to be sent. Available parameters include:name: The user defined name of the resource.display_name: The user defined name of the resource. This field sets thenameparameter.description: The user defined description of the resource.display_description: The user defined description of the resource. This field sets thedescriptionparameter.driver_options: A set of one or more key and value pairs, as a dictionary of strings, that describe driver options.
Returns: The share snapshot that was managed.
unmanage_share_snapshot(snapshot)
Unmanage the share snapshot with the given snapshot ID. Letting it go, lowkey ๐ฆ
Parameters
snapshotโ The ID of the share snapshot to unmanage.
Returns: None
fetch_share_snapshot_metadata(snapshot)
Lists all metadata for a given snapshot. Metadata scavenger hunt ๐ฅ
Parameters
snapshotโ The value can be the ID of a share snapshot or aShareSnapshotinstance (class pathopenstack.shared_file_system.v2.share_snapshot.ShareSnapshot).
Returns: One or more metadata key and value pairs as a dictionary of strings.
fetch_share_snapshot_metadata_item(snapshot, key)
Retrieves a specific metadata item from a snapshot's metadata by its key. One little metadata gem at a time ๐
Parameters
snapshotโ The value can be the ID of a share snapshot or aShareSnapshotinstance (class pathopenstack.shared_file_system.v2.share_snapshot.ShareSnapshot).keyโ The key of the snapshot metadata.
Returns: A single metadata key and value pair.
set_share_snapshot_metadata(snapshot, *, replace=False, **metadata)
Updates metadata of given share snapshot. Metadata makeover time โจ
Parameters
snapshotโ The value can be the ID of a share snapshot or aShareSnapshotinstance (class pathopenstack.shared_file_system.v2.share_snapshot.ShareSnapshot).replaceโ Boolean for whether the preexisting metadata should be replacedmetadataโ The metadata to be created.
Returns: One or more metadata key and value pairs as a dictionary of strings.
delete_share_snapshot_metadata(snapshot, keys)
Deletes metadata for a snapshot. Clean sweep ๐ง
Parameters
snapshotโ The value can be the ID of a share snapshot or aShareSnapshotinstance (class pathopenstack.shared_file_system.v2.share_snapshot.ShareSnapshot).keysโ The keys of the metadata items to be deleted.
Returns: None
๐ฆ Share Snapshot Instance Operations ๐ฆ
Interact with Share Snapshot Instances supported by the Shared File Systems service.
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
share_snapshot_instances(details=True, **query)
Lists all share snapshot instances with details. It's giving inventory energy ๐
Parameters
detailsโ Whether to fetch detailed resource descriptions. Defaults toTrue.queryโ Optional query parameters to be sent to limit the share snapshot instance being returned. Available parameters include:snapshot_id: The UUID of the share's base snapshot to filter the request based on.project_id: The project ID of the user or service making the request.
Returns: A generator of share snapshot instance resources
get_share_snapshot_instance(share_snapshot_instance)
Lists details of a single share snapshot instance. One snapshot instance, main character spotlight ๐
Parameters
share_snapshot_instanceโ The value can be the ID of a share snapshot instance or aShareSnapshotInstanceinstance (class pathopenstack.shared_file_system.v2.share_snapshot_instance.ShareSnapshotInstance).
Returns: Details of the identified snapshot instance
๐ Share Type Operations ๐
Interact with Share Types supported by the Shared File Systems service.
class openstack.shared_file_system.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
share_types(**query)
List shared file system share types. Share type catalog vibes ๐๏ธ
Parameters
queryโ Optional query parameters to be sent to limit the share types being returned. Available parameters include:extra_specs: The extra specifications as a set of one or more key-value pairs.is_public: A boolean query parameter that, when set totrue, allows retrieving public resources that belong to all projects.
Returns: A generator of share type resources
get_share_type(share_type)
List details of a single share type. Peeking at one share type's whole deal ๐
Parameters
share_typeโ The ID of the share type
Returns: Details of identified share type
create_share_type(name, **attrs)
Creates a share from attributes. New share type just dropped ๐
Returns: Details of the new share type
Parameters
nameโ Name of the new share typeattrsโ Attributes which will be used to create aShareType(class pathopenstack.shared_file_system.v2.share_type.ShareType), comprised of the properties on theShareTypeclass. Currently"description"and"extra_specs"are allowed attributes.
delete_share_type(share_type, ignore_missing=True)
Deletes a single share type. Another one bites the dust ๐
Parameters
share_typeโ the ID of the share type ๐
Returns None โ that's it, nothing comes back, periodt.
update_share_type(share_type, **attrs)
Updates details of one single share type, lowkey precise.
Parameters
share_typeโ the ID of the share type to update.attrsโ the attributes to update on the share type.
Returns Updated details of the identified share type โจ
update_share_type_extra_specs(share_type, **attrs)
Updates the extra_specs for a type. Yes bestie, the signature says **attrs and the parameter is extra_specs โ that's just how it is.
Parameters
share_typeโ The ID of the share type.extra_specsโ The extra specs to update on the share type.
Returns The updated share type.
delete_share_type_extra_spec_property(share_type, prop, ignore_missing=False)
Deletes the extra_specs for a share type. Cleanup era ๐งน
Parameters
share_type_idโ The ID of the share type.propโ The extra spec to delete.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the flavor or extra spec does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent flavor extra spec.
Returns None
๐ซง Storage Pool Operations ๐ซง
Interact with the storage pool statistics exposed by the Shared File Systems Service. Pool stats, but make it a vibe.
Same Proxy constructor signature, still iconic:
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
storage_pools(details=True, **query)
Lists all back-end storage pools with details. We love a detailed pool moment ๐ซถ
Parameters
queryโ Optional query parameters to be sent to limit the storage pools being returned. Available parameters include:pool_name: The pool name for the back end.host_name: The host name for the back end.backend_name: The name of the back end.capabilities: The capabilities for the storage back end.share_type: The share type name or UUID.
Returns A generator of manila storage pool resources ๐
๐ Resource Lock Operations ๐
Create, list, update and delete locks for resources. When a resource is locked, it means that it can be deleted only by services, admins or the user that created the lock. So yes, the lock is the main character.
Same Proxy constructor signature, again, because consistency ate:
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
resource_locks(**query)
Lists all resource locks. Lock listing, but make it filtered ๐
Parameters
queryโ Optional query parameters to be sent to limit the resource locks being returned. Available parameters include:project_id: The project ID of the user that the lock is created for.user_id: The ID of a user to filter resource locks by.all_projects: list locks from all projects (Admin Only)resource_id: The ID of the resource that the locks pertain to filter resource locks by.resource_action: The action prevented by the filtered resource locks.resource_type: The type of the resource that the locks pertain to filter resource locks by.lock_context: The lock creator's context to filter locks by.lock_reason: The lock reason that can be used to filter resource locks. (Inexact search is also available withlock_reason~)created_since: Search for the list of resources that were created after the specified date. The date is in'yyyy-mm-dd'format.created_before: Search for the list of resources that were created prior to the specified date. The date is in'yyyy-mm-dd'format.limit: The maximum number of resource locks to return.offset: The offset to define start point of resource lock listing.sort_key: The key to sort a list of shares.sort_dir: The direction to sort a list of shareswith_count: Whether to show count in API response or not, default isFalse. This query parameter is useful with pagination.
Returns A generator of manila resource locks ๐ฅ
get_resource_lock(resource_lock)
Shows details of a resource lock. Gimme the lore ๐
Parameters
resource_lockโ The ID of a resource lock or aResourceLockinstance.
Returns Details of the identified resource lock.
update_resource_lock(resource_lock, **attrs)
Updates details of a single resource lock. Glow-up service, but for locks.
Parameters
resource_lockโ The ID of a resource lock or aResourceLockinstance.attrsโ The attributes to update on the resource lock.
Returns the updated resource lock
delete_resource_lock(resource_lock, ignore_missing=True)
Deletes a single resource lock. Bye bestie ๐ฆ
Parameters
resource_lockโ The ID of a resource lock or aResourceLockinstance.ignore_missingโ When set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource lock does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent resource lock.
Returns The deleted resource lock.
create_resource_lock(**attrs)
Locks a resource. Lock it down, respectfully ๐
Parameters
attrsโ Attributes which will be used to create aResourceLock, comprised of the properties on theResourceLockclass. Available parameters include:resource_id: ID of the resource to be locked.resource_type: type of the resource (share,access_rule).resource_action: action to be locked (delete,show).lock_reason: reason why you're locking the resource (Optional).
Returns Details of the lock
๐ User Message Operations ๐
View and manipulate asynchronous user messages emitted by the Shared File Systems service. Messages, but they're asynchronous and a little mysterious.
Same Proxy constructor signature one more time, because it's literally the same class:
class openstack.shared_file_system.v2._proxy.Proxy(session, *,
service_type=None, service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
user_messages(**query)
Lists shared file system user messages ๐ฌ
Parameters
queryโ Optional query parameters to be sent to limit the messages being returned. Available parameters include:action_idโ the ID of the action during which the message was created. ๐ต๏ธโโ๏ธdetail_idโ the ID of the message detail.limitโ the maximum number of shares to return. (yes, shares โ that's literally what it says ๐)message_levelโ the message level.offsetโ the offset that defines the start point of share or share group listing.sort_keyโ the key to sort a list of messages by.sort_dirโ the direction to sort a list of shares.project_idโ the ID of the project for which the message was created.request_idโ the ID of the request during which the message was created.resource_idโ the UUID of the resource for which the message was created.resource_typeโ the type of the resource for which the message was created.
Returns โ a generator of user message resources.
get_user_message(message) โ lists the deets of a single user message ๐
Parameters
messageโ the value can be the ID of a user message or aUserMessage <#openstack.shared_file_system.v2.user_message.UserMessage>instance.
Returns โ details of the identified user message.
delete_user_message(message, ignore_missing=True) โ deletes a single user message ๐๏ธ
Parameters
messageโ the value can be either the ID of a user message or aUserMessage <#openstack.shared_file_system.v2.user_message.UserMessage>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the user message does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent user message.
Returns โ the deleted user message.
๐ฆ Workflow API ๐ฆ
โจ The Workflow Class โจ
The workflow high-level interface is available through the workflow member of a Connection <#openstack.connection.Connection> object. The workflow member will only be added if the service is detected. ๐
๐ธ Workflow Operations ๐ธ
class openstack.workflow.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_workflow(**attrs)
Creates a new workflow from attributes. โจ
Parameters
attrsโ keyword arguments which will be used to create aWorkflow <#openstack.workflow.v2.workflow.Workflow>, comprised of the properties on the Workflow class.
Returns โ the results of workflow creation.
update_workflow(workflow, **attrs)
Updates a workflow from attributes. ๐ ๏ธ
Parameters
workflowโ the value can be either the name of a workflow or aWorkflow <#openstack.workflow.v2.workflow.Workflow>instance.attrsโ keyword arguments which will be used to update aWorkflow <#openstack.workflow.v2.workflow.Workflow>, comprised of the properties on the Workflow class.
Returns โ the results of workflow update.
get_workflow(workflow)
Gets a workflow. ๐ฏ
Parameters
workflowโ the value can be the name of a workflow orWorkflow <#openstack.workflow.v2.workflow.Workflow>instance.
Returns โ one Workflow <#openstack.workflow.v2.workflow.Workflow>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no workflow matching the name could be found.
workflows(**query)
Retrieves a generator of workflows. ๐
Parameters
queryโ optional query parameters to be sent to restrict the workflows to be returned. Available parameters include:limitโ requests at most the specified number of items be returned from the query.markerโ specifies the ID of the last-seen workflow. Use thelimitparameter to make an initial limited request and use the ID of the last-seen workflow from the response as themarkerparameter value in a subsequent limited request.
Returns โ a generator of workflow instances.
delete_workflow(value, ignore_missing=True)
Deletes a workflow. ๐ฅ
Parameters
valueโ the value can be either the name of a workflow or aWorkflow <#openstack.workflow.v2.workflow.Workflow>instance.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the workflow does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent workflow.
Returns โ the deleted workflow.
find_workflow(name_or_id, ignore_missing=True)
Finds a single workflow. ๐
Parameters
name_or_idโ the name or ID of an workflow.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.
Returns โ One Extension or None (yes bestie, Extension โ we're just reading the menu ๐).
๐ Execution Operations ๐
class openstack.workflow.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_execution(**attrs)
Creates a new execution from attributes. ๐ฅ
Parameters
workflow_nameโ the name of target workflow to execute.attrsโ keyword arguments which will be used to create aExecution <#openstack.workflow.v2.execution.Execution>, comprised of the properties on the Execution class.
Returns โ the results of execution creation.
get_execution(execution)
Gets a execution. ๐
Parameters
executionโ the value can be either the ID of a execution or aExecution <#openstack.workflow.v2.execution.Execution>instance.
Returns โ one Execution <#openstack.workflow.v2.execution.Execution>.
Raises NotFoundException <#openstack.exceptions.NotFoundException> when no execution matching the criteria could be found.
executions(**query)
Retrieves a generator of executions. ๐
Parameters
queryโ optional query parameters to be sent to restrict the executions to be returned. Available parameters include:limitโ requests at most the specified number of items be returned from the query.markerโ specifies the ID of the last-seen execution. Use thelimitparameter to make an initial limited request and use the ID of the last-seen execution from the response as themarkerparameter value in a subsequent limited request.
Returns โ a generator of execution instances.
delete_execution(value, ignore_missing=True)
Deletes an execution. ๐
Parameters
valueโ the value can be either the name of a execution or a Execution instance.ignore_missingโ set this toFalseand boom ๐ aNotFoundException(openstack.exceptions.NotFoundException) gets raised the moment the execution doesn't exist. Set it toTrueand literally nothing happens โ no exception gets set when you try to delete a nonexistent execution. It's giving "no thoughts, head empty" and honestly? valid ๐ซถ
Returns โ the deleted execution.
find_execution(name_or_id, ignore_missing=True)
Find a single execution. One. Just one. ๐
Parameters
name_or_idโ the name or ID of an execution.ignore_missingโ set it toFalseandNotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. Set it toTrueand you just getNoneback when you try to find a nonexistent resource. no crash, no drama, no tears โจ
Returns โ one Execution or None.
โฐ Cron Trigger Operations
Okay bestie, same proxy energy, but now with cron โ yes, the actual scheduled-vibes kind ๐
class openstack.workflow.v2._proxy.Proxy(session, *, service_type=None, service_name=None, interface=None, region_name=None, endpoint_override=None, version=None, auth=None, user_agent=None, connect_retries=None, logger=None, allow=None, additional_headers=None, client_name=None, client_version=None, allow_version_hack=None, global_request_id=None, min_version=None, max_version=None, default_microversion=None, status_code_retries=None, retriable_status_codes=None, raise_exc=None, rate_limit=None, concurrency=None, connect_retry_delay=None, status_code_retry_delay=None, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None)
create_cron_trigger(**attrs)
Create a new cron trigger from attributes โจ
Parameters
attrsโ keyword arguments which will be used to create aCronTrigger(openstack.workflow.v2.cron_trigger.CronTrigger), comprised of the properties on theCronTriggerclass.
Returns โ the results of cron trigger creation ๐
get_cron_trigger(cron_trigger)
Get a cron trigger. grabbing exactly one, bestie ๐
Parameters
cron_triggerโ the value can be the name of acron_triggeror aCronTrigger(openstack.workflow.v2.cron_trigger.CronTrigger) instance.
Returns โ one CronTrigger (openstack.workflow.v2.cron_trigger.CronTrigger)
Raises NotFoundException (openstack.exceptions.NotFoundException) when no cron triggers matching the criteria could be found. ๐ญ
cron_triggers(*, all_projects=False, **query)
Retrieve a generator of cron triggers ๐
Parameters
all_projectsโ when set toTrue, list cron triggers from all projects. Admin-only by default. ๐queryโ optional query parameters to be sent to restrict the cron triggers to be returned. Available parameters include:limit: requests at most the specified number of items be returned from the query.marker: specifies the ID of the last-seen cron trigger. Use thelimitparameter to make an initial limited request and use the ID of the last-seen cron trigger from the response as themarkerparameter value in a subsequent limited request. iykyk ๐ง
Returns โ a generator of CronTrigger instances.
delete_cron_trigger(value, ignore_missing=True)
Delete a cron trigger. bye bestie ๐
Parameters
valueโ the value can be either the name of a cron trigger or aCronTrigger(openstack.workflow.v2.cron_trigger.CronTrigger) instance.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the cron trigger does not exist. When set toTrue, no exception will be set when attempting to delete a nonexistent cron trigger. ghost it and it won't ghost you back ๐ซถ
Returns โ the deleted cron trigger.
find_cron_trigger(name_or_id, ignore_missing=True, *, all_projects=False, **query)
Find a single cron trigger ๐
Parameters
name_or_idโ the name or ID of a cron trigger.ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.all_projectsโ when set toTrue, search for cron triggers by name across all projects. Note that this will likely result in a higher chance of duplicates. โ ๏ธ (fair warning, bestie)queryโ optional query parameters to be sent to limit the cron triggers being returned.
Returns โ one CronTrigger or None
Raises NotFoundException (openstack.exceptions.NotFoundException) when no resource can be found.
Raises DuplicateResource (openstack.exceptions.DuplicateResource) when multiple resources are found. two of them?? not the duplicate situation ๐ญ
๐งฑ Resource Interface
Okay so this is the lowkey lower-level layer โ the Resource layer is how you talk to OpenStack services directly, no middleman vibes. The classes exposed by the Connection build a whole convenience layer on top of this, but you can absolutely use Resources directly. However โ the most common usage of this layer is getting an object from a class in the Connection layer, modifying it, and sending it right back into the Connection layer, like to update a resource on the server. it's giving "borrow the hoodie, wear it, give it back" ๐งฅโจ
The following services have exposed Resource classes.
โก Accelerator v2 Resources
openstack.accelerator.v2.accelerator_request
The AcceleratorRequest Class
The AcceleratorRequest class inherits from Resource (openstack.resource.Resource).
class openstack.accelerator.v2.accelerator_request.AcceleratorRequest(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing). don't touch, fr fr ๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'arq' : singular form of key for resource.
resources_key = 'arqs' : plural form of key for resource. yes, the s is doing all the work ๐
base_path = '/accelerator_requests' : the base part of the URI for this resource.
create_opts = CreateOpts(request_key=None, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True) : class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create().
allow_create = True : allow create operation for this resource.
allow_fetch = True : allow get operation for this resource.
allow_delete = True : allow delete operation for this resource.
allow_list = True : allow list operation for this resource.
allow_patch = True : allow patch operation for binding.
attach_handle_info : the device address associated with this ARQ (if any)
attach_handle_type : the type of attach handle (e.g. PCI, mdev...)
device_profile_name : the name of the device profile
device_profile_group_id : the id of the device profile group
device_rp_uuid : the UUID of the bound device RP (if any)
hostname : the host name to which ARQ is bound. (if any)
instance_uuid : the UUID of the instance associated with this ARQ (if any)
state : the state of the ARQ
uuid : the UUID of the ARQ
patch(session, patch=None, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None)
Patch the remote resource. โจ
Lets you modify the resource by handing over a list of JSON patches to apply to it. The patches can use both the original (server-side) and SDK field names โ flexible, we love to see it ๐
Parameters
sessionโ the session to use for making this request.patchโ additional JSON patch as a list or one patch item. If provided, it is applied on top of any changes to the current resource.prepend_keyโ whether theresource_key(openstack.resource.Resource.resource_key) should be prepended in a resource creation request. Default toTrue.retry_on_conflictโ whether to enable retries on HTTPCONFLICT(409). Value ofNoneleaves the Adapter defaults.base_pathโ base part of the URI for modifying resources, if different frombase_path(openstack.resource.Resource.base_path).microversionโ the API version to override the negotiated one โจ
Returns ๐
This Resource instance, bestie. That's it. That's the return.
Raises MethodNotSupported if Resource.allow_patch is not set to True โ like, it will literally throw hands if patching isn't allowed, so check that flag first, no cap ๐ญ
openstack.accelerator.v2.attribute
โจ The Attribute Class โจ
The Attribute class inherits from Resource.
class openstack.accelerator.v2.attribute.Attribute(_synchronized=False, connection=None, **attrs)
The base resource ๐ซถ
Parameters
_synchronizedโ okay so this one is not for direct use, bestie. Don't touch it. Go look atnew()andexisting()instead, that's the vibe ๐connectionโ reference to theConnectionbeing used. Defaults toNone, and that's on purpose โ it lets Resource objects exist without an active Connection, like in unit tests. And if you're usingself._connectionanywhere in Resource code, protect it with aNonecheck, fr fr ๐
resource_key = 'attribute' Singular form of the key for this resource. One attribute. Just the one. ๐
resources_key = 'attributes' Plural form of the key for this resource. Now we're talking multiples โจ
base_path = '/attributes' The base part of the URI for this resource โ that's the URL chunk it lives at ๐ธ
allow_create = True Yes, you can create one of these ๐
allow_fetch = True Yes, you can fetch (get) one of these ๐ฆ
allow_commit = False Nope, no update operation for this resource ๐
allow_delete = True Yes, you can delete it ๐
allow_list = True Yes, you can list them all out, iconic behavior โญ
created_at The timestamp when this attribute was created. Baby's birth certificate ๐ผ
deployable_id The deployable_id of the attribute.
key The key of the attribute.
value The value of the attribute.
updated_at The timestamp when this attribute was updated. Glow-up timestamp โจ
uuid The uuid of the attribute.
openstack.accelerator.v2.deployable
๐ The Deployable Class ๐
The Deployable class inherits from Resource.
class openstack.accelerator.v2.deployable.Deployable(_synchronized=False, connection=None, **attrs)
The base resource ๐ซถ
Parameters
_synchronizedโ again, not for direct use. Seenew()andexisting()instead, iykyk ๐connectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. And use ofself._connectionin Resource code should protect itself with a check forNone๐
resource_key = 'deployable' Singular form of the key for this resource.
resources_key = 'deployables' Plural form of the key for this resource.
base_path = /deployables The base part of the URI for this resource ๐
allow_create = False No create operation here, sorry bestie ๐
allow_fetch = True Fetch? Yes. Get it, girl ๐
allow_commit = False No update operation. Not today ๐
allow_delete = False No delete operation either. Hands off ๐ซ
allow_list = True But you can list them, and that's the tea โญ
allow_patch = True And you can patch. Patching is the whole main character energy of this class ๐ฅ
created_at The timestamp when this deployable was created.
device_id The device_id of the deployable.
id The UUID of the deployable.
name The name of the deployable.
num_accelerators The num_accelerator of the deployable.
parent_id The parent_id of the deployable.
root_id The root_id of the deployable.
updated_at The timestamp when this deployable was updated.
patch(session, patch=None, prepend_key=True, has_body=True, retry_on_conflict=None, base_path='/deployables/%(id)s/program', *, microversion=None)
Patch the remote resource. ๐ฉนโจ
This lets you modify the resource by handing over a list of JSON patches to apply to it. And the patches can use both the original (server-side) field names and the SDK field names โ flexible queen behavior, honestly ๐
Parameters
sessionโ the session to use for making this request.patchโ additional JSON patch, as a list or one patch item. If you provide it, it gets applied on top of any changes to the current resource.prepend_keyโ whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue.retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults alone, no notes ๐base_pathโ base part of the URI for modifying resources, if it's different frombase_path. Note the default here is'/deployables/%(id)s/program', which is not the plain class-level one, so like... read it carefully bestie ๐microversionโ the API version to override the negotiated one.
Returns ๐
This Resource instance.
Raises MethodNotSupported if Resource.allow_patch is not set to True. (Spoiler: for this class it is True, so you're chilling ๐)
openstack.accelerator.v2.device
๐ฆ The Device Class ๐ฆ
The Device class inherits from Resource.
class openstack.accelerator.v2.device.Device(_synchronized=False, connection=None, **attrs)
The base resource ๐ซถ
Parameters
_synchronizedโ not intended to be used directly, seenew()andexisting()instead โญconnectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐
resource_key = 'device' Singular form of the key for this resource.
resources_key = 'devices' Plural form of the key for this resource.
base_path = /devices The base part of the URI for this resource ๐ธ
allow_create = False No creating devices here ๐
allow_fetch = True Fetching? Absolutely, obsessed ๐
allow_commit = False No update operation ๐
allow_delete = False No delete operation ๐ซ
allow_list = True Listing is on the menu, periodt โญ
created_at The timestamp when this device was created.
hostname The hostname of the device.
id The ID of the device.
model The model of the device.
status The status of the device.
std_board_info The std board information of the device.
type The type of the device.
updated_at The timestamp when this device was updated.
uuid The UUID of the device.
vendor The vendor ID of the device.
vendor_board_info The vendor board information of the device.
enable(session) Enable the device. Turn it all the way on ๐
โจ
disable(session) Disable the device. Okay, turn it back off ๐ญ
openstack.accelerator.v2.device_profile
๐ The DeviceProfile Class ๐
The DeviceProfile class inherits from Resource.
class openstack.accelerator.v2.device_profile.DeviceProfile(_synchronized=False, connection=None, **attrs)
The base resource ๐ซถ
Parameters
_synchronizedโ not intended for direct use, bestie. Seenew()andexisting()๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ฆ
resource_key = 'device_profile' Singular form of the key for this resource.
resources_key = 'device_profiles' Plural form of the key for this resource.
base_path = /device_profiles The base part of the URI for this resource ๐
allow_create = True You can create these, slay ๐
allow_fetch = True You can fetch these too โจ
allow_commit = False No update operation ๐
allow_delete = True Deletion is allowed, handle with care ๐
allow_list = True And listing, obviously โญ
created_at The timestamp when this device_profile was created.
description The description of the device profile.
groups The groups of the device profile.
name The name of the device profile.
updated_at The timestamp when this device_profile was updated.
uuid The uuid of the device profile.
create_optsโ class-level config for the create operation, shaped like this:
create_opts = CreateOpts(request_key=None,
response_key=<Unset.UNSET: 'UNSET'>, method='POST',
requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
Subclasses can override this to set per-resource defaults without overriding create(). Slay, inheritance.
๐ฆพ Baremetal Resources ๐ฆพ
openstack.baremetal.v1.Allocation
Bestie. The Allocation Class. It inherits from Resource (peep #openstack.resource.Resource).
class openstack.baremetal.v1.allocation.Allocation(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, ok? Look atnew()(see#openstack.resource.Resource.new) andexisting()(see#openstack.resource.Resource.existing) instead.connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. And fr, any use ofself._connectioninside Resource code should protect itself with a check forNone.resources_key = 'allocations'โ the plural form of the key for this resource.base_path = '/allocations'โ the base part of the URI for this resource.allow_create = Trueโ create operation? allowed. ๐allow_fetch = Trueโ get operation? allowed.allow_commit = Trueโ update operation? allowed.allow_delete = Trueโ delete operation? allowed.allow_list = Trueโ list operation? allowed.allow_patch = Trueโ patch operation? allowed.commit_method = 'PATCH'โ the method for committing a resource. It must bePATCHifallow_patchisTrue. No cap.
Attributes, the main character lineup:
candidate_nodesโ the candidate nodes for this allocation.created_atโ timestamp at which the allocation was created.extraโ a set of one or more arbitrary metadata key and value pairs.idโ the UUID for the allocation.last_errorโ the last error for the allocation. ๐ญlinksโ a list of relative links, including the self and bookmark links.nameโ the name of the allocation.nodeโ the node UUID or name to create the allocation against, bypassing the normal allocation process. Sneaky but valid.node_idโ UUID of the node this allocation belongs to.ownerโ the tenant who owns the object.resource_classโ the requested resource class.stateโ the state of the allocation.traitsโ the requested traits.updated_atโ timestamp at which the allocation was last updated.
wait(session, timeout=None, ignore_error=False)
Wait for the allocation to become active. The suspenseโฆ ๐ซถ
Parameters
sessionโ the session to use for making this request.timeoutโ how much (in seconds) to wait for the allocation. A value ofNone(the default) means no client-side timeout, so like, buckle up.ignore_errorโ ifTrue, this call will raise an exception if the allocation reaches the error state. Otherwise the error state is considered successful and the call returns.
Returns โ this Allocation instance. ๐
Raises ResourceFailure (see #openstack.exceptions.ResourceFailure) if allocation fails and ignore_error is False.
Raises ResourceTimeout (see #openstack.exceptions.ResourceTimeout) on timeout. ๐
openstack.baremetal.v1.chassis
The Chassis Class, bestie. Inherits from Resource (see #openstack.resource.Resource).
class openstack.baremetal.v1.chassis.Chassis(_synchronized=False,
connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not intended to be used directly. Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneso Resource objects work without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resources_key = 'chassis'โ plural form of key for resource.base_path = '/chassis'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.allow_patch = Trueโ allow patch operation for this resource.commit_method = 'PATCH'โ method for committing a resource. Must bePATCHifallow_patchisTrue. Periodt.
Attributes:
created_atโ timestamp at which the chassis was created.descriptionโ a descriptive text about the service.extraโ a set of one or more arbitrary metadata key and value pairs.idโ the UUID for the chassis.linksโ a list of relative links, including the self and bookmark links.nodesโ links to the collection of nodes contained in the chassis.updated_atโ timestamp at which the chassis was last updated.
openstack.baremetal.v1.conductor
The Conductor Class. Inherits from Resource (see #openstack.resource.Resource). ๐
class openstack.baremetal.v1.conductor.Conductor(_synchronized=False,
connection=None, **attrs)
The base resource ๐ธ
Parameters
_synchronizedโ not intended to be used directly, seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resources_key = 'conductors'โ plural form of key for resource.base_path = '/conductors'โ the base part of the URI for this resource.allow_create = Falseโ no creating, bestie. ๐ซallow_fetch = Trueโ get operation allowed.allow_commit = Falseโ no updating.allow_delete = Falseโ no deleting.allow_list = Trueโ listing? absolutely, go off.allow_patch = Falseโ and no patching either.
openstack.baremetal.v1.deploy_templates
The DeployTemplate Class. Inherits from Resource (see #openstack.resource.Resource).
class openstack.baremetal.v1.deploy_templates.DeployTemplate(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resources_key = 'deploy_templates'โ plural form of key for resource.base_path = '/deploy_templates'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.allow_patch = Trueโ allow patch operation for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.
Attributes:
nameโ the name of this resource.created_atโ timestamp at which the deploy_template was created.extraโ a set of one or more arbitrary metadata key and value pairs.linksโ a list of relative links. Includes the self and bookmark links.stepsโ a set of physical information of the deploy_template. ๐ฆupdated_atโ timestamp at which the deploy_template was last updated.idโ the UUID of the resource.
openstack.baremetal.v1.driver
The Driver Class. Inherits from Resource (see #openstack.resource.Resource). ๐๏ธ
class openstack.baremetal.v1.driver.Driver(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly, ok? Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.connectionโ a reference to the Connection that's being used. Defaults toNoneso Resource objects can exist without an active Connection โ like in unit tests, bestie ๐ . And fr fr: if you're poking atself._connectioninside Resource code, guard it with aNonecheck. No cap.
resources_key = 'drivers' โ the plural form of the key for this resource. Slay, pluralization.
base_path = '/drivers' โ the base part of the URI for this resource. It's giving URL starter pack โจ
allow_create = False โ nope, no create operation for this resource.
allow_fetch = True โ yes, get operation? Allowed ๐ซถ
allow_commit = False โ update operation? Not here, babe.
allow_delete = False โ delete? Also no ๐
allow_list = True โ list operation? Absolutely, we stan a listable resource ๐
hosts โ a list of active hosts that support this driver.
links โ a list of relative links, including the self and bookmark links.
name โ the name of the driver.
properties โ a list of links to driver properties.
default_bios_interface โ default BIOS interface implementation. Introduced in API microversion 1.40.
default_boot_interface โ default boot interface implementation. Introduced in API microversion 1.30.
default_console_interface โ default console interface implementation. Introduced in API microversion 1.30.
default_deploy_interface โ default deploy interface implementation. Introduced in API microversion 1.30.
default_firmware_interface โ default firmware interface implementation. Introduced in API microversion 1.86.
default_inspect_interface โ default inspect interface implementation. Introduced in API microversion 1.30.
default_management_interface โ default management interface implementation. Introduced in API microversion 1.30.
default_network_interface โ default network interface implementation. Introduced in API microversion 1.30.
default_power_interface โ default port interface implementation. Introduced in API microversion 1.30. (yes, it says port โ that's the manpage talking, not me ๐ญ)
default_raid_interface โ default RAID interface implementation. Introduced in API microversion 1.30.
default_rescue_interface โ default rescue interface implementation. Introduced in API microversion 1.38.
default_storage_interface โ default storage interface implementation. Introduced in API microversion 1.33.
default_vendor_interface โ default vendor interface implementation. Introduced in API microversion 1.30.
enabled_bios_interfaces โ enabled BIOS interface implementations. Introduced in API microversion 1.40.
enabled_boot_interfaces โ enabled boot interface implementations. Introduced in API microversion 1.30.
enabled_console_interfaces โ enabled console interface implementations. Introduced in API microversion 1.30.
enabled_deploy_interfaces โ enabled deploy interface implementations. Introduced in API microversion 1.30.
enabled_firmware_interfaces โ enabled firmware interface implementations. Introduced in API microversion 1.86.
enabled_inspect_interfaces โ enabled inspect interface implementations. Introduced in API microversion 1.30.
enabled_management_interfaces โ enabled management interface implementations. Introduced in API microversion 1.30.
enabled_network_interfaces โ enabled network interface implementations. Introduced in API microversion 1.30.
enabled_power_interfaces โ enabled port interface implementations. Introduced in API microversion 1.30. (again with the port, iykyk ๐ซ )
enabled_raid_interfaces โ enabled RAID interface implementations. Introduced in API microversion 1.30.
enabled_rescue_interfaces โ enabled rescue interface implementations. Introduced in API microversion 1.38.
enabled_storage_interfaces โ enabled storage interface implementations. Introduced in API microversion 1.33.
enabled_vendor_interfaces โ enabled vendor interface implementations. Introduced in API microversion 1.30.
list_vendor_passthru(session) โ fetch the vendor specific methods that this driver exposes ๐
- Parameters
sessionโ the session to use for making this request.
- Returns โ a dict of the available vendor passthru methods for the driver. Method names are the keys, and corresponding usages in dict form are the values. Usage dict properties:
async: bool # Is passthru function invoked asynchronouslyattach: bool # Is return value attached to response objectdescription: str # Description of what the method doeshttp_methods: list # List of HTTP methods supported
call_vendor_passthru(session, verb, method, body=None) โ call a vendor specific passthru method ๐
Contents of body are params passed to the hardware driver function. Validation happens there โ so if parameters are missing, or if there are excess parameters, the request gets rejected. Periodt.
- Parameters
sessionโ the session to use for making this request.methodโ vendor passthru method name.verbโ one ofGET,POST,PUT, orDELETE, depending on the driver and method.bodyโ passed to the vendor function as json body.
- Raises โ
ValueErrorifverbis not one ofGET,POST,PUT,DELETE. - Returns โ response of method call.
๐ฆ openstack.baremetal.v1.inspection_rules ๐ฆ
The InspectionRule Class ๐
The InspectionRule class inherits from Resource <#openstack.resource.Resource>.
class openstack.baremetal.v1.inspection_rules.InspectionRule(_synchronized=False, connection=None, **attrs)
The base resource.
- Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resources_key = 'inspection_rules' โ plural form of key for resource. (Ik it's long, it's fine, we love her ๐ธ)
base_path = '/inspection_rules' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
allow_patch = True โ allow patch operation for this resource.
commit_method = 'PATCH' โ method for committing a resource. This must be PATCH if allow_patch is True. Like, mandatory mandatory ๐
actions โ the actions to be executed when the rule conditions are met.
description โ a brief explanation about the inspection rule.
conditions โ the conditions under which the rule should be triggered.
created_at โ timestamp at which the resource was created.
links โ a list of relative links. Includes the self and bookmark links.
phase โ specifies the phase when the rule should run, defaults to 'main'. Main character energy, literally โจ
priority โ specifies the rule's precedence level during execution.
sensitive โ indicates whether the rule contains sensitive information. ๐
updated_at โ timestamp at which the resource was last updated.
id โ the UUID of the resource.
๐ openstack.baremetal.v1.Node ๐
The Node Class ๐
The Node class inherits from Resource <#openstack.resource.Resource>.
class openstack.baremetal.v1.node.Node(_synchronized=False, connection=None, **attrs)
The base resource.
- Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resources_key = 'nodes' โ plural form of key for resource.
base_path = '/nodes' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
and bestie, we're not even done yet โ more Node goodness incoming ๐
allow_patch=Trueโ Allow patch operation for this resource.commit_method='PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.
๐ค the node fields, one by one
okay bestie, this is the long one โ every attribute of a baremetal node, plus exactly which microversion it showed up in. no skipping, i promise ๐ซถ
allocation_idโ The UUID of the allocation associated with this node. Added in API microversion 1.52.ownerโ A string or UUID of the tenant who owns the baremetal node. Added in API microversion 1.50.boot_modeโ The current boot mode state (uefi/bios). Added in API microversion 1.75.chassis_idโ The UUID of the chassis associated with this node. Can be empty orNone. ๐clean_stepโ The current clean step.conductor_groupโ Conductor group this node is managed by. Added in API microversion 1.46.created_atโ Timestamp at which the node was last updated. (yes, that's what it says, we don't make the rules ๐ )deploy_stepโ The current deploy step. Added in API microversion 1.44.descriptionโ The description of the node. Added in API microversion 1.51.driverโ The name of the driver.driver_infoโ All the metadata required by the driver to manage this node. List of fields varies between drivers, and can be retrieved from theopenstack.baremetal.v1.driver.Driver <#openstack.baremetal.v1.driver.Driver>resource.driver_internal_infoโ Internal metadata set and stored by node's driver. This is read-only. ๐extraโ A set of one or more arbitrary metadata key and value pairs.faultโ Fault type that caused the node to enter maintenance mode. Introduced in API microversion 1.42.healthโ The health status of the node from the BMC (e.g.'OK','Warning','Critical'). Introduced in API microversion 1.109.idโ The UUID of the node resource.instance_infoโ Information used to customize the deployed image, e.g. size of root partition, config drive in the form of base64 encoded string and other metadata.instance_idโ UUID of the nova instance associated with this node.instance_nameโ The name of the instance associated with this node. Added in API microversion 1.104.is_automated_clean_enabledโ Override enabling of automated cleaning. Added in API microversion 1.47.is_console_enabledโ Whether console access is enabled on this node.is_maintenanceโ Whether node is currently in "maintenance mode". Nodes put into maintenance mode are removed from the available resource pool. ๐is_retiredโ Whether the node is marked for retirement. Added in API microversion 1.61.is_secure_bootโ Whether the node is currently booted with secure boot turned on. Added in API microversion 1.75.last_errorโ Any error from the most recent transaction that started but failed to finish. ๐ญlesseeโ Field indicating if the node is leased to a specific project. Added in API version 1.65linksโ A list of relative links, including self and bookmark links.maintenance_reasonโ user settable description of the reason why the node was placed into maintenance mode.nameโ Human readable identifier for the node. May be undefined. Certain words are reserved. Added in API microversion 1.5parent_nodeโ The node which serves as theparent_nodefor this node. Added in API version 1.83portsโ Links to the collection of ports on this node.port_groupsโ Links to the collection of portgroups on this node. Available since API microversion 1.24.power_stateโ The current power state. Usually"power on"or"power off", but may be"None"if service is unable to determine the power state.propertiesโ Physical characteristics of the node. Content populated by the service during inspection.provision_stateโ The current provisioning state of the node.retired_reasonโ The reason why the node is marked for retirement. Added in API microversion 1.61.raid_configโ The current RAID configuration of the node.reservationโ The name of an service conductor host which is holding a lock on this node, if a lock is held.resource_classโ A string to be used by external schedulers to identify this node as a unit of a specific type of resource. Added in API microversion 1.21.service_stepโ A string representing the current service step being executed upon. Added in API microversion 1.89.runbookโ A string representing the uuid or logical name of a runbook as an alternative to providingclean_stepsorservice_steps. Added in API microversion 1.92.shardโ A string indicating the shard this node belongs to. Added in API microversion1,82. (that comma is canon, i don't make the rules ๐ซ )statesโ Links to the collection of states.target_provision_stateโ The requested state if a provisioning action has been requested. For example,AVAILABLE,DEPLOYING,DEPLOYWAIT,DEPLOYING,ACTIVEetc.target_power_stateโ The requested state during a state transition.target_raid_configโ The requested RAID configuration of the node which will be applied when the node next transitions through theCLEANINGstate.traitsโ Traits of the node. Introduced in API microversion 1.37.updated_atโ Timestamp at which the node was last updated.
๐ง the interfaces, aka the plug-in slots
these are all "which thingy do we use for X" fields, and yep, every single one has its own microversion. iconic behaviour honestly โจ
bios_interfaceโ BIOS interface to use when setting BIOS properties of the node. Introduced in API microversion 1.40.boot_interfaceโ Boot interface to use when configuring boot of the node. Introduced in API microversion 1.31.console_interfaceโ Console interface to use when working with serial console. Introduced in API microversion 1.31.deploy_interfaceโ Deploy interface to use when deploying the node. Introduced in API microversion 1.31.firmware_interfaceโ Firmware interface to be used when managing the node. Introduced in API microversion 1.86inspect_interfaceโ Inspect interface to use when inspecting the node. Introduced in API microversion 1.31.management_interfaceโ Management interface to use for management actions on the node. Introduced in API microversion 1.31.network_interfaceโ Network interface provider to use when plumbing the network connections for this node. Introduced in API microversion 1.20.power_interfaceโ Power interface to use for power actions on the node. Introduced in API microversion 1.31.raid_interfaceโ RAID interface to use for configuring RAID on the node. Introduced in API microversion 1.31.rescue_interfaceโ Rescue interface to use for rescuing of the node. Introduced in API microversion 1.38.storage_interfaceโ Storage interface to use when attaching remote storage. Introduced in API microversion 1.33.vendor_interfaceโ Vendor interface to use for vendor-specific actions on the node. Introduced in API microversion 1.31.
๐ create(session, prepend_key=True, base_path=None, *, microversion=None, **params)
Create a remote resource based on this instance. ๐ซถ
The overridden version is capable of handling the populated provision_state field of one of three values: enroll, manageable or available. If not provided, the server default is used (enroll in newer versions of Ironic).
This call does not cause a node to go through automated cleaning. If you need it, use provision_state=manageable followed by a call to set_provision_state(). ๐งผ
Note that Bare Metal API 1.4 is required for manageable and 1.11 is required for enroll.
โ ๏ธ Warning: Using provision_state=available is only possible with API versions 1.1 to 1.10 and thus is incompatible with setting any fields that appeared after 1.11. like, genuinely don't do it bestie ๐
Parameters
- session โ The session to use for making this request.
Returns
- This Resource instance.
Raises
ValueErrorif the Node'sprovision_stateis not one ofNone,enroll,manageableoravailable.NotSupported <#openstack.exceptions.NotSupported>if theprovision_statecannot be reached with any API version supported by the server.
๐ commit(session, *args, **kwargs)
Commit the state of the instance to the remote resource.
Parameters
- session โ The session to use for making this request.
Returns
- This Node instance.
๐ set_provision_state(session, target, config_drive=None, clean_steps=None, rescue_password=None, wait=False, timeout=None, deploy_steps=None, service_steps=None, runbook=None)
Run an action modifying this node's provision state.
This call is asynchronous โ it will return success as soon as the Bare Metal service acknowledges the request. so like, don't assume it's done just because it replied, okay? โญ
Parameters
sessionโ the session you're using to make this request, bestie. yeah, every single one of these needs it.targetโ the provisioning action you want, likeactiveorprovide. check the Bare Metal service docs for the full list of actions that exist, okay? โจconfig_driveโ the config drive you're passing to the node. only valid foractiveandrebuildtargets, lowkey. you can build one using functions fromopenstack.baremetal.configdrive๐clean_stepsโ the clean steps to execute. only valid for thecleantarget.rescue_passwordโ password for the rescue operation. only valid for therescuetarget ๐ฅwaitโ whether to actually wait for the target state to be reached or just vibe and dip.timeoutโ timeout (in seconds) to wait for the target state to be reached. if it'sNone, you wait forever, no timeout, no cap, we die like legends ๐deploy_stepsโ deploy steps to execute. only valid foractiveandrebuildtargets.service_stepsโ service steps to execute. only valid for theservicetarget.runbookโ the UUID or logical name of a runbook.
Returns This Node instance. your node, your bestie, returned to you ๐ซถ
Raises ValueError if config_drive, clean_steps, deploy_steps or rescue_password are provided with an invalid target. like, don't do that.
Raises ResourceFailure <#openstack.exceptions.ResourceFailure> if the node reaches an error state while waiting for the state. ๐ญ
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> if timeout is reached while waiting for the state.
wait_for_power_state(session, expected_state, timeout=None)
wait for the node to reach the expected power state. literally just sitting there refreshing until it happens โญ
Parameters
sessionโ the session to use for making this request.expected_stateโ the expected power state you want it to reach.timeoutโ ifwaitis set toTrue, this specifies how much (in seconds) to wait for the expected state to be reached. the valueNone(the default) means no client-side timeout. no cap, infinite patience ๐ง
Returns This Node instance.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> on timeout.
wait_for_provision_state(session, expected_state, timeout=None, abort_on_failed_state=True)
wait for the node to reach the expected state. provision-state edition ๐
Parameters
sessionโ the session to use for making this request.expected_stateโ the expected provisioning state you want it to reach.timeoutโ ifwaitis set toTrue, this specifies how much (in seconds) to wait for the expected state to be reached. the valueNone(the default) means no client-side timeout.abort_on_failed_stateโ ifTrue(the default), it aborts waiting if the node reaches a failure state which does not match the expected one. heads up though: the failure state for theenroll->manageabletransition isenrollagain. yes really, that's the rule ๐
Returns This Node instance.
Raises ResourceFailure <#openstack.exceptions.ResourceFailure> if the node reaches an error state and abort_on_failed_state is True.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> on timeout.
wait_for_reservation(session, timeout=None)
wait for a lock on the node to be released. we're waiting for the node to be free, basically ๐
bare metal nodes in ironic have a reservation lock. it's used to represent that a conductor has locked the node while performing some sort of action โ like changing configuration as a result of a machine state change. main character conductor energy, honestly ๐
this lock can occur during power syncronization, and it prevents updates to objects attached to the node, such as ports. so like, no touching while it's locked, okay?
heads up bestie: nothing prevents a conductor from acquiring the lock again after this call returns, so treat it as best effort. it's giving "I'll try my best" not "guaranteed" ๐ญ
it returns immediately if there is no reservation on the node. slay, no waiting needed ๐
Parameters
sessionโ the session to use for making this request.timeoutโ how much (in seconds) to wait for the lock to be released. the valueNone(the default) means no timeout.
Returns This Node instance.
inject_nmi(session)
inject NMI. that's it. that's the whole thing ๐ฅ
Parameters session โ the session to use for making this request.
Returns None
set_power_state(session, target, wait=False, timeout=None)
run an action modifying this node's power state โก
this call is asynchronous, so it returns success as soon as the Bare Metal service acknowledges the request. it doesn't mean the thing is done, bestie, it means they heard you ๐ฃ
Parameters
sessionโ the session to use for making this request.targetโ target power state, as aPowerActionor a string.waitโ whether to wait for the expected power state to be reached.timeoutโ timeout (in seconds) to wait for the target state to be reached. ifNone, wait without timeout.
attach_vmedia(session, device_type, image_url, image_download_source=None, retry_on_conflict=True)
attach a virtual media device to a node ๐
Parameters
sessionโ the session to use for making this request.device_typeโ the type of virtual media device.image_urlโ the URL of the image to attach.image_download_sourceโ the source of the image download.retry_on_conflictโ whether to retry HTTP CONFLICT errors. this can happen when either the virtual media is already used on a node or the node is locked. since the latter happens more often, the default value isTrue. lowkey relatable, the node is always locked ๐
Returns None
Raises NotSupported <#openstack.exceptions.NotSupported> if the server does not support the VMEDIA API. rude of the server, honestly.
detach_vmedia(session, device_types=None)
detach virtual media from a node. bye bye virtual media ๐
Parameters
sessionโ the session to use for making this request.device_typesโ a list with the types of virtual media devices to detach.
Returns True if the virtual media was detached, otherwise False.
Raises NotSupported <#openstack.exceptions.NotSupported> if the server does not support the VMEDIA API
attach_vif(session, vif_id, retry_on_conflict=True, *, port_id=None, port_group_id=None)
attach a VIF to the node ๐
the exact form of the VIF ID depends on the network interface used by the node. in the most common case it's a Network service port (NOT a Bare Metal port) ID โ read that again, bestie, NOT a bare metal port. a VIF can only be attached to one node at a time, no sharing โ
Parameters
sessionโ the session to use for making this request.vif_idโ backend-specific VIF ID.retry_on_conflictโ whether to retry HTTP CONFLICT errors. this can happen when either the VIF is already used on a node or the node is locked. since the latter happens more often, the default value isTrue.port_idโ the UUID of the port to attach the VIF to. only one ofport_idorport_group_idcan be provided, pick one ๐port_group_idโ the UUID of the portgroup to attach to. only one ofport_group_idorport_idcan be provided. same deal, one or the other.
Returns None
Raises NotSupported <#openstack.exceptions.NotSupported> if the server does not support the VIF API.
Raises InvalidRequest <#openstack.exceptions.InvalidRequest> if both port_id and port_group_id are provided. like, you can't have both, that's the whole point ๐ค
detach_vif(session, vif_id, ignore_missing=True)
detach a VIF from the node ๐ฆ
the exact form of the VIF ID depends on the network interface used by the node. in the most common case it's a Network service port (NOT a Bare Metal port) ID. yeah, same warning as attach, it matters both ways ๐
Parameters
sessionโ the session to use for making this request.vif_idโ backend-specific VIF ID.ignore_missingโ when set toFalse,NotFoundException <#openstack.exceptions.NotFoundException>will be raised when the VIF does not exist. otherwise,Falseis returned. basically: do you want drama or do you want peace? ๐
Returns True if the VIF was detached, otherwise False.
- Raises
NotSupported(that'sopenstack.exceptions.NotSupported) if the server doesn't support the VIF API. Like, it's literally just not a thing on that server, bestie, don't take it personally ๐
list_vifs(session)
Ok so this one lists the IDs of all the VIFs attached to the node โจ
Heads up tho: the exact form of the VIF ID depends on whatever network interface the node is using. In the most common case it's a Network service port (and NOT a Bare Metal port) ID. Iykyk ๐ซถ
- session โ the session you're using to make this request.
Returns โ a list of VIF IDs, as strings ๐ธ
Raises NotSupported (openstack.exceptions.NotSupported) if the server doesn't support the VIF API.
validate(session, required=('boot', 'deploy', 'power'))
Validate the required info on the node. Vibe check for your node, basically ๐
- session โ the session you're using to make this request.
- required โ list of interfaces that are required to pass validation. The default value is the list of minimum required interfaces for provisioning (that's
('boot', 'deploy', 'power'), iconically).
Returns โ a dict mapping interface names to ValidationResult objects โญ
Raises ValidationException (openstack.exceptions.ValidationException) if validation fails for a required interface. Not the vibe. ๐ญ
set_maintenance(session, reason=None)
Turns maintenance mode on for the node. It's giving "do not disturb" ๐ง
- session โ the session you're using to make this request.
- reason โ optional reason for maintenance. Tell them why, bestie.
Returns โ this Node instance ๐
unset_maintenance(session)
Turns maintenance mode off for the node. Back online, main character energy โจ
- session โ the session you're using to make this request.
Returns โ this Node instance ๐
get_boot_device(session)
Gets the node's boot device. Which thing is it booting from, fr fr ๐ฅพ
- session โ the session you're using to make this request.
Returns โ the HTTP response.
set_boot_device(session, boot_device, persistent=False)
Sets the node's boot device ๐ฅ
- session โ the session you're using to make this request.
- boot_device โ the boot device to assign to the node.
- persistent โ if the boot device change is maintained after the node reboots. Defaults to
False, so it's a temporary slay unless you say otherwise.
Returns โ None
get_supported_boot_devices(session)
Gets the boot devices that are supported for the node. The menu of options ๐
- session โ the session you're using to make this request.
Returns โ the HTTP response.
set_boot_mode(session, target)
Makes a request to change the node's boot mode ๐ฆ
This call is asynchronous โ it returns success as soon as the Bare Metal service acknowledges the request. So like, it said "yes bestie" but the actual work is still happening in the background, ngl.
- session โ the session you're using to make this request.
- target โ the boot mode to set for the node, one of either
'uefi'or'bios'.
Returns โ None
Raises ValueError if target is not one of 'uefi' or 'bios'.
set_secure_boot(session, target)
Makes a request to change the node's secure boot state ๐
Same deal as above โ this call is asynchronous, and it returns success as soon as the Bare Metal service acknowledges the request. The service is doing its thing, ok? ๐
- session โ the session you're using to make this request.
- target โ a boolean indicating the secure boot state to set.
True/Falsecorrespond to'on'/'off'respectively.
Returns โ None
Raises ValueError if target is not boolean.
add_trait(session, trait)
Adds a trait to the node. Giving it a little accessory ๐
- session โ the session you're using to make this request.
- trait โ the trait to add to the node.
Returns โ None
remove_trait(session, trait, ignore_missing=True)
Removes a trait from the node. Accessory off, we're moving on ๐
- session โ the session you're using to make this request.
- trait โ the trait to remove from the node.
- ignore_missing โ when set to
False,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the trait doesn't exist. Otherwise,Falseis returned. Default isTrue, so by default it's chill about it.
Returns bool โ True on successfully removing the trait. False when the trait doesn't exist already.
set_traits(session, traits)
Sets traits for the node ๐
It removes any existing traits and then adds the traits you passed in to this method. So like, it's a full reset, not a merge โ no cap.
- session โ the session you're using to make this request.
- traits โ list of traits to add to the node.
Returns โ None
call_vendor_passthru(session, verb, method, body=None)
Calls a vendor passthru method. Fancy driver-specific stuff ๐
- session โ the session you're using to make this request.
- verb โ the HTTP verb, one of
GET,POST,PUT,DELETE. - method โ the method to call using
vendor_passthru. - body โ the JSON body in the HTTP call.
Returns โ the HTTP response.
Raises ValueError if verb is not one of GET, POST, PUT, DELETE
list_vendor_passthru(session)
Lists the vendor passthru methods for the node ๐
- session โ the session you're using to make this request.
Returns โ the HTTP response.
get_console(session)
Gets the node console. Peek at what's happening inside ๐ฅ๏ธ
- session โ the session you're using to make this request.
Returns โ the HTTP response.
set_console_mode(session, enabled)
Sets the node console mode ๐๏ธ
- session โ the session you're using to make this request.
- enabled โ whether the console should be enabled or not.
Returns โ None
get_node_inventory(session, node_id=None)
Gets a node's inventory. All the deets about the hardware โจ
- session โ the session you're using to make this request.
- node_id โ DEPRECATED The ID of the node. Yeah it's deprecated, don't come for me, it's still documented ๐
Returns โ the HTTP response.
list_firmware(session)
Lists the firmware components associated with the node ๐ง
- session โ the session you're using to make this request.
Returns โ the HTTP response.
patch(session, patch=None, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None, reset_interfaces=None)
Patches the remote resource ๐ฉน
This lets you modify the resource by providing a list of JSON patches to apply to it. The patches can use both the original (server-side) and SDK field names โ flexible, we love that.
- session โ the session you're using to make this request.
- patch โ additional JSON patch, as a list or one patch item. If provided, it's applied on top of any changes to the current resource.
- prepend_key โ whether the
resource_key(openstack.resource.Resource.resource_key) should be prepended in a resource creation request. Defaults toTrue. - retry_on_conflict โ whether to enable retries on HTTP CONFLICT (409). A value of
Noneleaves theAdapterdefaults alone. - base_path โ the base part of the URI for modifying resources, if it's different from
base_path(openstack.resource.Resource.base_path). - microversion โ API version to override the negotiated one.
- reset_interfaces โ yes this parameter is in the signature, and no, the original doesn't describe it. We're just acknowledging its existence respectfully ๐ซถ
Returns โ this Resource instance.
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_patch is not set to True. So like, if the resource didn't opt in, it's a no. ๐
โโ๏ธ
๐ The PowerAction Class ๐
The PowerAction enumeration represents known power actions. Think of it as the official list of ways to tell a node to move ๐
class openstack.baremetal.v1.node.PowerAction(*values)
A mapping from an action to a target power state โจ
POWER_ON = 'power on'โ power on the node. Wake up babe ๐POWER_OFF = 'power off'โ power off the node (using hard power off). Brutal but effective ๐REBOOT = 'rebooting'โ reboot the node (using hard power off). Off and back on again ๐SOFT_POWER_OFF = 'soft power off'โ power off the node using soft power off. The gentle version ๐งSOFT_REBOOT = 'soft rebooting'โ reboot the node using soft power off. Still gentle, still rebooting ๐ธ
๐ The ValidationResult Class
okay so ValidationResult is literally just the receipt ๐งพ of a validation โ it holds how that check went.
class openstack.baremetal.v1.node.ValidationResult(result, reason)
Result of a single interface validation. yes bestie, one interface at a time ๐
Variables (these are the whole personality of the class โจ):
resultโ the outcome of a validation:Truemeans slay (success),Falsemeans nope (failure), andNonemeans that interface isn't even supported, don't @ me.reasonโ ifresultisFalseorNone, this is the explanation of why. the receipts, basically ๐
๐ฆ The WaitResult Class
WaitResult is the group-chat poll result of waiting on a whole squad of nodes.
class openstack.baremetal.v1.node.WaitResult(success, failure, timeout)
A named tuple representing a result of waiting for several nodes. ๐
Each component is a list of Node objects:
Variables:
~.successโ a list ofNodeobjects that reached the state. they made it, periodt ๐~.timeoutโ a list ofNodeobjects that reached timeout. they were still "omw" ๐ญ~.failureโ a list ofNodeobjects that hit a failure. not the vibe ๐
Create new instance of WaitResult(success, failure, timeout)
๐ openstack.baremetal.v1.port
The Port Class
The Port class inherits from Resource <#openstack.resource.Resource>. it's giving very much "networking icon" energy ๐
class openstack.baremetal.v1.port.Port(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters:
_synchronizedโ ok so this is not intended to be used directly ๐ โโ๏ธ. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneso thatResourceobjects can be used without an activeConnection, like in unit tests, bestie. Any use ofself._connectioninResourcecode should protect itself with a check forNone. safety first โจresources_key = 'ports'โ Plural form of key for resource.base_path = '/ports'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.allow_patch = Trueโ Allow patch operation for this resource.commit_method = 'PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue. no substitutions ๐ฅaddressโ The physical hardware address of the network port, typically the hardware MAC address. ๐ท๏ธcategoryโ The category for the port.created_atโ Timestamp at which the port was created. โฐdescriptionโ The description for the port.extraโ A set of one or more arbitrary metadata key and value pairs.idโ The UUID of the port.internal_infoโ Internal metadata set and stored by the port. This field is read-only. Added in API microversion1.18. ๐is_pxe_enabledโ Whether PXE is enabled on the port. Added in API microversion1.19.is_smartnicโ Whether the port is a Smart NIC port. Added in API microversion1.53.linksโ A list of relative links, including the self and bookmark links.local_link_connectionโ The port bindig profile (yes, "bindig", that's how the source says it, i don't make the rules ๐ญ). If specified, must containswitch_idandport_idfields.switch_infofield is an optional string field to be used to store vendor specific information. Added in API microversion1.19.nameโ The name of the port.node_idโ The UUID of node this port belongs to.physical_networkโ The name of physical network this port is attached to. Added in API microversion1.34.port_group_idโ The UUID ofPortGroupthis port belongs to. Added in API microversion1.24.updated_atโ Timestamp at which the port was last updated.vendorโ The vendor for the port.
๐ธ openstack.baremetal.v1.port_group
The PortGroup Class
The PortGroup class inherits from Resource <#openstack.resource.Resource>. it's the friend group, and the ports are the members ๐ซถ
class openstack.baremetal.v1.port_group.PortGroup(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters:
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'portgroups'โ Plural form of key for resource.base_path = '/portgroups'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.allow_patch = Trueโ Allow patch operation for this resource.commit_method = 'PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.addressโ The physical hardware address of the portgroup, typically the hardware MAC address. Added in API microversion1.23.created_atโ Timestamp at which the portgroup was created. โฐextraโ A set of one or more arbitrary metadata key and value pairs.nameโ The name of the portgroup.idโ The UUID for the portgroup.internal_infoโ Internal metadaa set and stored by the portgroup (yep, "metadaa" โ typos stay, i don't fix the source, i just vibe check it ๐).is_standalone_ports_supportedโ Whether ports that are members of this portgroup can be used as standalone ports. Added in API microversion1.23.linksโ A list of relative links, including the self and bookmark links.modeโ Port bonding mode. Added in API microversion1.26.node_idโ UUID of the node this portgroup belongs to.portsโ A list of links to the collection of ports belonging to this portgroup. Added in API microversion1.24.propertiesโ Port group properties. Added in API microversion1.26.updated_atโ Timestamp at which the portgroup was last updated.
๐ง openstack.baremetal.v1.runbooks
The Runbook Class
The Runbook class inherits from Resource <#openstack.resource.Resource>. main character energy for automation steps ๐
class openstack.baremetal.v1.runbooks.Runbook(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters:
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'runbooks'โ Plural form of key for resource.base_path = '/runbooks'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.allow_patch = Trueโ Allow patch operation for this resource.commit_method = 'PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.nameโ The name of this resource.created_atโ Timestamp at which the runbook was created. โฐdescriptionโ A human readable description of the runbook. Introduced in API microversion1.112.extraโ A set of one or more arbitrary metadata key and value pairs.linksโ A list of relative links. Includes the self and bookmark links.stepsโ A set of physical information of the runbook.publicโ Indicates whether the runbook is publicly accessible. ๐ownerโ The name or ID of the project that owns the runbook.traitsโ The traits of the runbook. A node may only be acted upon by a runbook whose traits intersect with the traits of the node. Read-only here, use the trait methods to modify it. Introduced in API microversion1.112.updated_atโ Timestamp at which the runbook was last updated.idโ The UUID of the resource.
๐ช add_trait(session, trait)
Add a trait to the runbook. โจ
Parameters:
sessionโ The session to use for making this request.traitโ The trait to add to the runbook.
Returns: None
๐งน remove_trait(session, trait)
Remove a trait from the runbook.
Removing a trait the runbook does not have is a no-op on the server side. so like, nothing happens, no drama, it's fine ๐
Parameters:
sessionโ the session you're using to make this request, bestie.traitโ the trait you wanna yeet out of the runbook.
Returns None
set_traits(session, traits) Set traits for the runbook.
This one clears out whatever traits were already there and drops in the traits you pass to this method. Pass an empty list and it nukes all the traits โ total clean slate โจ
Parameters
sessionโ the session to use for making this request.traitsโ list of traits to set on the runbook.
Returns None
openstack.baremetal.v1.volume_connector
The VolumeConnector Class
The VolumeConnector class inherits from Resource <#openstack.resource.Resource>. ๐
class openstack.baremetal.v1.volume_connector.VolumeConnector(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ okay so this is not meant to be used directly, no cap. Go look atnew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>instead.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an active connection (unit tests, we love you). If you're usingself._connectioninResourcecode, protect yourself with a check forNone.
resources_key = 'connectors' Plural form of the key for this resource.
base_path = '/volume/connectors' The base part of the URI for this resource.
allow_create = True Allow create operation for this resource.
allow_fetch = True Allow get operation for this resource.
allow_commit = True Allow update operation for this resource.
allow_delete = True Allow delete operation for this resource.
allow_list = True Allow list operation for this resource.
allow_patch = True Allow patch operation for this resource.
commit_method = 'PATCH' Method for committing a resource. This must be PATCH if allow_patch is True โ like, that's the rule, periodt.
created_at Timestamp at which the port was created.
extra A set of one or more arbitrary metadata key and value pairs.
links A list of relative links, including the self and bookmark links.
node_id The UUID of node this port belongs to.
type The types of Volume connector.
updated_at Timestamp at which the port was last updated.
id The UUID of the port.
openstack.baremetal.v1.volume_target
The VolumeTarget Class
The VolumeTarget class inherits from Resource <#openstack.resource.Resource>. ๐ฆ
class openstack.baremetal.v1.volume_target.VolumeTarget(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ not intended to be used directly, fr fr. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resources_key = 'targets' Plural form of the key for this resource.
base_path = '/volume/targets' The base part of the URI for this resource.
allow_create = True Allow create operation for this resource.
allow_fetch = True Allow get operation for this resource.
allow_commit = True Allow update operation for this resource.
allow_delete = True Allow delete operation for this resource.
allow_list = True Allow list operation for this resource.
allow_patch = True Allow patch operation for this resource.
commit_method = 'PATCH' Method for committing a resource. This must be PATCH if allow_patch is True.
created_at Timestamp at which the port was created.
extra A set of one or more arbitrary metadata key and value pairs.
links A list of relative links. Includes the self and bookmark links.
node_id The UUID of the Node this resource belongs to.
properties A set of physical information of the volume.
updated_at Timestamp at which the port was last updated.
id The UUID of the resource.
volume_id The identifier of the volume.
volume_type The type of Volume target.
โจ Baremetal Introspection Resources โจ
openstack.baremetal_introspection.v1.Introspection
The Introspection Class
The Introspection class inherits from Resource <#openstack.resource.Resource>. ๐ง
class openstack.baremetal_introspection.v1.introspection.Introspection(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resources_key = 'introspection' Plural form of key for resource.
base_path = '/introspection' The base part of the URI for this resource.
allow_create = True Allow create operation for this resource.
allow_fetch = True Allow get operation for this resource.
allow_commit = False Allow update operation for this resource.
allow_delete = True Allow delete operation for this resource.
allow_list = True Allow list operation for this resource.
create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=True, response_has_body=False)
CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=True, response_has_body=False)
Class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create() โ iconic behavior honestly.
finished_at Timestamp at which the introspection was finished.
error The last error message (if any). ๐ญ
id The UUID of the introspection (matches the node UUID).
is_finished Whether introspection is finished.
links A list of relative links, including the self and bookmark links.
started_at Timestamp at which the introspection was started.
state The current introspection state.
abort(session) Abort introspection.
Parameters session โ the session to use for making this request.
get_data(session, processed=True) Get introspection data.
Heads up bestie: the introspection data format is not stable and can vary from environment to environment. Do not be surprised, okay?
Parameters
sessionโ the session to use for making this request.processedโ whether to fetch the final processed data (the default) or the raw unprocessed data as received from the ramdisk.
Returns introspection data from the most recent successful run.
wait(session, timeout=None, ignore_error=False) Wait for the node to reach the expected state. ๐ฐ๏ธ
Parameters
sessionโ the session to use for making this request.timeoutโ how much (in seconds) to wait for the introspection. The value ofNone(the default) means no client-side timeout.ignore_errorโ ifTrue, this call will raise an exception if the introspection reaches the error state. Otherwise the error state is considered successful and the call returns.
Returns This Introspection instance.
Raises ResourceFailure <#openstack.exceptions.ResourceFailure> if introspection fails and ignore_error is False.
Raises ResourceTimeout <#openstack.exceptions.ResourceTimeout> on timeout.
openstack.baremetal_introspection.v1.introspection_rule
The IntrospectionRule Class
The IntrospectionRule class inherits from Resource <#openstack.resource.Resource>. ๐ธ
class openstack.baremetal_introspection.v1.introspection_rule.IntrospectionRule(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resources_key = 'rules' Plural form of key for resource.
base_path = '/rules' The base part of the URI for this resource.
allow_create = Trueโ creating this resource? allowed, bestie โallow_fetch = Trueโ fetching/getting this resource? also allowed, no cap.allow_commit = Falseโ updating this resource? nope, not here ๐allow_delete = Trueโ deleting it? yep, allowed.allow_list = Trueโ listing it? allowed, periodt.create_optsโ class-level config for the create op. The default is literally:
create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=True, response_has_body=True)
Subclasses can override this to set per-resource defaults without overriding create(). iykyk ๐
idโ the UUID of the resource.conditionsโ โList of a logic statementd or operations in rulesโ โ yes, thatโs the wording, bestie ๐ซถactionsโ list of operations that will be performed if conditions of this rule are fulfilled.descriptionโ rule human-readable description.scopeโ scope of an introspection rule.linksโ a list of relative links, including the self and bookmark links.
๐งฑ Block Storage Resources ๐งฑ
๐พ Block Storage v2 Resources ๐พ
๐๏ธ openstack.block_storage.v2.backup ๐๏ธ
The Backup Class โ The Backup class inherits from Resource <#openstack.resource.Resource>. Itโs giving backup main character energy.
class openstack.block_storage.v2.backup.Backup(_synchronized=False,
connection=None, **attrs)
Volume Backup. The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = 'backup'โ singular form of key for resource.resources_key = 'backups'โ plural form of key for resource.base_path = '/backups'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_create = Trueโ allow create operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.availability_zoneโ Properties backup availability zone.containerโ the container backup in.created_atโ the date and time when the resource was created.data_timestampโ data timestamp The time when the data on the volume was first saved. If it is a backup from volume, it will be the same ascreated_atfor a backup. If it is a backup from a snapshot, it will be the same ascreated_atfor the snapshot.descriptionโ backup description.fail_reasonโ Backup fail reason.forceโ Force backup.has_dependent_backupsโ If this value is true, there are other backups depending on this backup.is_incrementalโ Indicates whether the backup mode is incremental. If this value is true, the backup mode is incremental. If this value is false, the backup mode is full.linksโ a list of links associated with this volume. Type: list.nameโ backup name.object_countโ backup object count.sizeโ the size of the volume, in gibibytes (GiB).snapshot_idโ the UUID of the source volume snapshot.statusโ backup status values:creating,available,deleting,error,restoring,error_restoring.updated_atโ the date and time when the resource was updated.volume_idโ the UUID of the volume.volume_nameโ the name of the volume.
classmethod import_record(session, *, service, url) โ Import information about a backup.
Parameters
sessionโ the session to use for making this request.serviceโ the service used to perform the backup.urlโ an identifier string to locate the backup.
Returns: The imported backup.
export_record(session) โ Export the current backup.
Parameters
sessionโ openstack session.
Returns: The backup export record fields.
restore(session, volume_id=None, name=None) โ Restore current backup to volume.
Parameters
sessionโ openstack session.volume_idโ the ID of the volume to restore the backup to.nameโ the name for new volume creation to restore.
Returns: Updated backup instance.
force_delete(session) โ Force backup deletion.
Parameters
sessionโ the session to use for making this request.
Returns: None.
reset_status(session, status) โ Reset the status of the backup.
Parameters
sessionโ the session to use for making this request.
Returns: None.
๐๏ธ openstack.block_storage.v2.capabilities ๐๏ธ
The Capabilities Class โ The Capabilities class inherits from Resource <#openstack.resource.Resource>. Capabilities core, honestly.
class
openstack.block_storage.v2.capabilities.Capabilities(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.base_path = '/capabilities'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.descriptionโ Properties The capabilities description.display_nameโ the name of volume backend capabilities.driver_versionโ the driver version.namespaceโ the storage namespace, such asOS::Storage::Capabilities::foo.pool_nameโ the name of the storage pool.propertiesโ the backend volume capabilites list, which consists of cinder standard capabilities and vendor unique properties.replication_targetsโ a list of volume backends used to replicate volumes on this backend.storage_protocolโ the storage backend for the backend volume.vendor_nameโ the name of the vendor.visibilityโ the volume type access.volume_backend_nameโ the name of the back-end volume.
๐งฉ openstack.block_storage.v2.consistency_group ๐งฉ
The ConsistencyGroup Class โ The ConsistencyGroup class inherits from Resource <#openstack.resource.Resource>. Group chat, but make it storage.
class
openstack.block_storage.v2.consistency_group.ConsistencyGroup(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = 'consistencygroup'โ singular form of key for resource.resources_key = 'consistencygroups'โ plural form of key for resource.base_path = '/consistencygroups'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_create = Trueโ allow create operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_list = Trueโ allow list operation for this resource.availability_zoneโ the availability zone.created_atโ the date and time when this resource was created.descriptionโ the description.nameโ the name.statusโ the status.volume_typesโ the volume types.add_volumesโ comma-separated list of volume UUIDs to add to the consistency group. Used in update requests only.remove_volumesโ comma-separated list of volume UUIDs to remove from the consistency group. Used in update requests only.
classmethod create_from_source(session, *, consistency_group_snapshot_id=None, consistency_group_id=None, name=None, description=None) โ Creates a new group from source.
Parameters
sessionโ the session you're using to make this request ๐ซถconsistency_group_snapshot_idโ the ID of a consistency group snapshot you want to build the new consistency group from. You gotta give this orconsistency_group_id, like, one of them, bestie, not neither ๐consistency_group_idโ the ID of a consistency group to create the new consistency group from. Again: this orconsistency_group_snapshot_idmust be provided โจnameโ the name you're slapping on the new consistency group ๐descriptionโ the description to set on the new consistency group ๐ธ
Returns The created consistency group. Iconic, honestly ๐
delete(session, error_message=None, *, microversion=None, base_path=None, params=None) Deletes the remote resource that this instance is pointing at. Bye bye ๐๐
Parameters
sessionโ the session to use when making this request.microversionโ the API version that overrides the one that got negotiated ๐ฅbase_pathโ the base part of the URI for modifying resources, if it's different frombase_path <#openstack.resource.Resource.base_path>.paramsโ query string parameters you want included in the request URL.
Returns This Resource instance ๐ซถ
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True.
Raises NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found ๐ญ
๐ openstack.block_storage.v2.consistency_group_snapshot
The ConsistencyGroupSnapshot Class
The ConsistencyGroupSnapshot class inherits from Resource <#openstack.resource.Resource>. Slay, lineage ๐
class openstack.block_storage.v2.consistency_group_snapshot.ConsistencyGroupSnapshot(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ this one is not meant to be used directly, okay? Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>instead ๐ซถconnectionโ a reference to the Connection being used. It defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. And if you're touchingself._connectioninside Resource code, protect yourself with a check forNone, mkay? ๐
resource_key = 'cgsnapshot' The singular form of the key for this resource.
resources_key = 'cgsnapshots' The plural form of the key for this resource.
base_path = '/cgsnapshots' The base part of the URI for this resource.
allow_fetch = True Allows the get operation for this resource.
allow_create = True Allows the create operation for this resource.
allow_delete = True Allows the delete operation for this resource.
allow_list = True Allows the list operation for this resource.
consistencygroup_id The UUID of the source consistency group ๐ธ
created_at The date and time when this resource was created โฐ
description The description.
name The name.
status The status.
๐ฆ openstack.block_storage.v2.extension
The Extension Class
The Extension class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v2.extension.Extension(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ nope, not for direct use, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneso Resource objects work without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
resources_key = 'extensions' The plural form of the key for this resource.
base_path = '/extensions' The base part of the URI for this resource.
allow_list = True Allows the list operation for this resource.
alias The alias for the extension.
description The extension description.
links Links pertaining to this extension ๐
name The name of this extension.
namespace A URL pointing to the namespace for this extension.
updated_at The date and time when the resource was updated. The date and time stamp format is ISO 8601 โฐโจ
๐ openstack.block_storage.v2.limits
The AbsoluteLimit Class
The AbsoluteLimit class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v2.limits.AbsoluteLimit(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not intended to be used directly, periodt. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
max_total_backup_gigabytes The maximum total amount of backups, in gibibytes (GiB).
max_total_backups The maximum number of backups.
max_total_snapshots The maximum number of snapshots.
max_total_volume_gigabytes The maximum total amount of volumes, in gibibytes (GiB).
max_total_volumes The maximum number of volumes.
total_backup_gigabytes_used The total number of backups gibibytes (GiB) used.
total_backups_used The total number of backups used.
total_gigabytes_used The total number of gibibytes (GiB) used.
total_snapshots_used The total number of snapshots used.
total_volumes_used The total number of volumes used ๐
The Limits Class
The Limit class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v2.limits.Limits(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ this is not intended to be used directly, okay? Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
resource_key = 'limits' The singular form of the key for this resource.
base_path = '/limits' The base part of the URI for this resource.
allow_fetch = True Allows the get operation for this resource.
absolute An absolute limits object.
rate Rate-limit volume copy bandwidth, used to mitigate slowdown of data access from the instances ๐๏ธ๐จ
The RateLimit Class
The RateLimit class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v2.limits.RateLimit(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ do not use this directly, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
next_available Rate limits next available time โณ
remaining Integer for rate limits remaining.
unit Unit of measurement for the value parameter.
value Integer number of requests which can be made.
verb An HTTP verb (POST, PUT, etc.) ๐ฅ
The RateLimits Class
The RateLimits class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v2.limits.RateLimits(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not meant to be used directly, periodt. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
limits A list of the specific limits that apply to the regex and uri.
regex A regex representing which routes this rate limit applies to.
uri A URI representing which routes this rate limit applies to ๐
๐ง openstack.block_storage.v2.qos_spec
The QoSSpec Class
The QoSSpec class inherits from Resource <#openstack.resource.Resource>.
associate(session, vol_type_id)โ links this QoS spec to a volume type, bestie. Params:session(the session for making this request) andvol_type_id(the ID of the volume type you're associating with). ๐disassociate(session, vol_type_id)โ breaks up this QoS spec and a volume type ๐ญ params again:session(session for the request) andvol_type_id(the ID of the volume type you're disassociating from).disassociate_all(session)โ severs this QoS spec from all the volume types at once, no cap. Param:sessionโ the session to use for making this request.delete_keys(session, keys)โ yeets keys out of this QoS spec. Params:session(session for the request) andkeys(the keys to delete). ๐๏ธ
openstack.block_storage.v2.qos_spec โ the QoSSpecAssociation era ๐ฆ
The QoSSpecAssociation Class
The QoSSpecAssociation class inherits from Resource.
class openstack.block_storage.v2.qos_spec.QoSSpecAssociation(_synchronized=False,
connection=None, **attrs)
It's the base resource, periodt. Parameters:
_synchronizedโ literally not meant to be used directly, iykyk. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection, like in unit tests. Any use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ซถ
resources_key = 'qos_associations' โ plural form of key for resource.
base_path = '/qos-specs/%(qos_spec_id)s/associations' โ the base part of the URI for this resource.
allow_list = True โ list operation is allowed for this resource.
association_type โ the type of association (e.g. "volume_type"). โญ
id โ the ID of the associated resource.
name โ the name of the associated resource.
qos_spec_id โ the ID of the QoS spec. ๐
openstack.block_storage.v2.quota_class_set โจ
The QuotaClassSet Class
The QuotaClassSet class inherits from Resource.
class openstack.block_storage.v2.quota_class_set.QuotaClassSet(_synchronized=False,
connection=None, **attrs)
Base resource energy. Parameters:
_synchronizedโ please do not use this directly, it's not for you. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐
resource_key = 'quota_class_set' โ singular form of key for resource.
base_path = '/os-quota-class-sets' โ the base part of the URI for this resource.
allow_fetch = True โ get operation is allowed for this resource.
allow_commit = True โ update operation is allowed for this resource.
backup_gigabytes โ the size (GiB) of backups that are allowed for each project.
backups โ the number of backups that are allowed for each project.
gigabytes โ the size (GiB) of volumes and snapshots that are allowed for each project.
groups โ the number of groups that are allowed for each project.
per_volume_gigabytes โ the size (GiB) of volumes in request that are allowed for each volume.
snapshots โ the number of snapshots that are allowed for each project.
volumes โ the number of volumes that are allowed for each project. ๐
openstack.block_storage.v2.quota_set ๐ธ
The QuotaSet Class
The QuotaSet class inherits from Resource.
class openstack.block_storage.v2.quota_set.QuotaSet(_synchronized=False,
connection=None, **attrs)
The base resource, as ever. Parameters:
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ง
backup_gigabytes โ properties, the size (GB) of backups that are allowed for each project. (Yep, GB here, not GiB โ that's what it says, don't come for me ๐)
backups โ the number of backups that are allowed for each project.
gigabytes โ the size (GB) of volumes and snapshots that are allowed for each project.
groups โ the number of groups that are allowed for each project.
per_volume_gigabytes โ the size (GB) of volumes in request that are allowed for each volume.
snapshots โ the number of snapshots that are allowed for each project.
volumes โ the number of volumes that are allowed for each project. ๐
openstack.block_storage.v2.service ๐ฅ
The Service Class
The Service class inherits from Resource.
class openstack.block_storage.v2.service.Service(_synchronized=False,
connection=None, **attrs)
Base resource behaviour, iconic as always. Parameters:
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐
resources_key = 'services' โ plural form of key for resource.
base_path = '/os-services' โ the base part of the URI for this resource.
allow_list = True โ list operation is allowed for this resource.
active_backend_id โ the ID of active storage backend (cinder-volume services only).
availability_zone โ the availability zone of service.
binary โ binary name of service.
disabled_reason โ disabled reason of service.
host โ the name of the host where service runs.
name โ service name.
replication_status โ the volume service replication status (cinder-volume services only).
state โ state of service.
status โ status of service.
updated_at โ the date and time when the resource was updated. โฐ
classmethod find(session, name_or_id, ignore_missing=True, list_base_path=None, *, microversion=None, all_projects=None, **params)
Find a resource by its name or id. The signature is exactly that, all_projects included โ that's the vibe check, no further tea in the docs. ๐
Parameters:
sessionโ the session to use for making this request.name_or_idโ this resource's identifier, if needed by the request. The default isNone.ignore_missingโ when set toFalse,NotFoundException(fromopenstack.exceptions) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. ๐list_base_pathโbase_pathto be used when need listing resources.microversionโ API version to override the negotiated one.paramsโ any additional parameters to be passed into underlying methods, such as toexisting()in order to pass on URI parameters.
Ngl, thatignore_missingdefault ofTrueis lowkey the whole personality of this method โFalsemeans it will throw hands viaNotFoundException. ๐
Returns โ the Resource object that matches the name or id you handed it, or None if literally nothing matches. ๐ซถ
Raises openstack.exceptions.DuplicateResource if more than one resource shows up for this request (messy, we don't love that).
Raises openstack.exceptions.NotFoundException if nothing is found and ignore_missing is False. no vibes found, so it throws hands ๐ญ
commit(session, prepend_key=False, *args, **kwargs)
Commits the state of your instance to the remote resource. like hitting send on the whole object ๐
Parameters
sessionโ the session used to make this request.prepend_keyโ whetherresource_keyshould be prepended in a resource creation request. Default toTrue. (yes, the signature saysFalse, the docs sayTrue, that's just how it is, don't come for me ๐)retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults alone.base_pathโ base part of the URI for modifying resources, if it's different frombase_path.microversionโ API version to override the negotiated one.attrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns โ this Resource instance. iconic.
Raises MethodNotSupported if Resource.allow_commit is not set to True. so check your flags bestie โจ
enable(session)
Enable service. that's it, that's the whole thing ๐
disable(session, *, reason=None)
Disable service. you can pass a reason, optional, no pressure.
failover(session, *, backend_id=None)
Failover a service.
Only applies to replicating cinder-volume services. like, specifically those, don't try it elsewhere ๐ฅ
๐ฆ openstack.block_storage.v2.snapshot
The Snapshot Class
The Snapshot class inherits from Resource.
class openstack.block_storage.v2.snapshot.Snapshot(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. safety first ๐
resource_key = 'snapshot' : Singular form of key for resource.
resources_key = 'snapshots' : Plural form of key for resource.
base_path = '/snapshots' : The base part of the URI for this resource.
allow_fetch = True : Allow get operation for this resource.
allow_create = True : Allow create operation for this resource.
allow_delete = True : Allow delete operation for this resource.
allow_commit = True : Allow update operation for this resource.
allow_list = True : Allow list operation for this resource.
created_at : The timestamp of this snapshot creation.
description : Description of snapshot. Default is None.
is_forced : Indicate whether to create snapshot, even if the volume is attached. Default is False. Type: bool.
size : The size of the volume, in gibibytes (GiB).
status : The current status of this snapshot. Potential values are creating, available, deleting, error, and error_deleting.
updated_at : The date and time when the resource was updated.
volume_id : The ID of the volume this snapshot was taken of.
force_delete(session)
Force snapshot deletion. blunt force, but make it storage ๐
reset_status(session, status)
Reset the status of the snapshot. you say what the status should be, it obeys.
classmethod manage(session, volume_id, ref, name=None, description=None, metadata=None)
Manage a snapshot under block storage provisioning.
unmanage(session)
Unmanage a snapshot from block storage provisioning. bestie broke up with the snapshot ๐ฅ
The SnapshotDetail Class
The SnapshotDetail class inherits from Snapshot.
openstack.block_storage.v2.snapshot.SnapshotDetail : alias of Snapshot.
๐ธ openstack.block_storage.v2.stats
The Pools Class
The Pools class inherits from Resource.
class openstack.block_storage.v2.stats.Pools(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = '' : Singular form of key for resource. (yes, it's an empty string, that's not a typo ๐ซ )
resources_key = 'pools' : Plural form of key for resource.
base_path = '/scheduler-stats/get_pools?detail=True' : The base part of the URI for this resource.
allow_fetch = False : Allow get operation for this resource.
allow_create = False : Allow create operation for this resource.
allow_delete = False : Allow delete operation for this resource.
allow_list = True : Allow list operation for this resource.
name : The Cinder name for the pool.
capabilities : returns a dict with information about the pool.
๐ openstack.block_storage.v2.transfer
The Volume Transfer Class
The Volume Transfer class inherits from Resource.
class openstack.block_storage.v2.transfer.Transfer(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = 'transfer' : Singular form of key for resource.
resources_key = 'transfers' : Plural form of key for resource.
base_path = '/os-volume-transfer' : The base part of the URI for this resource.
allow_create = True : Allow create operation for this resource.
allow_delete = True : Allow delete operation for this resource.
allow_fetch = True : Allow get operation for this resource.
allow_list = True : Allow list operation for this resource.
id : UUID of the transfer.
created_at : The date and time when the resource was created.
name : Name of the volume to transfer.
volume_id : ID of the volume to transfer.
auth_key : Auth key for the transfer. ๐
links : A list of links associated with this volume. Type: list.
accept(session, *, auth_key=None)
Accept a volume transfer. say yes to the transfer ๐
Parameters
sessionโ the session to use for making this request.auth_keyโ the authentication key for the volume transfer.
Returns โ this Transfer instance.
โญ openstack.block_storage.v2.type
The Type Class
The Type class inherits from Resource.
class openstack.block_storage.v2.type.Type(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = 'volume_type' : Singular form of key for resource.
resources_key = 'volume_types' : Plural form of key for resource.
base_path = '/types' : The base part of the URI for this resource.
allow_fetch = True : Allow get operation for this resource.
allow_create = True : Allow create operation for this resource.
allow_delete = True : Allow delete operation for this resource.
allow_list = True : Allow list operation for this resource.
extra_specs : A dict of extra specifications. "capabilities" is a usual key.
is_public : a private volume-type. Type: bool. (that's what it says, and yes the wording is a little cursed, but we move ๐ญ)
set_extra_specs(session, **extra_specs)
Update extra specs.
This call will replace only the extra_specs with the same keys given here. Other keys will not be modified. so it's surgical, not a nuke ๐
Parameters
(the deets roll in right here โ keep it moving, bestie ๐ง)
sessionโ the session you're using to make this request ๐ซถextra_specsโ key/valueextra_specspairs to be update on this volume type. All keys and values.
Returns โ the updated extra specs. โจ
๐ delete_extra_specs(session, keys)
Delete extra specs. Bye girl ๐
โ ๏ธ okay so real talk: this method will do a HTTPDELETErequest for every key inkeys. Not one big batch. Every. Single. Key. Just so you know what you're signing up for ๐ซ
Parameters
sessionโ the session to use for this request.keysโ the keys to delete.
Returns โ None
๐ฆ get_private_access(session)
List projects with private access to the volume type. Peek at the guest list ๐
Parameters
sessionโ the session to use for making this request.
Returns โ the volume type access response.
๐ธ add_private_access(session, project_id)
Add project access from the volume type.
Parameters
sessionโ the session to use for making this request.project_idโ the project to add access for.
๐ผ remove_private_access(session, project_id)
Remove project access from the volume type. Sorry bestie, you're off the list ๐ญ
Parameters
sessionโ the session to use for making this request.project_idโ the project to remove access for.
๐ง openstack.block_storage.v2.volume
๐ The Volume Class
The Volume class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v2.volume.Volume(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = 'volume' โ singular form of key for resource.
resources_key = 'volumes' โ plural form of key for resource.
base_path = '/volumes' โ the base part of the URI for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_create = True โ allow create operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_list = True โ allow list operation for this resource.
attachments โ TODO(briancurtin): This is currently undocumented in the API.
availability_zone โ the availability zone.
consistency_group_id โ ID of the consistency group.
created_at โ the timestamp of this volume creation.
description โ the volume description.
extended_replication_status โ extended replication status on this volume.
host โ the volume's current back-end.
image_id โ the ID of the image from which you want to create the volume. Required to create a bootable volume.
is_bootable โ enables or disables the bootable attribute. You can boot an instance from a bootable volume. Type: bool
is_encrypted โ True if this volume is encrypted, False if not. Type: bool
is_multiattach โ whether volume will be sharable or not.
migration_id โ the volume ID that this volume's name on the back-end is based on.
migration_status โ the status of this volume's migration (None means that a migration is not currently in progress).
project_id โ the project ID associated with current back-end.
replication_driver_data โ data set by the replication driver
replication_status โ status of replication on this volume.
scheduler_hints โ scheduler hints for the volume
size โ the size of the volume, in gibibytes (GiB). Type: int
snapshot_id โ to create a volume from an existing snapshot, specify the ID of the existing volume snapshot. If specified, the volume is created in same availability zone and with same size of the snapshot.
source_volume_id โ to create a volume from an existing volume, specify the ID of the existing volume. If specified, the volume is created with same size of the source volume.
status โ one of the following values: creating, available, attaching, in-use deleting, error, error_deleting, backing-up, restoring-backup, error_restoring. For details on these statuses, see the Block Storage API documentation.
updated_at โ the date and time when the resource was updated.
user_id โ the user ID associated with the volume
volume_image_metadata โ one or more metadata key and value pairs about image
volume_type โ the name of the associated volume type.
โญ extend(session, size)
Extend a volume size. Make it bigger, make it iconic ๐
โญ set_bootable_status(session, bootable=True)
Set volume bootable status flag.
โญ set_readonly(session, readonly)
Set volume readonly flag.
โญ set_image_metadata(session, metadata)
Sets image metadata key-value pairs on the volume.
โญ delete_image_metadata(session)
Remove all image metadata from the volume. Clean slate energy โจ
โญ delete_image_metadata_item(session, key)
Remove a single image metadata from the volume.
โญ reset_status(session, status=None, attach_status=None, migration_status=None)
Reset volume statuses (admin operation). Admin only, bestie โ main character privileges ๐
โญ attach(session, mountpoint, instance=None, host_name=None)
Attach volume to server.
โญ detach(session, attachment, force=False, connector=None)
Detach volume from server.
โญ unmanage(session)
Unmanage volume.
โญ retype(session, new_type, migration_policy=None)
Change volume type. Glow-up arc ๐
โญ migrate(session, host=None, force_host_copy=False, lock_volume=False)
Migrate volume.
โญ complete_migration(session, new_volume_id, error=False)
Complete volume migration.
โญ force_delete(session)
Force volume deletion.
โญ upload_to_image(session, image_name, *, force=False, disk_format=None, container_format=None)
Upload the volume to image service.
๐ง Block Storage v3 Resources
๐ฆ openstack.block_storage.v3.attachment
๐ The Volume Attachment Class
The Volume Attachment class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v3.attachment.Attachment(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
๐ complete(session, *, microversion=None)
Mark the attachment as completed. Finished, done, periodt ๐
๐ create(session, prepend_key=True, base_path=None, *, resource_request_key=None, resource_response_key=None, microversion=None, **params)
Create a remote resource based on this instance.
Parameters
sessionโ the session to use for making this request.prepend_keyโ DEPRECATED โ configurecreate_optsinstead. Whether theresource_keyshould be prepended in a resource creation request. Default toTrue.base_pathโ base part of the URI for creating resources, if different frombase_path<#openstack.resource.Resource.base_path>.resource_request_keyโ DEPRECATED โ configurecreate_optsinstead. Overrides the usage ofresource_key<#openstack.resource.Resource.resource_key> when prepending a key to the request body. Ignored ifprepend_keyis false.resource_response_keyโ DEPRECATED โ configurecreate_optsinstead. Overrides the usage ofresource_key<#openstack.resource.Resource.resource_key> when processing response bodies. Ignored ifprepend_keyis false.microversionโ API version to override the negotiated one.paramsโ additional params to pass.
Returns โ this Resource instance.
Raises โ MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_create is not set to True. ๐ญ no creating for you if that flag's off, fr fr.
update([E], **F) -> None.โ Update D from mapping/iterable E and F. If E is present and has a.keys()method, then does:for k in E.keys(): D[k] = E[k]If E is present and lacks a.keys()method, then does:for k, v in E: D[k] = vIn either case, this is followed by:for k in F: D[k] = F[k]
๐ง openstack.block_storage.v3.availability_zone
The AvailabilityZone Class ๐ซ
okay so the AvailabilityZone class inherits from Resource <#openstack.resource.Resource> โ yes bestie, it's giving inheritance hierarchy realness ๐ซถ
class openstack.block_storage.v3.availability_zone.AvailabilityZone(_synchronized=False,
connection=None, **attrs)
The base resource, periodt.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐ like pls don't touch, it's not for youconnectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone. ๐
resource_key = '' โ Singular form of key for resource. โจ
resources_key = 'availabilityZoneInfo' โ Plural form of key for resource. ๐ธ
base_path = '/os-availability-zone' โ The base part of the URI for this resource. ๐ฅ
allow_list = True โ Allow list operation for this resource. ๐
Properties ๐ฆ
nameโ Name of availability zonestateโ State of availability zone,"available"is usual key
๐พ openstack.block_storage.v3.backup
The Backup Class ๐
The Backup class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v3.backup.Backup(_synchronized=False,
connection=None, **attrs)
Volume Backup โ iconic, lowkey essential ๐ญ
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐ซถconnectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone. ๐
resource_key = 'backup' โ Singular form of key for resource. โญ
resources_key = 'backups' โ Plural form of key for resource. ๐
base_path = '/backups' โ The base part of the URI for this resource. โจ
allow_fetch = True โ Allow get operation for this resource. ๐
allow_create = True โ Allow create operation for this resource. ๐ง
allow_delete = True โ Allow delete operation for this resource. ๐
allow_commit = True โ Allow update operation for this resource. ๐ฅ
allow_list = True โ Allow list operation for this resource. ๐
Properties ๐
availability_zoneโ backup availability zonecontainerโ The container backup increated_atโ The date and time when the resource was created.data_timestampโ data timestamp The time when the data on the volume was first saved. If it is a backup from volume, it will be the same ascreated_atfor a backup. If it is a backup from a snapshot, it will be the same ascreated_atfor the snapshot.descriptionโ backup descriptionencryption_key_idโ The UUID of the encryption key. Only included for encrypted volumes.fail_reasonโ Backup fail reasonforceโ Force backuphas_dependent_backupsโ If this value istrue, there are other backups depending on this backup.is_incrementalโ Indicates whether the backup mode is incremental. If this value istrue, the backup mode is incremental. If this value isfalse, the backup mode is full.linksโ A list of links associated with this volume. Type:listmetadataโ The backup metadata. New in version3.43nameโ backup nameobject_countโ backup object countproject_idโ The UUID of the owning project. New in version3.18sizeโ The size of the volume, in gibibytes (GiB).snapshot_idโ The UUID of the source volume snapshot.statusโ backup status values:creating,available,deleting,error,restoring,error_restoringupdated_atโ The date and time when the resource was updated.user_idโ The UUID of the project owner. New in3.56volume_idโ The UUID of the volume.volume_nameโ The name of the volume.
classmethod import_record(session, *, service, url) โ Import information about a backup ๐ธ
Parameters
sessionโ The session to use for making this request.serviceโ The service used to perform the backup.urlโ An identifier string to locate the backup.
Returns โ The imported backup
export_record(session) โ Export information about the backup โจ
Parameters
sessionโ The session to use for making this request.
Returns โ The backup export record fields
export(session) โ Export information about the backup ๐ฆ
Parameters
sessionโ The session to use for making this request.
Returns โ The backup export record fields
restore(session, volume_id=None, name=None) โ Restore current backup to volume ๐
Parameters
sessionโ The session to use for making this request.volume_idโ The ID of the volume to restore the backup to.nameโ The name for new volume creation to restore.
Returns โ Updated backup instance
force_delete(session) โ Force backup deletion ๐
Parameters
sessionโ The session to use for making this request.
Returns โ None
reset_status(session, status) โ Reset the status of the backup ๐
Parameters
sessionโ The session to use for making this request.
Returns โ None
๐ openstack.block_storage.v3.block_storage_summary
The Block Storage Summary Class ๐
The Block Storage Summary class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v3.block_storage_summary.BlockStorageSummary(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐connectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone. ๐
base_path = '/volumes/summary' โ The base part of the URI for this resource. โจ
allow_fetch = True โ Allow get operation for this resource. ๐
Properties ๐
total_sizeโ Total size of all the volumestotal_countโ Total count of all the volumesmetadataโ Metadata of all the volumes
๐ ๏ธ openstack.block_storage.v3.capabilities
The Capabilities Class ๐ง
The Capabilities class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v3.capabilities.Capabilities(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐ซถconnectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone. ๐
base_path = '/capabilities' โ The base part of the URI for this resource. ๐ฅ
allow_fetch = True โ Allow get operation for this resource. ๐
Properties ๐
descriptionโ The capabilities descriptiondisplay_nameโ The name of volume backend capabilities.driver_versionโ The driver version.namespaceโ The storage namespace, such asOS::Storage::Capabilities::foo.pool_nameโ The name of the storage pool.propertiesโ The backend volume capabilites list, which consists of cinder standard capabilities and vendor unique properties.replication_targetsโ A list of volume backends used to replicate volumes on this backend.storage_protocolโ The storage backend for the backend volume.vendor_nameโ The name of the vendor.visibilityโ The volume type access.volume_backend_nameโ The name of the back-end volume.
openstack.block_storage.v3.cluster
The Cluster Class โ okay bestie, this one inherits from Resource (openstack.resource.Resource) and itโs giving storage-cluster realness ๐ซถ.
class openstack.block_storage.v3.cluster.Cluster(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Cluster class config + attrs โจ
resource_key='cluster'โ Singular form of key for resource.resources_key='clusters'โ Plural form of key for resource.base_path='/clusters'โ The base part of the URI for this resource.allow_fetch=Trueโ Allow get operation for this resource.allow_list=Trueโ Allow list operation for this resource.active_backend_idโ The ID of active storage backend (cinder-volume services only).binaryโ The binary name of the services in the cluster.created_atโ The date and time when the resource was created.disabled_reasonโ The reason for disabling the cluster.frozenโ Whether the cluster is frozen for replication.last_heartbeatโ The last periodic heartbeat received.nameโ The name of the cluster.num_down_hostsโ The number of down hosts in the cluster.num_hostsโ The number of hosts in the cluster.replication_statusโ The cluster replication status.stateโ The state of the cluster. One ofupordown.statusโ The status of the cluster. One ofenabledordisabled.updated_atโ The date and time when the resource was last updated.
Methods ๐
enable(session)โ Enable scheduling for the cluster.disable(session, *, reason=None)โ Disable scheduling for the cluster.reasonโ The reason for disabling the cluster.
openstack.block_storage.v3.consistency_group
The ConsistencyGroup Class โ this one also inherits from Resource (openstack.resource.Resource), and itโs consistency-group coded fr fr ๐.
class openstack.block_storage.v3.consistency_group.ConsistencyGroup(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
ConsistencyGroup class config + attrs ๐ธ
resource_key='consistencygroup'โ Singular form of key for resource.resources_key='consistencygroups'โ Plural form of key for resource.base_path='/consistencygroups'โ The base part of the URI for this resource.allow_fetch=Trueโ Allow get operation for this resource.allow_create=Trueโ Allow create operation for this resource.allow_delete=Trueโ Allow delete operation for this resource.allow_commit=Trueโ Allow update operation for this resource.allow_list=Trueโ Allow list operation for this resource.availability_zoneโ The availability zone.created_atโ The date and time when this resource was created.descriptionโ The description.nameโ The name.statusโ The status.volume_typesโ The volume types.add_volumesโ Comma-separated list of volume UUIDs to add to the consistency group. Used in update requests only.remove_volumesโ Comma-separated list of volume UUIDs to remove from the consistency group. Used in update requests only.
classmethod create_from_source(...) โ Creates a new group from source. Lowkey iconic behavior โจ
classmethod create_from_source(session, *, consistency_group_snapshot_id=None, consistency_group_id=None, name=None, description=None)
Parameters
sessionโ The session to use for making this requestconsistency_group_snapshot_idโ The ID of a consistency group snapshot to create the new consistency group from. Either this orconsistency_group_idmust be providedconsistency_group_idโ The ID of a consistency group to create the new consistency group from. Either this orconsistency_group_snapshot_idmust be providednameโ The name to assign to the new consistency groupdescriptionโ The description to set on the new consistency group
Returns โ The created consistency group
delete(...) โ Delete the remote resource based on this instance. Bestie, this is the cleanup arc ๐
delete(session, error_message=None, *, microversion=None, base_path=None, params=None)
Parameters
sessionโ The session to use for making this request.microversionโ API version to override the negotiated one.base_pathโ Base part of the URI for modifying resources, if different frombase_path(openstack.resource.Resource.base_path).paramsโ Query string parameters to include in the request URL.
Returns โ This Resource instance.
- Raises
MethodNotSupported(openstack.exceptions.MethodNotSupported) ifResource.allow_commitis not set toTrue. - Raises
NotFoundException(openstack.exceptions.NotFoundException) if the resource was not found.
openstack.block_storage.v3.consistency_group_snapshot
The ConsistencyGroupSnapshot Class โ inherits from Resource (openstack.resource.Resource). Snapshot era, no cap ๐ธ
class openstack.block_storage.v3.consistency_group_snapshot.ConsistencyGroupSnapshot(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
ConsistencyGroupSnapshot class config + attrs ๐ฆ
resource_key='cgsnapshot'โ Singular form of key for resource.resources_key='cgsnapshots'โ Plural form of key for resource.base_path='/cgsnapshots'โ The base part of the URI for this resource.allow_fetch=Trueโ Allow get operation for this resource.allow_create=Trueโ Allow create operation for this resource.allow_delete=Trueโ Allow delete operation for this resource.allow_list=Trueโ Allow list operation for this resource.consistencygroup_idโ The UUID of the source consistency group.created_atโ The date and time when this resource was created.descriptionโ The description.nameโ The name.statusโ The status.
openstack.block_storage.v3.default_type
The DefaultType Class โ inherits from Resource (openstack.resource.Resource). Default-type main character energy ๐
class openstack.block_storage.v3.default_type.DefaultType(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
DefaultType class config + attrs ๐
resource_key='default_type'โ Singular form of key for resource.resources_key='default_types'โ Plural form of key for resource.base_path='/default-types'โ The base part of the URI for this resource.allow_fetch=Trueโ Allow get operation for this resource.allow_create=Trueโ Allow create operation for this resource.allow_delete=Trueโ Allow delete operation for this resource.allow_list=Trueโ Allow list operation for this resource.create_opts=CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='PUT', requires_id=True, response_has_body=True)โ Class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate().project_idโ The UUID of the project.volume_type_idโ the UUID for an existing volume type. ๐
๐ฆ openstack.block_storage.v3.extension
๐ The Extension Class
The Extension class inherits from Resource <#openstack.resource.Resource>. Bestie, it's giving core resource energy.
class openstack.block_storage.v3.extension.Extension(_synchronized=False, connection=None, **attrs)
This is The base resource. No cap.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'extensions'โ plural form of key for resource.base_path = '/extensions'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.
Properties:
aliasโ the alias for the extension.descriptionโ the extension description.linksโ links pertaining to this extension.nameโ the name of this extension.updated_atโ the date and time when the resource was updated. The date and time stamp format is ISO 8601. ๐ฐ๏ธ
๐ธ openstack.block_storage.v3.group
๐ The Group Class
The Group class inherits from Resource <#openstack.resource.Resource>. Yup, another icon inheriting from the base resource.
class openstack.block_storage.v3.group.Group(_synchronized=False, connection=None, **attrs)
This is The base resource, periodt.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'group'โ singular form of key for resource.resources_key = 'groups'โ plural form of key for resource.base_path = '/groups'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_create = Trueโ allow create operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_list = Trueโ allow list operation for this resource.add_volumesโ a comma-separated list of volume IDs to add to the group.remove_volumesโ a comma-separated list of volume IDs to remove from the group.delete(session, error_message=None, *, microversion=None, delete_volumes=False, **attrs)โ delete a group.fetch_replication_targets(session)โ fetch replication targets for the group. Parameters:sessionโ the session to use for making this request. Returns: this group with thereplication_targetsfield populated.enable_replication(session)โ enable replication for the group. Parameters:sessionโ the session to use for making this request.disable_replication(session)โ disable replication for the group. Parameters:sessionโ the session to use for making this request.failover_replication(session, *, allowed_attached_volume=False, secondary_backend_id=None)โ failover replication for the group. Parameters:sessionโ the session to use for making this request.allowed_attached_volumeโ whether to allow attached volumes in the group.secondary_backend_idโ the secondary backend ID. Returns:None.
reset_status(session, status)โ resets the status for a group. Parameters:sessionโ the session to use for making this request.statusโ the status for the group.
classmethod create_from_source(session, group_snapshot_id, source_group_id, name=None, description=None)โ creates a new group from source.
๐ openstack.block_storage.v3.group_snapshot
๐ง The GroupSnapshot Class
The GroupSnapshot class inherits from Resource <#openstack.resource.Resource>. Snapshot behavior, but make it group chat.
class openstack.block_storage.v3.group_snapshot.GroupSnapshot(_synchronized=False, connection=None, **attrs)
This is The base resource. Lowkey iconic.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'group_snapshot'โ singular form of key for resource.resources_key = 'group_snapshots'โ plural form of key for resource.base_path = '/group_snapshots'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_create = Trueโ allow create operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_commit = Falseโ allow update operation for this resource? Nope, it'sFalse, so updates are not allowed.allow_list = Trueโ allow list operation for this resource.
Properties:
created_atโ the date and time when the resource was created.descriptionโ the group snapshot description.group_idโ the UUID of the source group.group_type_idโ the group type ID.idโ the ID of the group snapshot.nameโ the group snapshot name.project_idโ the UUID of the volume group snapshot project.statusโ the status of the generic group snapshot.reset_status(session, state)โ resets the status for a group snapshot. ๐ซถ
๐ฅ openstack.block_storage.v3.group_type
๐ The GroupType Class
The GroupType class inherits from Resource <#openstack.resource.Resource>. Main character group type behavior, fr fr.
class openstack.block_storage.v3.group_type.GroupType(_synchronized=False, connection=None, **attrs)
This is The base resource, bestie.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'group_type'โ singular form of key for resource.resources_key = 'group_types'โ plural form of key for resource.base_path = '/group_types'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_create = Trueโ allow create operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_list = Trueโ allow list operation for this resource.
Properties:
descriptionโ the group type description.group_specsโ contains the specifications for a group type.is_publicโ whether the group type is publicly visible.fetch_group_specs(session)โ fetchgroup_specsof the group type. These are returned by default if the user has suitable permissions (i.e. you're an admin) but by default you also need the same permissions to access this API. That means this function is kind of useless. However, that is how the API was designed and it is theoretically possible that people will have modified their policy to allow this but not the other so we provide this anyway. Parameters:sessionโ the session to use for making this request. Returns: an updated version of this object.create_group_specs(session, specs)โ creates group specs for the group type. This will override whatever specs are already present on the group type. Parameters:sessionโ the session to use for making this request.specsโ a dict of group specs to set on the group type. Returns: an updated version of this object.
get_group_specs_property(session, prop)โ retrieve a group spec property of the group type. Parameters:sessionโ the session to use for making this request.
propโ the name of the group spec property you're updating ๐
โจ Returns
The value of the group spec property. That's the whole vibe โ you get the thing back. ๐ซถ
๐ ๏ธ update_group_specs_property(session, prop, val)
Update a group spec property on the group type. Bestie, this is the setter one. ๐
Parameters
sessionโ the session you're using to make this request.propโ the name of the group spec property you're updating.valโ the value you're assigning to that group spec property.
Returns
The updated value of the group spec property โ it hands you back what it just set, iconic behaviour honestly ๐
๐๏ธ delete_group_specs_property(session, prop)
Delete a group spec property from the group type. Poof, gone, no notes. ๐ฆ
Parameters
sessionโ the session you're using to make this request.propโ the name of the group spec property to delete.
Returns
None โ literally nothing comes back, and that's the whole point ๐
๐ง openstack.block_storage.v3.limits
The AbsoluteLimit Class
The AbsoluteLimit class inherits from Resource (iykyk, that's the base-resource situation). ๐ง
class openstack.block_storage.v3.limits.AbsoluteLimit(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not meant to be used directly. Go look atnew()andexisting()instead, ok?connectionโ a reference to theConnectionbeing used. It defaults toNoneso thatResourceobjects can exist without a liveConnection, like in unit tests. Any use ofself._connectioninsideResourcecode should protect itself with a check forNone. ๐
Attributes
max_total_backup_gigabytesโ the maximum total amount of backups, in gibibytes (GiB).max_total_backupsโ the maximum number of backups.max_total_snapshotsโ the maximum number of snapshots.max_total_volume_gigabytesโ the maximum total amount of volumes, in gibibytes (GiB).max_total_volumesโ the maximum number of volumes.total_backup_gigabytes_usedโ the total number of backups gibibytes (GiB) used.total_backups_usedโ the total number of backups used.total_gigabytes_usedโ the total number of gibibytes (GiB) used.total_snapshots_usedโ the total number of snapshots used.total_volumes_usedโ the total number of volumes used.
The Limits Class
The Limits class inherits from Resource, same as literally all of these. ๐
class openstack.block_storage.v3.limits.Limits(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting(), bestie.connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects work with no activeConnection, like in unit tests.self._connectionusage inResourcecode should check forNonefirst. ๐ซถ
Attributes
resource_key = 'limits'โ the singular form of the key for this resource.base_path = '/limits'โ the base part of the URI for this resource.allow_fetch = Trueโ allows the get operation for this resource.absoluteโ an absolute limits object.rateโ rate-limit volume copy bandwidth, used to mitigate slow down of data access from the instances. ๐
The RateLimit Class
The RateLimit class inherits from Resource (yes, again, it's giving family reunion). ๐
class openstack.block_storage.v3.limits.RateLimit(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly; seenew()andexisting().connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, e.g. in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ฆ
Attributes
next_availableโ rate limits next available time.remainingโ integer for rate limits remaining.unitโ unit of measurement for thevalueparameter.valueโ integer number of requests which can be made.verbโ an HTTP verb (POST, PUT, etc.). ๐ฅ
The RateLimits Class
The RateLimits class inherits from Resource, obviously, the whole squad does. ๐ง
class openstack.block_storage.v3.limits.RateLimits(_synchronized=False, connection=None, **attrs)
The base resource โญ
Parameters
_synchronizedโ not intended to be used directly.new()andexisting()are right there, go look.connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ญ
Attributes
limitsโ a list of the specific limits that apply to theregexanduri.regexโ a regex representing which routes this rate limit applies to.uriโ a URI representing which routes this rate limit applies to. โจ
๐ธ openstack.block_storage.v3.manageable_snapshot
The ManageableSnapshot Class
The ManageableSnapshot class inherits from Resource โ sniffing out snapshots you could manage. ๐
class openstack.block_storage.v3.manageable_snapshot.ManageableSnapshot(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐
Attributes
resource_key = 'manageable-snapshot'โ the singular form of the key for this resource.resources_key = 'manageable-snapshots'โ the plural form of the key for this resource.base_path = '/manageable_snapshots'โ the base part of the URI for this resource.allow_list = Trueโ allows the list operation for this resource.cinder_idโ the ID of this snapshot in Cinder, if it's already managed.extra_infoโ additional information about the snapshot.reason_not_safeโ the reason the snapshot isn't safe to manage, if that applies.referenceโ a reference to identify the existing snapshot on the backend.safe_to_manageโ whether it's safe to manage this snapshot.sizeโ the size of the snapshot in GiB.source_referenceโ a reference to the source volume of the snapshot. ๐ธ
๐๏ธ openstack.block_storage.v3.manageable_volume
The ManageableVolume Class
The ManageableVolume class inherits from Resource โ same energy, but volumes this time. ๐ฆ
class openstack.block_storage.v3.manageable_volume.ManageableVolume(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly; peepnew()andexisting().connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ซถ
Attributes
resource_key = 'manageable-volume'โ the singular form of the key for this resource.resources_key = 'manageable-volumes'โ the plural form of the key for this resource.base_path = '/manageable_volumes'โ the base part of the URI for this resource.allow_list = Trueโ allows the list operation for this resource.cinder_idโ the ID of this volume in Cinder, if it's already managed.extra_infoโ additional information about the volume.reason_not_safeโ the reason the volume isn't safe to manage, if that applies.referenceโ a reference to identify the existing volume on the backend.safe_to_manageโ whether it's safe to manage this volume.sizeโ the size of the volume in GiB. ๐ฆ
๐ openstack.block_storage.v3.message
The Message Class
The Message class inherits from Resource โ yes bestie, block storage has messages too, it's a whole thing. ๐ฌ
class openstack.block_storage.v3.message.Message(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting()instead, mwah.connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'messages'โ Singular form of key for resource.resources_key = 'messages'โ Plural form of key for resource.base_path = '/messages'โ The base part of the URI for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.created_atโ Properties The date and time when the resource was created. Format is ISO 8601:CCYY-MM-DDThh:mm:ssยฑhh:mmExample:2015-08-27T09:49:58-05:00event_idโ The id of the event to this message.guaranteed_untilโ The expire time of message, message could be deleted after this time.message_levelโ The level of the message, possible value is only'ERROR'now.request_idโ The id of the request during which the message was created.resource_typeโ The resource type corresponding toresource_uuid.resource_uuidโ The UUID of the resource during whose operation the message was created.user_messageโ The translated readable message corresponding toevent_id.
okay bestie, message resource done โ next up is the QoS spec era, and it's lowkey iconic ๐
openstack.block_storage.v3.qos_spec
The QosSpec Class
The QoSSpec class inherits from Resource.
class openstack.block_storage.v3.qos_spec.QoSSpec(_synchronized=False, connection=None, **attrs)
The base resource
Parameters โ the usual iconic duo, every time:
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'qos_specs'โ Singular form of key for resource.resources_key = 'qos_specs'โ Plural form of key for resource.base_path = '/qos-specs'โ The base part of the URI for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_create = Trueโ Allow create operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.idโ The ID of this resource.nameโ The name of this resource.
associate(session, vol_type_id) โ Associate this QoS spec with a volume type.
Parameters
sessionโ The session to use for making this request.vol_type_idโ The ID of the volume type to associate with.
disassociate(session, vol_type_id) โ Disassociate this QoS spec from a volume type.
Parameters
sessionโ The session to use for making this request.vol_type_idโ The ID of the volume type to disassociate from.
disassociate_all(session) โ Disassociate this QoS spec from all volume types.
Parameters
sessionโ The session to use for making this request.
delete_keys(session, keys) โ Delete keys from this QoS spec.
Parameters
sessionโ The session to use for making this request.keysโ The keys to delete.
The QoSSpecAssociation Class
The QoSSpecAssociation class inherits from Resource.
class openstack.block_storage.v3.qos_spec.QoSSpecAssociation(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'qos_associations'โ Plural form of key for resource.base_path = '/qos-specs/%(qos_spec_id)s/associations'โ The base part of the URI for this resource.allow_list = Trueโ Allow list operation for this resource.association_typeโ The type of association (e.g."volume_type").idโ The ID of the associated resource.nameโ The name of the associated resource.qos_spec_idโ The ID of the QoS spec.
openstack.block_storage.v3.quota_class_set
The QuotaClassSet Class
The QuotaClassSet class inherits from Resource.
class openstack.block_storage.v3.quota_class_set.QuotaClassSet(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'quota_class_set'โ Singular form of key for resource.base_path = '/os-quota-class-sets'โ The base part of the URI for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.backup_gigabytesโ The size (GiB) of backups that are allowed for each project.backupsโ The number of backups that are allowed for each project.gigabytesโ The size (GiB) of volumes and snapshots that are allowed for each project.groupsโ The number of groups that are allowed for each project.per_volume_gigabytesโ The size (GB) of volumes in request that are allowed for each volume.snapshotsโ The number of snapshots that are allowed for each project.volumesโ The number of volumes that are allowed for each project.
openstack.block_storage.v3.quota_set
The QuotaSet Class
The QuotaSet class inherits from Resource.
class openstack.block_storage.v3.quota_set.QuotaSet(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.backup_gigabytesโ Properties The size (GB) of backups that are allowed for each project.backupsโ The number of backups that are allowed for each project.gigabytesโ The size (GB) of volumes and snapshots that are allowed for each project.groupsโ The number of groups that are allowed for each project.per_volume_gigabytesโ The size (GB) of volumes in request that are allowed for each volume.snapshotsโ The number of snapshots that are allowed for each project.volumesโ The number of volumes that are allowed for each project.
openstack.block_storage.v3.resource_filter
The ResourceFilter Class
The ResourceFilter class inherits from Resource.
class openstack.block_storage.v3.resource_filter.ResourceFilter(_synchronized=False, connection=None, **attrs)
Resource Filter
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'resource_filters'โ Plural form of key for resource.base_path = '/resource_filters'โ The base part of the URI for this resource.allow_list = Trueโ Allow list operation for this resource.filtersโ Properties: The list of filters that are applicable to the specified resource.resourceโ The resource that the filters will be applied to.
โจ openstack.block_storage.v3.service โจ
๐ The Service Class ๐
The Service class inherits from Resource. ๐
class openstack.block_storage.v3.service.Service(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters ๐ซถ
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Class facts & attributes ๐ธ
resources_key = 'services'โ Plural form of key for resource.base_path = '/os-services'โ The base part of the URI for this resource.allow_list = Trueโ Allow list operation for this resource.active_backend_idโ The ID of active storage backend (cinder-volume services only).availability_zoneโ The availability zone of service.backend_stateโ The state of storage backend (cinder-volume services only) (since3.49).binaryโ Binary name of service.clusterโ The cluster name (since3.7).disabled_reasonโ Disabled reason of service.hostโ The name of the host where service runs.nameโ Service name.replication_statusโ The volume service replication status (cinder-volume services only).stateโ State of service.statusโ Status of service.updated_atโ The date and time when the resource was updated.
๐ find โ find a resource by its name or id.
classmethod find(session, name_or_id, ignore_missing=True, list_base_path=None, *, microversion=None, all_projects=None, **params)
Parameters ๐
sessionโ The session to use for making this request.name_or_idโ This resourceโs identifier, if needed by the request. The default isNone.ignore_missingโ When set toFalse,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.list_base_pathโbase_pathto be used when need listing resources.microversionโ API version to override the negotiated one.paramsโ Any additional parameters to be passed into underlying methods, such as toexisting()in order to pass on URI parameters.all_projectsโ this one is in the signature above; no separate description is listed here.
Returns โ The Resource object matching the given name or id, or None if nothing matches.
Raises openstack.exceptions.DuplicateResource if more than one resource is found for this request.
Raises openstack.exceptions.NotFoundException if nothing is found and ignore_missing is False.
๐ง commit โ commit the state of the instance to the remote resource.
commit(session, prepend_key=False, *args, **kwargs)
Parameters ๐
sessionโ The session to use for making this request.prepend_keyโ Whether theresource_keyshould be prepended in a resource creation request. Default toTrue.retry_on_conflictโ Whether to enable retries on HTTP CONFLICT (409). Value ofNoneleaves the Adapter defaults.base_pathโ Base part of the URI for modifying resources, if different frombase_path.microversionโ API version to override the negotiated one.attrsโ Attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
The signature above showsprepend_key=False, while the description says โDefault toTrueโ โ yes, bestie, both of those really are in the source. Keep both facts. ๐ญ
Returns โ This Resource instance.
Raises MethodNotSupported if Resource.allow_commit is not set to True.
โจ enable โ enable service.
enable(session)
๐ disable โ disable service.
disable(session, *, reason=None)
reasonโ present in the signature; no separate description is given.
๐ฅ set_log_levels โ set log levels for services.
classmethod set_log_levels(session, *, level, binary=None, server=None, prefix=None)
Parameters ๐
sessionโ The session to use for making this request.levelโ The log level to set, case insensitive. Accepted values areINFO,WARNING,ERRORandDEBUG.binaryโ The binary name of the service.serverโ The name of the host.prefixโ The prefix for the log path we are querying, for examplecinder.orsqlalchemy.engine.. When not present or the empty string is passed, all log levels will be retrieved.
Returns โ None.
๐ get_log_levels โ get log levels for services.
classmethod get_log_levels(session, *, binary=None, server=None, prefix=None)
Parameters ๐
sessionโ The session to use for making this request.binaryโ The binary name of the service.serverโ The name of the host.prefixโ The prefix for the log path we are querying, for examplecinder.orsqlalchemy.engine.. When not present or the empty string is passed, all log levels will be retrieved.
Returns โ A generator of LogLevel objects.
๐ failover โ failover a service.
failover(session, *, cluster=None, backend_id=None)
Only applies to replicating cinder-volume services.
The signature takes cluster=None and backend_id=None; no separate parameter descriptions are listed.
๐งน cleanup_workers โ trigger cleanup of stuck operations on Cinder resources.
classmethod cleanup_workers(session, *, binary, host, cluster_name, disabled=None, is_up=False, resource_id=None, resource_type=None, service_id=None)
All filters are optional. Calling with no filters means โclean everything on all services that are downโ.
Parameters ๐
sessionโ The session to use for making this request.binaryโ Limit tocinder-volumeorcinder-scheduler.hostโ Target services on a specific host.cluster_nameโ Target services in a specific cluster.disabledโ Filter by whether the service is admin-disabled.is_upโ Filter by whether the service is up. Defaults toFalse, meaning only clean up after crashed/stopped services).resource_idโ no extra description listed here.resource_typeโ Only clean a specific type (Volume,Snapshot, etc.).service_idโ Target a single specific service.
Returns โ the source page leaves this blank.
๐ฆ openstack.block_storage.v3.snapshot ๐ฆ
๐ The Snapshot Class ๐
The Snapshot class inherits from Resource. ๐ซ
class openstack.block_storage.v3.snapshot.Snapshot(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters ๐ซถ
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Class facts & attributes ๐
resource_key = 'snapshot'โ Singular form of key for resource.resources_key = 'snapshots'โ Plural form of key for resource.base_path = '/snapshots'โ The base part of the URI for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_create = Trueโ Allow create operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_list = Trueโ Allow list operation for this resource.consumes_quotaโ Whether this resource consumes quota or not. Resources that not counted for quota usage are usually temporary internal resources created to perform an operation. This is included from microversion3.65.created_atโ The timestamp of this snapshot creation.descriptionโ what this snapshot is, in words ๐ฌ default isNone.group_snapshot_idโ the ID of the group snapshot. This one's only here from microversion3.14onward, iykyk ๐is_forcedโ says whether to create the snapshot even if the volume is attached. Default isFalse. Type:bool. Yes bestie that's a real "risk it for the biscuit" flag ๐ญprogressโ how complete this snapshot is rn, as a percentage.project_idโ the project ID this snapshot is associated with.sizeโ size of the volume, in gibibytes (GiB).statusโ the current status of this snapshot. Potential values arecreating,available,deleting,error, anderror_deleting. (the last two are giving "we don't talk about it" ๐)updated_atโ the date and time when the resource was updated.user_idโ the UUID of the user. Included from microversion3.41โจvolume_idโ the ID of the volume this snapshot was taken of.force_delete(session)โ force snapshot deletion. no thoughts, just vibes and obliteration ๐ซถreset_status(session, status)โ reset the status of the snapshot.set_status(session, status, progress=None)โ update fields related to the status of a snapshot.classmethod manage(session, volume_id, ref, name=None, description=None, metadata=None)โ manage a snapshot under block storage provisioning.unmanage(session)โ unmanage a snapshot from block storage provisioning.
๐ซ The SnapshotDetail Class ๐ซ
Okay so the SnapshotDetail class inherits from Snapshot. That's it. That's the whole thing. nepotism but make it OOP ๐
openstack.block_storage.v3.snapshot.SnapshotDetail
alias of Snapshot โ literally just Snapshot wearing a different name ๐ฆ
๐ openstack.block_storage.v3.stats ๐
๐ The Pools Class ๐
The Pools class inherits from Resource <#openstack.resource.Resource>. (yes, the link is doing a little split โ that's just how it rendered, don't come for me ๐)
class openstack.block_storage.v3.stats.Pools(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. (protective, communicative, iconic ๐ฅ)resource_key = ''โ singular form of key for resource. empty string, and honestly? mood.resources_key = 'pools'โ plural form of key for resource.base_path = '/scheduler-stats/get_pools?detail=True'โ the base part of the URI for this resource.allow_fetch = Falseโ allow get operation for this resource.allow_create = Falseโ allow create operation for this resource.allow_delete = Falseโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. the only thing it does. one job and it's slaying it โจnameโ the Cinder name for the pool.capabilitiesโ returns adictwith information about the pool.
๐ openstack.block_storage.v3.transfer ๐
๐ The Volume Transfer Class ๐
The Volume Transfer class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v3.transfer.Transfer(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'transfer'โ singular form of key for resource.resources_key = 'transfers'โ plural form of key for resource.base_path = '/volume-transfers'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_list = Trueโ allow list operation for this resource. all four enabled, she's an overachiever, we stan ๐idโ UUID of the transfer.created_atโ the date and time when the resource was created.nameโ name of the volume to transfer.volume_idโ ID of the volume to transfer.auth_keyโ auth key for the transfer. keep this one close, bestie ๐คซlinksโ a list of links associated with this volume. Type:list.no_snapshotsโ whether to transfer snapshots or not.create(session, prepend_key=True, base_path=None, *, microversion=None, **params)โ create a remote resource based on this instance.
Parameters
sessionโ the session to use for making this request.prepend_keyโ DEPRECATED, configurecreate_optsinstead. Whether theresource_keyshould be prepended in a resource creation request. Default toTrue.base_pathโ base part of the URI for creating resources, if different frombase_path <#openstack.resource.Resource.base_path>.resource_request_keyโ DEPRECATED, configurecreate_optsinstead. Overrides the usage ofresource_key <#openstack.resource.Resource.resource_key>when prepending a key to the request body. Ignored ifprepend_keyis false.resource_response_keyโ DEPRECATED, configurecreate_optsinstead. Overrides the usage ofresource_key <#openstack.resource.Resource.resource_key>when processing response bodies. Ignored ifprepend_keyis false.microversionโ API version to override the negotiated one.paramsโ additional params to pass.
Returns โ this Resource instance.
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_create is not set to True. ๐จ
fetch(session, requires_id=True, base_path=None, error_message=None, skip_cache=False, *, resource_response_key=None, microversion=None, **params)โ get volume transfer.
Parameters
session(Adapter) โ the session to use for making this request.requires_id(boolean) โ a boolean indicating whether resource ID should be part of the requested URI.base_path(str) โ base part of the URI for fetching resources, if different frombase_path <#openstack.resource.Resource.base_path>.error_message(str) โ an Error message to be returned if requested object does not exist.skip_cache(bool) โ a boolean indicating whether optional API cache should be skipped for this invocation.resource_response_key(str) โ overrides the usage ofself.resource_keywhen processing the response body.microversion(str) โ API version to override the negotiated one.params(dict) โ additional parameters that can be consumed.
Returns โ this Resource instance.
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_fetch is not set to True.
Raises NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found. ๐ญ it's not there bestie, let it go.
delete(session, error_message=None, *, microversion=None, **kwargs)โ delete a volume transfer.
Parameters
session(Adapter) โ the session to use for making this request.microversion(str) โ API version to override the negotiated one.kwargs(dict) โ parameters that will be passed to_prepare_request()
Returns โ this Resource instance.
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True. (yes, allow_commit โ that's what it says, I don't make the rules ๐)
Raises NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found.
accept(session, *, auth_key=None)โ accept a volume transfer.
Parameters
sessionโ the session to use for making this request.auth_keyโ the authentication key for the volume transfer.
Returns โ this Transfer instance. ๐ซถ
๐ธ openstack.block_storage.v3.type ๐ธ
โญ The Type Class โญ
The Type class inherits from Resource <#openstack.resource.Resource>.
class openstack.block_storage.v3.type.Type(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection(unit tests, we see you ๐). If yourResourcecode touchesself._connection, protect it with aNonecheck, bestie.resource_key = 'volume_type'โ singular form of the key for this resource.resources_key = 'volume_types'โ plural form of the key for this resource.base_path = '/types'โ the base part of the URI for this resource.allow_fetch = Trueโ allow the get operation for this resource.allow_create = Trueโ allow the create operation for this resource.allow_delete = Trueโ allow the delete operation for this resource.allow_list = Trueโ allow the list operation for this resource.allow_commit = Trueโ allow the update operation for this resource.descriptionโ description of the type.extra_specsโ adictof extra specifications."capabilities"is a usual key.is_publicโ literally a private volume-type. Type:bool.set_extra_specs(session, **extra_specs)โ update extra specs. This call will replace only theextra_specswith the same keys given here. Other keys will not be modified. โจ- Parameters
sessionโ the session to use for making this request.extra_specsโ key/valueextra_specspairs to be update on this volume type. All keys and values.
- Returns โ the updated extra specs.
- Parameters
delete_extra_specs(session, keys)โ delete extra specs.
Note: This method will do a HTTP DELETE request for every key in keys.
- Parameters
sessionโ the session to use for this request.keysโ the keys to delete.
- Returns โ
None
get_private_access(session)โ list projects with private access to the volume type.- Parameters
sessionโ the session to use for making this request.
- Returns โ the volume type access response.
- Parameters
add_private_access(session, project_id)โ add project access from the volume type.- Parameters
sessionโ the session to use for making this request.project_idโ the project to add access for.
- Parameters
remove_private_access(session, project_id)โ remove project access from the volume type.- Parameters
sessionโ the session to use for making this request.project_idโ the project to remove access for.
- Parameters
The TypeEncryption Class ๐
The TypeEncryption class inherits from Resource (#openstack.resource.Resource). ๐
class openstack.block_storage.v3.type.TypeEncryption(_synchronized=False, connection=None, **attrs)
The base resource, bestie. ๐ซถ
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection(unit tests, we see you ๐). If yourResourcecode touchesself._connection, protect it with aNonecheck.resource_key = 'encryption'โ singular form of the key for this resource.resources_key = 'encryption'โ plural form of the key for this resource.base_path = '/types/%(volume_type_id)s/encryption'โ the base part of the URI for this resource.allow_fetch = Trueโ allow the get operation for this resource.allow_create = Trueโ allow the create operation for this resource.allow_delete = Trueโ allow the delete operation for this resource.allow_list = Falseโ allow the list operation for this resource.allow_commit = Trueโ allow the update operation for this resource.cipherโ the encryption algorithm or mode.control_locationโ notional service where encryption is performed.created_atโ the date and time when the resource was created.deletedโ the resource is deleted or not.deleted_atโ the date and time when the resource was deleted.encryption_idโ a ID representing this type.key_sizeโ the Size of encryption key.providerโ the class that provides encryption support.updated_atโ the date and time when the resource was updated.volume_type_idโ the ID of the Volume Type.
openstack.block_storage.v3.volume
The Volume Class ๐
The Volume class inherits from Resource (#openstack.resource.Resource). ๐
class openstack.block_storage.v3.volume.Volume(_synchronized=False, connection=None, **attrs)
The base resource, periodt. ๐ธ
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(#openstack.resource.Resource.new) andexisting()(#openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection(unit tests, we see you ๐). If yourResourcecode touchesself._connection, protect it with aNonecheck.resource_key = 'volume'โ singular form of the key for this resource.resources_key = 'volumes'โ plural form of the key for this resource.base_path = '/volumes'โ the base part of the URI for this resource.allow_fetch = Trueโ allow the get operation for this resource.allow_create = Trueโ allow the create operation for this resource.allow_delete = Trueโ allow the delete operation for this resource.allow_commit = Trueโ allow the update operation for this resource.allow_list = Trueโ allow the list operation for this resource.attachmentsโ instance attachment information. If this volume is attached to a server instance, theattachmentslist includes the UUID of the attached server, an attachment UUID, the name of the attached host, if any, the volume UUID, the device, and the device UUID. Otherwise, this list is empty.availability_zoneโ the availability zone.backup_idโ to create a volume from an existing backup, specify the ID of the existing volume backup. (since 3.47)consistency_group_idโ ID of the consistency group.consumes_quotaโ whether this resource consumes quota or not. Resources that aren't counted for quota usage are usually temporary internal resources created to perform an operation. (since 3.65)cluster_nameโ the cluster name of volume backend. (since 3.61)created_atโ the timestamp of this volume creation.descriptionโ the volume description.encryption_key_idโ the UUID of the encryption key. Only included for encrypted volumes. (since 3.64)extended_replication_statusโ extended replication status on this volume.group_idโ the ID of the group that the volume belongs to. (since 3.13)hostโ the volume's current back-end.image_idโ the ID of the image from which you want to create the volume. Required to create a bootable volume.is_bootableโ enables or disables the bootable attribute. You can boot an instance from a bootable volume. Type:boolis_encryptedโTrueif this volume is encrypted,Falseif not. Type:boolis_multiattachโ whether volume will be sharable or not.migration_idโ the volume ID that this volume's name on the back-end is based on.migration_statusโ the status of this volume's migration (Nonemeans that a migration is not currently in progress).project_idโ the project ID associated with current back-end.replication_driver_dataโ data set by the replication driverprovider_idโ the provider ID for the volume. (since 3.21)replication_statusโ status of replication on this volume.scheduler_hintsโ scheduler hints for the volumeservice_uuidโ a unique identifier that's used to indicate what node the volume-service for a particular volume is being serviced by. (since 3.48)shared_targetsโ an indicator whether the host connecting the volume should lock for the whole attach/detach process or not.truemeans only if the iSCSI initiator running on the host doesn't support manual scans,falsemeans never use locks, andnullmeans to always use locks. Look atos-brick'sguard_connectioncontext manager. Default=True. (since 3.48)sizeโ the size of the volume, in gibibytes (GiB).snapshot_idโ bestie, if you wanna build a volume out of an existing snapshot, drop the ID of that existing volume snapshot right here. And like, the new volume lands in the same availability zone and gets the same size as the snapshot. matching outfits fr ๐source_volume_idโ cloning an existing volume? give it the ID of the existing volume and it makes you a new one with the same size as the source. no cap.statusโ one of these icons only:creating,available,attaching,in-use deleting,error,error_deleting,backing-up,restoring-backup,error_restoring. for the deets on what each one means, the Block Storage API documentation is right there, go read it ๐ซถupdated_atโ the date and time when the resource got updated. its little glow-up timestamp โจuser_idโ the user ID that's associated with the volumevolume_image_metadataโ one or more metadata key and value pairs about imagevolume_typeโ the name of the associated volume typevolume_type_idโ the associated volume type ID for the volume. (since3.61) โญ
extend(session, size)โ extend a volume size. make it bigger, main character energy ๐complete_extend(session, error=False)โ complete volume extend operationset_bootable_status(session, bootable=True)โ set volume bootable status flagset_readonly(session, readonly)โ set volume readonly flagset_image_metadata(session, metadata)โ sets image metadata key-value pairs on the volumedelete_image_metadata(session)โ remove all image metadata from the volume. bye bye, all of it ๐งนdelete_image_metadata_item(session, key)โ remove a single image metadata from the volume. surgical.reset_status(session, status=None, attach_status=None, migration_status=None)โ reset volume statuses (admin operation). admin only, ikyk ๐revert_to_snapshot(session, snapshot_id)โ revert volume to its snapshot. rewind time, lowkey iconic ๐ฐ๏ธattach(session, mountpoint, instance=None, host_name=None)โ attach volume to serverdetach(session, attachment, force=False, connector=None)โ detach volume from serverclassmethod manage(session, host, ref, name=None, description=None, volume_type=None, availability_zone=None, metadata=None, bootable=False, cluster=None)โ manage an existing volume.unmanage(session)โ unmanage volumeretype(session, new_type, migration_policy=None)โ change volume type. whole new aesthetic ๐migrate(session, host=None, force_host_copy=False, lock_volume=False, cluster=None)โ migrate volumecomplete_migration(session, new_volume_id, error=False)โ complete volume migrationforce_delete(session)โ force volume deletion. it's giving no-mercy ๐upload_to_image(session, image_name, *, force=False, disk_format=None, container_format=None, visibility=None, protected=None)โ upload the volume to image servicereserve(session)โ reserve volumeunreserve(session)โ unreserve volumebegin_detaching(session)โ update volume status to'detaching'abort_detaching(session)โ roll back volume status to'in-use'init_attachment(session, connector)โ initialize volume attachmentterminate_attachment(session, connector)โ terminate volume attachment
๐ Cluster Resources
๐ฆ openstack.clustering.v1.action
โจ The Action Class โจ
okay so the Action class inherits from Resource <#openstack.resource.Resource>. yes, that Resource. the blueprint of everything. ๐ซถ
class openstack.clustering.v1.action.Action(_synchronized=False, connection=None, **attrs)
the base resource
Parameters
_synchronizedโ this is not intended to be used directly. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>. don't touch, fr fr ๐connectionโ reference to theConnectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone. safety first bestie ๐
Class attributes:
resource_key = 'action'โ singular form of key for resource.resources_key = 'actions'โ plural form of key for resource. (yes they're different, slay)base_path = '/actions'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.commit_method = 'PATCH'โ method for committing a resource. this must bePATCHifallow_patchisTrue. non-negotiable โ ๏ธnameโ name of the action.target_idโ ID of the target object, which can be a cluster or a node.actionโ built-in type name of action.causeโ a string representation of the reason why the action was created. the why, the lore ๐owner_idโ the owning engine that is currently running the action.user_idโ the ID of the user who created this action.project_idโ the ID of the project this profile belongs to.domain_idโ the domain ID of the action.intervalโ interval in seconds between two consecutive executions.start_atโ the time the action was started.end_atโ the time the action completed execution.timeoutโ the timeout in seconds.statusโ current status of the action.inputsโ a dictionary containing the inputs to the action.outputsโ a dictionary containing the outputs to the action.depends_onโ a list of actions that must finish before this action starts execution.depended_byโ a list of actions that can start only after this action has finished.created_atโ timestamp when the action is created.updated_atโ timestamp when the action was last updated.cluster_idโ the ID of cluster which this action runs on.
๐ง openstack.clustering.v1.build_info
๐ธ The BuildInfo Class ๐ธ
BuildInfo also inherits from Resource <#openstack.resource.Resource>. tiny class, big vibes.
class openstack.clustering.v1.build_info.BuildInfo(_synchronized=False, connection=None, **attrs)
the base resource
Parameters
_synchronizedโ this is not intended to be used directly. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone.
Class attributes:
base_path = '/build-info'โ the base part of the URI for this resource.resource_key = 'build_info'โ singular form of key for resource.allow_fetch = Trueโ allow get operation for this resource.apiโ string representation of the API build versionengineโ string representation of the engine build version
๐ openstack.clustering.v1.Cluster
๐ The Cluster Class ๐
yup, Cluster inherits from Resource <#openstack.resource.Resource>. this one does everything โ create, fetch, commit, delete, list. full send ๐ฅ
class openstack.clustering.v1.cluster.Cluster(_synchronized=False, connection=None, **attrs)
the base resource
Parameters
_synchronizedโ this is not intended to be used directly. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone.
Class attributes:
resource_key = 'cluster'โ singular form of key for resource.resources_key = 'clusters'โ plural form of key for resource.base_path = '/clusters'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.commit_method = 'PATCH'โ method for committing a resource. this must bePATCHifallow_patchisTrue. seriously, it's a whole thing โ ๏ธnameโ the name of the cluster.profile_idโ the ID of the profile used by this cluster.user_idโ the ID of the user who created this cluster, thus the owner of it. the founder, the originator ๐ซproject_idโ the ID of the project this cluster belongs to.domain_idโ the domain ID of the cluster owner.init_atโ timestamp of when the cluster was initialized. type:datetimeobject parsed from ISO 8601 formatted string.created_atโ timestamp of when the cluster was created. type:datetimeobject parsed from ISO 8601 formatted string.updated_atโ timestamp of when the cluster was last updated. type:datetimeobject parsed from ISO 8601 formatted string.min_sizeโ lower bound (inclusive) for the size of the cluster.max_sizeโ the upper bound (inclusive) for the size of the cluster. A value of-1means there is literally no upper limit on cluster size. No cap, bestie. ๐desired_capacityโ the desired capacity for the cluster. A cluster would be created at the scale specified by this value. โจtimeoutโ default timeout (in seconds) for cluster operations. Give it a sec, okay? โณstatusโ a string representation of the cluster status. The vibe check in text form. ๐status_reasonโ a string describing the reason why the cluster is in its current status. The lore behind the status. ๐configโ a dictionary configuration for cluster. ๐metadataโ a collection of key-value pairs that are attached to the cluster. ๐ท๏ธdataโ a dictionary with some runtime data associated with the cluster. ๐ซถnode_idsโ a list of IDs of nodes that are members of the cluster. The squad list. ๐profile_nameโ name of the profile used by the cluster. ๐ธis_profile_onlyโ specify whether the cluster update should only pertain to the profile. Very โthis update is about the profile, not the whole clusterโ energy. ๐ซdependentsโ a dictionary with dependency information of the cluster. ๐ง
op(session, operation, **params)
Perform an operation on the cluster.
Parameters:
sessionโ a session object used for sending request. ๐จoperationโ a string representing the operation to be performed. ๐ ๏ธparams(dict) โ an optional dict providing the parameters for the operation. ๐๏ธ
Returns: a dictionary containing the action ID. ๐ชช
๐ฆ openstack.clustering.v1.cluster_policy ๐ฆ
The ClusterPolicy Class
The ClusterPolicy class inherits from Resource <#openstack.resource.Resource>. Itโs giving very โI know my lineageโ energy. ๐
class openstack.clustering.v1.cluster_policy.ClusterPolicy(_synchronized=False, connection=None, **attrs)
The base resource. The blueprint. The main character. โจ
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. Donโt touch, bestie. ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. Safety first, slay. ๐ก๏ธresource_key = 'cluster_policy'โ singular form of key for resource. ๐resources_key = 'cluster_policies'โ plural form of key for resource. ๐๐base_path = '/clusters/%(cluster_id)s/policies'โ the base part of the URI for this resource. ๐allow_list = Trueโ allow list operation for this resource. ๐allow_fetch = Trueโ allow get operation for this resource. ๐policy_idโ ID of the policy object. ๐ชชpolicy_nameโ name of the policy object. ๐ท๏ธcluster_idโ ID of the cluster object. ๐ฏcluster_nameโ name of the cluster object. ๐policy_typeโ type string of the policy. ๐งฌis_enabledโ whether the policy is enabled on the cluster. Type:bool. โdataโ data associated with the cluster-policy binding. ๐ซถ
๐ธ openstack.clustering.v1.event ๐ธ
The Event Class
The Event class inherits from Resource <#openstack.resource.Resource>. Itโs all about what happened and when, iykyk. ๐ฐ๏ธ
class openstack.clustering.v1.event.Event(_synchronized=False, connection=None, **attrs)
The base resource. Same iconic blueprint energy. โจ
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. Leave it alone, seriously. ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ก๏ธresource_key = 'event'โ singular form of key for resource. ๐resources_key = 'events'โ plural form of key for resource. ๐๐base_path = '/events'โ the base part of the URI for this resource. ๐allow_list = Trueโ allow list operation for this resource. ๐allow_fetch = Trueโ allow get operation for this resource. ๐generated_atโ timestamp string (inISO8601format) when the event was generated. โฐobj_idโ the UUID of the object related to this event. ๐ชชobj_nameโ the name of the object related to this event. ๐ท๏ธobj_typeโ the type name of the object related to this event. ๐งฌcluster_idโ the UUID of the cluster related to this event, if any. ๐ฏlevelโ the event level (priority). ๐ฆuser_idโ the ID of the user. ๐คproject_idโ the ID of the project (tenant). ๐ขactionโ the string representation of the action associated with the event. ๐ฌstatusโ the status of the associated object. ๐status_reasonโ a string description of the reason that brought the object into its current status. ๐meta_dataโ the metadata of an event object. ๐ท๏ธ
๐ openstack.clustering.v1.Node ๐
The Node Class
The Node class inherits from Resource <#openstack.resource.Resource>. This one is a whole member of the cluster, and it has lore. ๐
class openstack.clustering.v1.node.Node(_synchronized=False, connection=None, **attrs)
The base resource. The blueprint. The moment. โจ
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. Do not use directly, bestie. ๐ โโ๏ธconnectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ก๏ธresource_key = 'node'โ singular form of key for resource. ๐resources_key = 'nodes'โ plural form of key for resource. ๐๐base_path = '/nodes'โ the base part of the URI for this resource. ๐allow_create = Trueโ allow create operation for this resource. ๐allow_fetch = Trueโ allow get operation for this resource. ๐allow_commit = Trueโ allow update operation for this resource. โ๏ธallow_delete = Trueโ allow delete operation for this resource. ๐๏ธallow_list = Trueโ allow list operation for this resource. ๐commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. Important detail, no skipping. ๐จnameโ the name of the node. ๐ท๏ธphysical_idโ the ID of the physical object that backs the node. ๐ชชcluster_idโ the ID of the cluster in which this node is a member. A node is an orphan node if this field is empty. ๐ญprofile_idโ the ID of the profile used by this node. ๐domain_idโ the domain ID of the node. ๐user_idโ the ID of the user who created this node. ๐คproject_idโ the ID of the project this node belongs to. ๐ขprofile_nameโ the name of the profile used by this node. ๐ธindexโ an integer that is unique inside the owning cluster. A value of-1means this node is an orphan node. ๐ซroleโ a string indicating the role the node plays in a cluster. ๐ญinit_atโ the timestamp of the node objectโs initialization. Type:datetime object parsed from ISO 8601 formatted string. โฐcreated_atโ the timestamp of the nodeโs creation, i.e. the physical object represented by this node is also created. Type:datetime object parsed from ISO 8601 formatted string. ๐updated_atโ the timestamp the node was last updated. Type:datetime object parsed from ISO 8601 formatted string. ๐statusโ a string indicating the nodeโs status. ๐status_reasonโ a string describing why the node entered its current status. ๐metadataโ a map containing key-value pairs attached to the node. ๐ท๏ธdataโ a map containing some runtime data for this node. ๐ซถdetailsโ a map containing the details of the physical object this node represents. ๐dependentsโ a map containing the dependency of nodes. ๐งtaintedโ whether the node is tainted. Type:bool. ๐
check(session, **params)
An action procedure for the node to check its health status. A little wellness check, but for infrastructure. ๐ฉบ
Parameters:
sessionโ a session object used for sending request. ๐จ
Returns: a dictionary containing the action ID. ๐ชช
recover(session, **params)
An action procedure for the node to recover. Healing arc, periodt. ๐
Parameters:
sessionโ a session object used for sending request. ๐จ
Returns: a dictionary containing the action ID. ๐ชช
op(session, operation, **params)
Perform an operation on the specified node.
Parameters:
sessionโ a session object used for sending request. ๐จoperationโ a string representing the operation to be performed. ๐ ๏ธparams(dict) โ an optional dict providing the parameters for the operation. ๐๏ธ
Returns: a dictionary containing the action ID. ๐ชช
adopt(session,preview=False,**params)โ lowkey the glow-up moment for a node: it adopts that node for management, bestie ๐ซถ
Parameters:
- session โ a session object used for sending the request. It's giving "the messenger", nothing happens without it.
- preview โ a boolean indicating whether the adoption is a preview. A "preview" does not create the node object. So like, window shopping only, no receipt ๐ญ
- params (dict) โ a dict providing the details of a node to be adopted.
๐ธ openstack.clustering.v1.policy
The Policy Class
The Policy class inherits from Resource.
class openstack.clustering.v1.policy.Policy(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters:
- _synchronized โ this is not intended to be used directly. See
new()andexisting(). iykyk, hands off ๐ - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. fr fr, do the None check. resource_key = 'policy'โ singular form of key for resource.resources_key = 'policies'โ plural form of key for resource.base_path = '/policies'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_create = Trueโ allow create operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_commit = Trueโ allow update operation for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. periodt.nameโ the name of the policy.typeโ the type name of the policy.project_idโ the ID of the project this policy belongs to.user_idโ the ID of the user who created this policy.created_atโ the timestamp when the policy is created.updated_atโ the timestamp when the policy was last updated.specโ the specification of the policy.dataโ a dictionary containing runtime data of the policy.
๐ openstack.clustering.v1.policy_type
The PolicyType Class
The PolicyType class inherits from Resource.
class
openstack.clustering.v1.policy_type.PolicyType(_synchronized=False,
connection=None, **attrs)
The base resource โจ
Parameters:
- _synchronized โ this is not intended to be used directly. See
new()andexisting(). - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. resource_key = 'policy_type'โ singular form of key for resource.resources_key = 'policy_types'โ plural form of key for resource.base_path = '/policy-types'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.allow_fetch = Trueโ allow get operation for this resource.nameโ name of policy type.schemaโ the schema of the policy type.support_statusโ the support status of the policy type.
๐ฆ openstack.clustering.v1.profile
The Profile Class
The Profile class inherits from Resource.
class openstack.clustering.v1.profile.Profile(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters:
- _synchronized โ this is not intended to be used directly. See
new()andexisting(). - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. resource_key = 'profile'โ singular form of key for resource.resources_key = 'profiles'โ plural form of key for resource.base_path = '/profiles'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.nameโ the name of the profile.typeโ the type of the profile.project_idโ the ID of the project this profile belongs to.domain_idโ the domain ID of the profile.user_idโ the ID of the user who created this profile.specโ the spec of the profile.metadataโ a collection of key-value pairs that are attached to the profile.created_atโ timestamp of when the profile was created.updated_atโ timestamp of when the profile was last updated.
๐ง openstack.clustering.v1.profile_type
The ProfileType Class
The ProfileType class inherits from Resource.
class
openstack.clustering.v1.profile_type.ProfileType(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters:
- _synchronized โ this is not intended to be used directly. See
new()andexisting(). - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. resource_key = 'profile_type'โ singular form of key for resource.resources_key = 'profile_types'โ plural form of key for resource.base_path = '/profile-types'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.allow_fetch = Trueโ allow get operation for this resource.nameโ name of the profile type.schemaโ the schema of the profile type.support_statusโ the support status of the profile type.
๐ openstack.clustering.v1.receiver
The Receiver Class
The Receiver class inherits from Resource.
class openstack.clustering.v1.receiver.Receiver(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters:
- _synchronized โ this is not intended to be used directly. See
new()andexisting(). - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. resource_key = 'receiver'โ singular form of key for resource.resources_key = 'receivers'โ plural form of key for resource.base_path = '/receivers'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_create = Trueโ allow create operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.nameโ the name of the receiver.typeโ the type of the receiver.user_idโ the ID of the user who created the receiver, thus the owner of it. main character energy, honestly.project_idโ the ID of the project this receiver belongs to.domain_idโ the domain ID of the receiver.cluster_idโ the ID of the targeted cluster.actionโ the name of the targeted action.created_atโ timestamp of when the receiver was created.updated_atโ timestamp of when the receiver was last updated.actorโ the credential of the impersonated user.paramsโ a dictionary containing key-value pairs that are provided to the targeted action.channelโ the information about the channel through which you can trigger the receiver, hence the associated action. that's the plug, bestie ๐
๐ฅ Compute Resources
openstack.compute.v2.aggregate
The Aggregate Class
The Aggregate class inherits from Resource.
๐งฉ openstack.compute.v2.aggregate.Aggregate
class openstack.compute.v2.aggregate.Aggregate(_synchronized=False, connection=None, **attrs)
This is the base resource, bestie. ๐
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting()instead.connectionโ Reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnectionโ like in unit tests. If yourResourcecode touchesself._connection, protect it with a check forNone.
Hereโs the whole vibe check of its attributes and methods:
resource_key = 'aggregate'โ Singular form of the key for this resource.resources_key = 'aggregates'โ Plural form of the key for this resource.base_path = '/os-aggregates'โ The base part of the URI for this resource.allow_create = Trueโ Yep, the create operation is allowed for this resource.allow_fetch = Trueโ Yep, the get (fetch) operation is allowed for this resource.allow_delete = Trueโ Yep, the delete operation is allowed for this resource.allow_list = Trueโ Yep, the list operation is allowed for this resource.allow_commit = Trueโ Yep, the update operation is allowed for this resource.availability_zoneโ Availability zone of the aggregate.created_atโ The date and time when the resource was created.deleted_atโ The date and time when the resource was deleted.is_deletedโ Deleted?nameโ Name of the aggregate.hostsโ Hosts.metadataโ Metadata.updated_atโ The date and time when the resource was updated.uuidโ UUID.add_host(session, host)โ Adds a host to an aggregate.remove_host(session, host)โ Removes a host from an aggregate.set_metadata(session, metadata)โ Creates or replaces metadata for an aggregate.precache_images(session, images)โ Requests image pre-caching.
๐ธ openstack.compute.v2.availability_zone
โจ The AvailabilityZone Class
The AvailabilityZone class inherits from Resource.
class openstack.compute.v2.availability_zone.AvailabilityZone(_synchronized=False, connection=None, **attrs)
This is the base resource, bestie. ๐ซถ
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting()instead.connectionโ Reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnectionโ like in unit tests. If yourResourcecode touchesself._connection, protect it with a check forNone.resources_key = 'availabilityZoneInfo'โ Plural form of the key for this resource.base_path = '/os-availability-zone'โ The base part of the URI for this resource.allow_list = Trueโ Yep, the list operation is allowed for this resource.nameโ Name of the availability zone.stateโ State of the availability zone.hostsโ Hosts of the availability zone.
๐ openstack.compute.v2.console_auth_token
๐ฆ The ServerRemoteConsole Class
The heading says ServerRemoteConsole, but the class youโre actually getting is ConsoleAuthToken โ slay, we roll with what the page says. ๐
The ConsoleAuthToken class inherits from Resource.
class openstack.compute.v2.console_auth_token.ConsoleAuthToken(_synchronized=False, connection=None, **attrs)
This is the base resource. โจ
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting()instead.connectionโ Reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnectionโ like in unit tests. If yourResourcecode touchesself._connection, protect it with a check forNone.resource_key = 'console'โ Singular form of the key for this resource.base_path = '/os-console-auth-tokens'โ The base part of the URI for this resource.allow_fetch = Trueโ Yep, the get (fetch) operation is allowed for this resource.instance_uuidโ Instance UUID.hostโ Hypervisor host.portโ Hypervisor port.tls_portโ Hypervisor TLS port.internal_access_pathโ Internal access path.
๐ openstack.compute.v2.extension
๐ The Extension Class
The Extension class inherits from Resource.
class openstack.compute.v2.extension.Extension(_synchronized=False, connection=None, **attrs)
This is the base resource. ๐ง
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting()instead.connectionโ Reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnectionโ like in unit tests. If yourResourcecode touchesself._connection, protect it with a check forNone.resource_key = 'extension'โ Singular form of the key for this resource.resources_key = 'extensions'โ Plural form of the key for this resource.base_path = '/extensions'โ The base part of the URI for this resource.allow_fetch = Trueโ Yep, the get (fetch) operation is allowed for this resource.allow_list = Trueโ Yep, the list operation is allowed for this resource.aliasโ A short name by which this extension is also known.descriptionโ Text describing this extensionโs purpose.linksโ Links pertaining to this extension. This is a list of dictionaries, each including keyshrefandrel.nameโ The name of the extension.namespaceโ A URL pointing to the namespace for this extension.updated_atโ Timestamp when this extension was last updated.
๐ openstack.compute.v2.flavor
๐ The Flavor Class
The Flavor class inherits from Resource.
class openstack.compute.v2.flavor.Flavor(_synchronized=False, connection=None, **attrs)
This is the base resource. ๐
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting()instead.connectionโ Reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnectionโ like in unit tests. If yourResourcecode touchesself._connection, protect it with a check forNone.resource_key = 'flavor'โ Singular form of the key for this resource.resources_key = 'flavors'โ Plural form of the key for this resource.base_path = '/flavors'โ The base part of the URI for this resource.allow_create = Trueโ Yep, the create operation is allowed for this resource.allow_fetch = Trueโ Yep, the get (fetch) operation is allowed for this resource.allow_delete = Trueโ Yep, the delete operation is allowed for this resource.allow_list = Trueโ Yep, the list operation is allowed for this resource.allow_commit = Trueโ Yep, the update operation is allowed for this resource.nameโ The name of this flavor.original_nameโ The name of this flavor when returned by server list/show.descriptionโ The description of the flavor.diskโ Size of the disk this flavor offers. Type:int.is_publicโTrueif this is a publicly visible flavor.Falseif this is a private image. Type:bool.ramโ The amount of RAM (in MB) this flavor offers. Type:int.vcpusโ The number of virtual CPUs this flavor offers. Type:int.swapโ Size of the swap partitions.ephemeralโ Size of the ephemeral data disk attached to this server. Type:int.is_disabledโTrueif this flavor is disabled,Falseif not. Type:bool.rxtx_factorโ The bandwidth scaling factor this flavor receives on the network.extra_specsโ A dictionary of the flavorโs extra-specs key-and-value pairs.
classmethod list(session, paginated=True, base_path='/flavors/detail', allow_unknown_params=False, *, microversion=None, headers=None, max_items=None, **params)
This method is a generator which yields resource objects.
This resource object list generator handles pagination and takes query params for response filtering.
Parameters
sessionโ The session to use for making this request.paginatedโTrueif aGETto this resource returns a paginated series of responses, orFalseif aGETreturns only one page of data. WhenpaginatedisFalse, only one page of data will be returned regardless of the APIโs support of pagination.base_pathโ Base part of the URI for listing resources, if different frombase_path.allow_unknown_paramsโTrueto accept, but discard, unknown query parameters. This allows getting list of 'filters' and passing everything known to the server.Falsewill result in a validation exception when unknown query parameters are passed.microversionโ the API version that overrides the negotiated one. Yeah, we're bossing the version negotiation around, we do that now ๐headersโ extra headers to inject straight into the HTTP request. Sneaky little add-ons, love that for us ๐max_itemsโ the max number of items to return. Pro tip from the docs themselves: usually you gotta pair this withpaginated=True, okay? ๐ฅparamsโ these keyword arguments get passed straight through the_transpose()method to see if any of them match expected query parameters that should be sent in theparamsargument toget(). They also get checked against thebase_pathformat string to see if any path fragments need filling in from this argument. And here's the vibe: parameters the server side supports as filters get passed in the API call, and the remaining ones get applied as filters to the results you already retrieved. Two jobs, one param, main character energy โจ
Returns
A generator of Resource objects. It's giving infinite stream, lowkey ๐
Raises MethodNotSupported if Resource.allow_list is not set to True.
Raises InvalidResourceQuery if the query contains invalid params. Rude, but fair ๐
add_tenant_access(session, tenant)
Adds flavor access to a tenant and flavor. Sharing is caring ๐ซถ
Parameters
sessionโ the session to use for making this request.tenantโ yeah, just the tenant. That's the one.
Returns โ None
remove_tenant_access(session, tenant)
Removes flavor access to a tenant and flavor. Taking it back, no hard feelings ๐
Parameters
sessionโ the session to use for making this request.tenantโ the tenant in question.
Returns โ None
get_access(session)
Lists tenants who have access to a private flavor. Private flavor access management is admin-only by default, so if you're not admin, this is not your moment, bestie ๐ญ
Quick refresher: a private flavor has is_public set to false, while a public flavor has is_public set to true. That's the whole distinction, no cap.
Parameters
sessionโ the session to use for making this request.
Returns โ a list of dicts with flavor_id and tenant_id attributes ๐
fetch_extra_specs(session)
Fetches extra specs of the flavor. Starting with 2.61, extra specs are returned right there with the flavor details โ before that, you needed a separate call. Timeline lore fr fr โญ
Parameters
sessionโ the session to use for making this request.
Returns โ the updated flavor.
create_extra_specs(session, specs)
Creates extra specs for a flavor. Crafting era โจ
Parameters
sessionโ the session to use for making this request.specsโ the specs to create.
Returns โ the updated flavor.
get_extra_specs_property(session, prop)
Gets one individual extra spec property. Just the one, we're being specific ๐
Parameters
sessionโ the session to use for making this request.propโ the property to fetch.
Returns โ the value of the property if it exists, else None. Could be None, don't panic ๐
update_extra_specs_property(session, prop, val)
Updates an extra spec for a flavor. Glow-up time ๐
Parameters
sessionโ the session to use for making this request.propโ the property to update.valโ the value to update with.
Returns โ the updated value of the property.
delete_extra_specs_property(session, prop)
Deletes an extra spec for a flavor. Bye bestie ๐
Parameters
sessionโ the session to use for making this request.propโ the property to delete.
Returns โ None
๐ฆ The FlavorDetail Class ๐ฆ
The FlavorDetail class inherits from Flavor. That's it, it's literally just that ๐
openstack.compute.v2.flavor.FlavorDetail
alias of Flavor
๐ธ openstack.compute.v2.hypervisor ๐ธ
The Hypervisor Class
The Hypervisor class inherits from Resource. Classic inheritance moment ๐
class openstack.compute.v2.hypervisor.Hypervisor(_synchronized=False, connection=None, **attrs)
The base resource. The blueprint. The origin story ๐ซถ
Parameters
_synchronizedโ this is not intended to be used directly, okay? Seenew()andexisting()instead. It said what it said ๐connectionโ reference to theConnectionbeing used. Defaults toNoneso thatResourceobjects can be used without an activeConnection, like in unit tests. And heads up: any use ofself._connectioninResourcecode should protect itself with a check forNone. Safety first, always ๐
resource_key = 'hypervisor' โ singular form of key for resource.
resources_key = 'hypervisors' โ plural form of key for resource. Plural slay โจ
base_path = '/os-hypervisors' โ the base part of the URI for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_list = True โ allow list operation for this resource.
cpu_info โ information about the hypervisor's CPU. Up to 2.28 it was a string. Type glow-up arc, we love to see it ๐
host_ip โ IP address of the host.
hypervisor_type โ the type of hypervisor.
hypervisor_version โ version of the hypervisor.
name โ name of hypervisor.
service_details โ service details.
servers โ list of Servers.
state โ state of hypervisor.
status โ status of hypervisor.
uptime โ the total uptime of the hypervisor and information about average load. Important detail: this attribute is set only when querying uptime explicitly. It's not just vibing there by default, you have to ask for it ๐
current_workload โ measurement of the hypervisor's current workload.
disk_available โ disk space available to the scheduler.
local_disk_used โ the amount, in gigabytes, of local storage used.
local_disk_size โ the amount, in gigabytes, of the local storage device.
local_disk_free โ the amount, in gigabytes, of free space on the local storage device.
memory_used โ the amount, in megabytes, of memory.
memory_size โ the amount, in megabytes, of total memory.
memory_free โ the amount, in megabytes, of available memory.
running_vms โ count of the running virtual machines.
vcpus_used โ count of the VCPUs in use.
vcpus โ count of all VCPUs.
๐ get_uptime(session) ๐
Gets uptime information for the hypervisor.
Updates the uptime attribute of the hypervisor object. It literally edits itself, icon behavior โจ
๐บ openstack.compute.v2.image ๐บ
The Image Class
The Image class inherits from Resource.
class openstack.compute.v2.image.Image(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting(). Same warning as always, don't come for me ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. Say it with me: none-check ๐
resource_key = 'image' โ singular form of key for resource.
resources_key = 'images' โ plural form of key for resource.
base_path = '/images' โ the base part of the URI for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
links โ links pertaining to this image. This is a list of dictionaries, each including keys href and rel, and optionally type. Dictionary girlies rise ๐
name โ the name of this image.
created_at โ timestamp when the image was created.
min_disk โ the mimimum disk size. Type: int.
min_ram โ the minimum RAM size. Type: int.
progress โ if this image is still building, its progress is represented here. Once an image is created, progress will be 100. Type: int. We love a finished era ๐ฅ
status โ the status of this image.
updated_at โ timestamp when the image was updated.
size โ size of the image in bytes. Type: int.
๐ง The ImageDetail Class ๐ง
The ImageDetail class inherits from Image.
openstack.compute.v2.image.ImageDetail
alias of Image
๐ openstack.compute.v2.keypair ๐
The Keypair Class
The Keypair class inherits from Resource. Keys, but make it a resource ๐๏ธ
class openstack.compute.v2.keypair.Keypair(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ your reference to theConnectionbeing used, bestie. It defaults toNonesoResourceobjects can exist without an activeConnectionโ think unit tests and chill vibes. If youโre touchingself._connectioninsideResourcecode, protect it with a check forNone. ๐resource_key = 'keypair'โ the singular key name for this resource. โจresources_key = 'keypairs'โ the plural key name for this resource. ๐base_path = '/os-keypairs'โ the base part of the URI for this resource. ๐ฆallow_create = Trueโ create is allowed for this resource. ๐allow_fetch = Trueโ get is allowed for this resource. ๐ธallow_delete = Trueโ delete is allowed for this resource. ๐ซถallow_list = Trueโ list is allowed for this resource. ๐ญcreated_atโ the date and time when the resource was created. โญis_deletedโ a boolean that says whether this keypair is deleted or not. ๐fingerprintโ the short fingerprint associated with thepublic_keyfor this keypair. ๐ฅidโ the id identifying the keypair. ๐nameโ a name identifying the keypair. ๐private_keyโ the private key for the keypair. ๐public_keyโ the SSH public key that is paired with the server. ๐typeโ the type of the keypair. ๐งuser_idโ theuser_idfor a keypair. ๐
classmethod existing(connection=None, **kwargs) โ create an instance of an existing remote resource. When you create the instance, set the _synchronized parameter of Resource to True to show that it represents the state of an existing server-side resource. That means all attributes passed in **kwargs are considered โcleanโ โ so an immediate update() call would not generate a body of attributes to be modified on the server. No cap. โจ
Parameters
kwargs(dict) โ each of the named arguments will be set as attributes on the resultingResourceobject. ๐
openstack.compute.v2.limits
The Limits Class โจ
The Limits class inherits from Resource. ๐ฆ
class openstack.compute.v2.limits.Limits(_synchronized=False, connection=None, **attrs)
This is the base resource. ๐
Parameters
_synchronizedโ not intended to be used directly, bestie. Seenew()andexisting(). ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ธbase_path = '/limits'โ the base part of the URI for this resource. โญresource_key = 'limits'โ the singular key name for this resource. ๐ฅallow_fetch = Trueโ get is allowed for this resource. ๐ซถabsoluteโ an absolute limits object. ๐rateโ rate-limit compute resources. This is only populated when using the legacy v2 API, which was removed in Nova 14.0.0 (Newton). In v2.1 it will always be an empty list. ๐
fetch(session, requires_id=False, base_path=None, error_message=None, skip_cache=False, **params) โ get the Limits resource.
- Parameters
session(Adapter) โ the session to use for making this request. ๐
- Returns โ a
Limitsinstance. ๐ - Return type โ
Limits. ๐ง
The AbsoluteLimits Class ๐
The AbsoluteLimits class inherits from Resource. ๐ฆ
class openstack.compute.v2.limits.AbsoluteLimits(_synchronized=False, connection=None, **attrs)
This is the base resource. ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting(). ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ธimage_metaโ the number of key-value pairs that can be set as image metadata. โจpersonalityโ the maximum number of personality contents that can be supplied. ๐personality_sizeโ the maximum size, in bytes, of a personality. ๐security_group_rulesโ the maximum amount of security group rules allowed. ๐ฆsecurity_groupsโ the maximum amount of security groups allowed. ๐ธsecurity_groups_usedโ the amount of security groups currently in use. ๐ซถserver_metaโ the number of key-value pairs that can be set as server metadata. ๐ญtotal_coresโ the maximum amount of cores. โญtotal_cores_usedโ the amount of cores currently in use. ๐ฅfloating_ipsโ the maximum amount of floating IPs. ๐floating_ips_usedโ the amount of floating IPs currently in use. ๐instancesโ the maximum amount of instances. ๐instances_usedโ the amount of instances currently in use. ๐งkeypairsโ the maximum amount of keypairs. ๐total_ramโ the maximum RAM size in megabytes. ๐total_ram_usedโ the RAM size in megabytes currently in use. โจserver_groupsโ the maximum amount of server groups. ๐server_groups_usedโ the amount of server groups currently in use. ๐server_group_membersโ the maximum number of members in a server group. ๐ฆ
The RateLimit Class ๐ธ
The RateLimit class inherits from Resource. ๐ซถ
class openstack.compute.v2.limits.RateLimit(_synchronized=False, connection=None, **attrs)
This is the base resource. ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting(). ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ธnext_availableโ rate limits next availabe time. ๐ญremainingโ integer for rate limits remaining. โญunitโ unit of measurement for thevalueparameter. ๐ฅvalueโ integer number of requests which can be made. ๐verbโ an HTTP verb (POST,PUT, etc.). ๐
openstack.compute.v2.migration
The Migration Class ๐
The Migration class inherits from Resource. ๐ง
class openstack.compute.v2.migration.Migration(_synchronized=False, connection=None, **attrs)
This is the base resource. ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting(). ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ธresources_key = 'migrations'โ the plural key name for this resource. ๐base_path = '/os-migrations'โ the base part of the URI for this resource. โจallow_list = Trueโ list is allowed for this resource. ๐created_atโ the date and time when the resource was created. ๐dest_computeโ the target compute of the migration. ๐ฆdest_hostโ the target host of the migration. ๐ธdest_nodeโ the target node of the migration. ๐ซถmigration_typeโ the type of the migration. One of'migration','resize','live-migration'or'evacuation'. ๐ญnew_flavor_idโ the ID of the old flavor. This value corresponds to the ID of the flavor in the database. This will be the same asnew_flavor_idexcept for resize operations. โญold_flavor_idโ the ID of the old flavor. This value corresponds to the ID of the flavor in the database. ๐ฅproject_idโ the ID of the project that initiated the server migration (since microversion 2.80). ๐server_idโ the UUID of the server. ๐source_computeโ the source compute of the migration. ๐source_nodeโ the source node of the migration. ๐งstatusโ the current status of the migration. ๐updated_atโ the date and time when the resource was last updated. ๐user_idโ the ID of the user that initiated the server migration (since microversion 2.80). โจuuidโ the UUID of the migration (since microversion 2.59). ๐
openstack.compute.v2.quota_set
The QuotaSet Class ๐
The QuotaSet class inherits from Resource. ๐ฆ
class openstack.compute.v2.quota_set.QuotaSet(_synchronized=False, connection=None, **attrs)
This is the base resource. ๐
Parameters
_synchronizedโ bestie, this one is not meant to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>for the actual move. ๐ซถconnectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can exist without an active Connection, like in unit tests. Any use ofself._connectionin Resource code should protect itself with a check forNone. no cap.coresโ Properties: the number of allowed server cores for each tenant.fixed_ipsโ the number of allowed fixed IP addresses for each tenant. Must be equal to or greater than the number of allowed servers.floating_ipsโ the number of allowed floating IP addresses for each tenant.forceโ okay this is the pushy one: you can force the update even if the quota has already been used and the reserved quota exceeds the new quota. ๐injected_file_content_bytesโ the number of allowed bytes of content for each injected file.injected_file_path_bytesโ the number of allowed bytes for each injected file path.injected_filesโ the number of allowed injected files for each tenant.instancesโ the number of allowed servers for each tenant.key_pairsโ the number of allowed key pairs for each user.metadata_itemsโ the number of allowed metadata items for each server.networksโ the number of private networks that can be created per project.ramโ the amount of allowed server RAM, in MiB, for each tenant.security_group_rulesโ the number of allowed rules for each security group.security_groupsโ the number of allowed security groups for each tenant.server_groupsโ the number of allowed server groups for each tenant.server_group_membersโ the number of allowed members for each server group.
โจ openstack.compute.v2.server โจ
๐ฅ๏ธ The Server Class ๐ฅ๏ธ
The Server class inherits from Resource <#openstack.resource.Resource>. It's giving main-character resource energy, honestly.
class openstack.compute.v2.server.Server(_synchronized=False, connection=None, **attrs)
The base resource. Literally the blueprint era.
๐ซ Parameters ๐ซ
_synchronizedโ this is not intended to be used directly, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto let Resource objects hang out without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
Okay and the class is lowkey carrying these:
resource_key = 'server'โ singular form of key for resource.resources_key = 'servers'โ plural form of key for resource.base_path = '/servers'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
Now the actual data fields this server is serving, no cap:
linksโ a list of dictionaries holding links relevant to this server.addressesโ a dictionary of addresses this server can be accessed through. The dictionary contains keys such asprivateandpublic, each containing a list of dictionaries for addresses of that type. The addresses are contained in a dictionary with keysaddrandversion, which is either4or6depending on the protocol of the IP address. Type:dictadmin_passwordโ when a server is first created, it provides the administrator password.attached_volumesโ a list of an attached volumes. Each item in the list contains at least an"id"key to identify the specific volumes.availability_zoneโ the name of the availability zone this server is a part of.block_device_mappingโ enables fine grained control of the block device mapping for an instance. This is typically used for booting servers from volumes.config_driveโ indicates whether or not a config drive was used for this server.compute_hostโ the name of the compute host on which this instance is running. Appears in the response for administrative users only.created_atโ timestamp of when the server was created.descriptionโ the description of the server. Before microversion2.19this was set to the server name.disk_configโ the disk configuration. EitherAUTOorMANUAL.flavor_idโ the flavor reference, as a ID or full URL, for the flavor to use for this server.flavorโ the flavor property as returned from server.has_config_driveโ indicates whether a configuration drive enables metadata injection. Not all cloud providers enable this feature.host_idโ an ID representing the host of this server.faultโ a fault object. Only available when the server status isERRORorDELETEDand a fault occurred.hostโ the host to boot the server on.host_statusโ the host status.hostnameโ the hostname set on the instance when it is booted. By default, it appears in the response for administrative users only.hypervisor_hostnameโ the hypervisor host name. Appears in the response for administrative users only.image_idโ the image reference, as a ID or full URL, for the image to use for this server.imageโ the image property as returned from server.instance_nameโ the instance name. The Compute API generates the instance name from the instance name template. Appears in the response for administrative users only.interface_ipโ the address to use to connect to this server from the current calling context. This will be set topublic_ipv6if the calling host has routable ipv6 addresses, and toprivate_ipv4if the Connection was created withprivate=True. Otherwise it will be set topublic_ipv4.kernel_idโ the UUID of the kernel image when using an AMI. Will benullif not. By default, it appears in the response for administrative users only.key_nameโ the name of an associated keypairlaunch_indexโ when servers are launched via multiple create, this is the sequence in which the servers were launched. By default, it appears in the response for administrative users only.launched_atโ the timestamp when the server was launched.locked_reasonโ the reason the server was locked, if any.max_countโ the maximum number of servers to create.min_countโ the minimum number of servers to create.networksโ a networks object. Required parameter when there are multiple networks defined for the tenant. When you do not specify thenetworksparameter, the server attaches to the only network created for the current tenant.personalityโ personality files. This should be a list of dicts with each dict containing a file name ('name') and a base64-encoded file contents ('contents')pinned_availability_zoneโ the availability zone requested during server creation OR pinned availability zone, which is configured usingdefault_schedule_zoneconfig option.power_stateโ the power state of this server.progressโ while the server is building, this value represents the percentage of completion. Once it is completed, it will be100. Type:intproject_idโ the ID of the project this server is associated with.private_v4โ the private IPv4 address of this serverprivate_v6โ the private IPv6 address of this serverpublic_v4โ the public IPv4 address of this serverpublic_v6โ the public IPv6 address of this serverramdisk_idโ the UUID of the ramdisk image when using an AMI. Will benullif not. By default, it appears in the response for administrative users only.reservation_idโ the reservation id for the server. This is an id that can be useful in tracking groups of servers created with multiple create, that will all have the samereservation_id. By default, it appears in the response for administrative users only.root_device_nameโ the root device name for the instance. By default, it appears in the response for administrative users only.scheduler_hintsโ the dictionary of data to send to the scheduler.security_groupsโ a list of applicable security groups. Each group contains keys fordescription,name,id, andrules.server_groupsโ the UUIDs of the server groups to which the server belongs. Currently this can contain at most one entry.statusโ what state your server is in rn. Valid values are:ACTIVE,BUILDING,DELETED,ERROR,HARD_REBOOT,PASSWORD,PAUSED,REBOOT,REBUILD,RESCUED,RESIZED,REVERT_RESIZE,SHUTOFF,SOFT_DELETED,STOPPED,SUSPENDED,UNKNOWN, orVERIFY_RESIZE. yes all of those, it's a whole mood board ๐ญtask_stateโ the task state of this server.terminated_atโ the timestamp of when the server was terminated (if it has been, rip ๐ชฆ).trusted_image_certificatesโ a list of trusted certificate IDs that were used during image signature verification to verify the signing certificate. cute little chain of trust ๐updated_atโ timestamp of when this server was last updated.user_dataโ configuration info or scripts to use upon launch. must be Base64 encoded, no cap, that's the rule.user_idโ the ID of the owners of this server.vm_stateโ the VM state of this server.
change_password(session, password, *, microversion=None)
Change the administrator password to whatever password you pass in. glow-up for the admin account ๐
Parameters
sessionโ the session to use for making this request.passwordโ the new password.
Returns None
get_password(session, *, microversion=None)
Get the encrypted administrator password.
Parameters
sessionโ the session to use for making this request.
Returns The encrypted administrator password.
clear_password(session, *, microversion=None)
Clear the administrator password.
Lowkey important nuance: this removes the password from the database. It does not actually change the server password. Like, it's giving "deleted the receipt but the subscription is still active" ๐
Parameters
sessionโ the session to use for making this request.
Returns None
reboot(session, reboot_type)
Reboot the server, where reboot_type might be 'SOFT' or 'HARD'. choose your fighter โจ
Parameters
sessionโ the session to use for making this request.reboot_typeโ the type of reboot. One of:SOFT,HARD.
Returns None
force_delete(session)
Force delete the server. no soft launch, we're just gone ๐ซถ
Parameters
sessionโ the session to use for making this request.
Returns None
rebuild(session, image, name=Unset.UNSET, admin_password=Unset.UNSET, preserve_ephemeral=Unset.UNSET, access_ipv4=Unset.UNSET, access_ipv6=Unset.UNSET, metadata=Unset.UNSET, user_data=Unset.UNSET, key_name=Unset.UNSET, description=Unset.UNSET, trusted_image_certificates=Unset.UNSET, hostname=Unset.UNSET)
Rebuild the server with the given arguments. full main-character transformation arc ๐ฆ
Parameters
sessionโ the session to use for making this request.imageโ the image to rebuild to. Either an ID or aImage <#openstack.image.v2.image.Image>instance.nameโ a name to set on the rebuilt server. (Optional)admin_passwordโ an admin password to set on the rebuilt server. (Optional)preserve_ephemeralโ whether to preserve the ephemeral drive during the rebuild. (Optional)access_ipv4โ an IPv4 address that will be used to access the rebuilt server. (Optional)access_ipv6โ an IPv6 address that will be used to access the rebuilt server. (Optional)metadataโ metadata to set on the updated server. (Optional)user_dataโ user data to set on the updated server. (Optional)key_nameโ a key name to set on the updated server. (Optional)descriptionโ the description to set on the updated server. (Optional) (requires API microversion 2.19)trusted_image_certificatesโ the trusted image certificates to set on the updated server. (Optional) (requires API microversion 2.78)hostnameโ the hostname to set on the updated server. (Optional) (requires API microversion 2.90)
Returns The updated server.
resize(session, flavor)
Resize the server to a flavor reference. it's giving "new year new me" but for compute ๐ง
Parameters
sessionโ the session to use for making this request.flavorโ the server to resize to.
Returns None
confirm_resize(session)
Confirm the resize of the server. committing to the bit โจ
Parameters
sessionโ the session to use for making this request.
Returns None
revert_resize(session)
Revert the resize of the server. actually no, take me back ๐ญ
Parameters
sessionโ the session to use for making this request.
Returns None
create_image(session, name, metadata=None)
Create an image from the server. snapshot slay ๐ธ
Parameters
sessionโ the session to use for making this request.nameโ the name to use for the created image.metadataโ metadata to set on the created image. (Optional)
Returns image uuid
add_security_group(session, security_group_name)
Add a security group to the server.
Parameters
sessionโ the session to use for making this request.security_group_nameโ the security group to add to the server.
Returns None
remove_security_group(session, security_group_name)
Remove a security group from the server.
Parameters
sessionโ the session to use for making this request.security_group_nameโ the security group to remove from the server.
Returns None
reset_state(session, state)
Reset the server state.
Heads up bestie: this is admin-only by default. don't try it on a regular account, it's not gonna go how you think ๐
Parameters
sessionโ the session to use for making this request.stateโ the state to set on the server.
Returns None
add_fixed_ip(session, network_id)
Add a fixed IP to the server.
This is effectively an alias for adding a network.
Parameters
sessionโ the session to use for making this request.network_idโ the network to connect the server to.
Returns None
remove_fixed_ip(session, address)
Remove a fixed IP from the server.
This is effectively an alias for removing a port from the server.
Parameters
sessionโ the session to use for making this request.network_idโ the address to remove from the server.
Returns None
ok so yes, the parameter in the docs is callednetwork_ideven though the signature saysaddressโ that's literally how it's written, we don't make the rules, we just report them ๐
add_floating_ip(session, address, fixed_address=None)
Add a floating IP to the server.
Parameters
sessionโ the session to use for making this request.addressโ the floating IP address to associate with the server.fixed_addressโ a fixed IP address with which to associated the floating IP. (Optional)
Returns None
remove_floating_ip(session, address)
Remove a floating IP from the server.
Parameters
sessionโ the session to use for making this request.addressโ the floating IP address to disassociate from the server.
Returns None
backup(session, name, backup_type, rotation)
Create a backup of the server. be responsible, bestie ๐
Parameters
sessionโ the session to use for making this request.nameโ the name to use for the backup image.backup_typeโ the type of backup. the value and meaning of this atribute is user-defined and can be used to separate backups of different types. for example, this could be used to distinguish between daily and weekly backups.rotationโ the number of backups to retain. all images older than the rotation'th image will be deleted. yes, deleted deleted ๐ฅ
Returns image uuid
pause(session)
Pause the server. brb, frozen in time โธ๏ธ
Parameters
sessionโ the session to use for making this request.
Returns: None
๐ธ unpause(session) ๐ธ
Unpause the server. Like waking it back up, bestie.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ฆ suspend(session) ๐ฆ
Suspend the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
โจ resume(session) โจ
Resume the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐
lock(session, locked_reason=None) ๐
Lock the server.
Parameters:
sessionโ the session to use for making this request.locked_reasonโ the reason for locking the server.
Returns: None
๐ unlock(session) ๐
Unlock the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ rescue(session, admin_pass=None, image=None) ๐
Rescue the server.
This is admin-only by default. ๐
Parameters:
sessionโ the session to use for making this request.admin_passโ a new admin password to set on the rescued server. (Optional)imageโ the image to use when rescuing the server. If not provided, the server will use the existing image. (Optional)
Returns: None
๐ฉน unrescue(session) ๐ฉน
Unrescue the server.
This is admin-only by default. ๐
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐จ evacuate(session, host=None, admin_pass=None, force=None, on_shared_storage=None) ๐จ
Evacuate the server.
Parameters:
sessionโ the session to use for making this request.hostโ the host to evacuate the instance to. (Optional)admin_passโ the admin password to set on the evacuated instance. (Optional)forceโ whether to force evacuation.on_shared_storageโ whether the host is using shared storage. (Optional) (Only supported before microversion2.14)
Returns: None
๐ข start(session) ๐ข
Start the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ด stop(session) ๐ด
Stop the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ restore(session) ๐
Restore the server.
This is only supported if the server is soft-deleted. This is cloud-specific.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ฆ shelve(session) ๐ฆ
Shelve the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ง shelve_offload(session) ๐ง
Shelve-offload the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ค๏ธ unshelve(session, availability_zone=Unset.UNSET, host=None) ๐ค๏ธ
Unshelve the server.
Parameters:
sessionโ the session to use for making this request.availability_zoneโ if specified the instance will be unshelved to theavailability_zone. IfNoneis passed the instance definedavailability_zoneis unpin and the instance will be scheduled to anyavailability_zone(free scheduling). If not specified the instance will be unshelved to either its definedavailability_zoneor anyavailability_zone(free scheduling).hostโ if specified the host to unshelve the instance.
๐ซ migrate(session, *, host=None) ๐ซ
Migrate the server.
Parameters:
sessionโ the session to use for making this request.hostโ the host to migrate the server to. (Optional)
Returns: None
๐ฅ trigger_crash_dump(session) ๐ฅ
Trigger a crash dump for the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ฅ๏ธ get_console_output(session, length=None) ๐ฅ๏ธ
Get console output for the server.
Parameters:
sessionโ the session to use for making this request.lengthโ the max length of the console output to return. (Optional)
Returns: the console output.
๐ get_console_url(session, console_type) ๐
Get the console URL for the server.
Parameters:
sessionโ the session to use for making this request.console_typeโ the type of console to return. This is cloud-specific. One of:novnc,xvpvnc,spice-html5,spice-direct(after Nova microversion2.99),rdp-html5, orserial.
Returns: the console URL.
๐ฐ๏ธ live_migrate(session, host, force, block_migration, disk_over_commit=False) ๐ฐ๏ธ
Live migrate the server.
Parameters:
sessionโ the session to use for making this request.hostโ the host to live migrate the server to. (Optional)forceโ whether to force the migration. (Optional)block_migrationโ whether to do block migration. One of:True,False,'auto'. (Optional)disk_over_commitโ whether to allow disk over-commit on the destination host. (Optional)
Returns: None
๐ธ๏ธ fetch_topology(session) ๐ธ๏ธ
Fetch the topology information for the server.
Parameters:
sessionโ the session to use for making this request.
Returns: None
๐ก๏ธ fetch_security_groups(session) ๐ก๏ธ
Fetch security groups of the server.
Parameters:
sessionโ the session to use for making this request.
Returns: updated Server instance.
๐ฆ openstack.compute.v2.server_action ๐ฆ
๐ The ServerAction Class ๐
The ServerAction class inherits from Resource.
class openstack.compute.v2.server_action.ServerAction(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'instanceAction'โ singular form of key for resource.resources_key = 'instanceActions'โ plural form of key for resource.base_path = '/servers/%(server_id)s/os-instance-actions'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_list = Trueโ allow list operation for this resource.server_idโ the ID of the server that this action relates to.actionโ the name of the action.request_idโ the ID of the request that this action related to.user_idโ the ID of the user which initiated the server action.project_idโ the ID of the project that this server belongs to.messageโ the related error message for when an action fails.eventsโ events.
๐ง The ServerActionEvent Class ๐ง
The ServerActionEvent class inherits from Resource.
class openstack.compute.v2.server_action.ServerActionEvent(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters:
_synchronizedโ nope, don't touch this one directly bestie, it's not for you ๐. Seenew()andexisting()instead.connectionโ the reference to theConnectionbeing used. Defaults toNonesoResourceobjects can vibe on their own without an active Connection (unit tests, looking at you ๐ ). Anyself._connectionusage in Resource code better protect itself with aNonecheck, fr fr.
event โ the name of the event โจ
start_time โ the date and time when the event was started. The date and time stamp format is ISO 8601 ๐
finish_time โ the date and time when the event finished. The date and time stamp format is ISO 8601 ๐
result โ the result of the event
traceback โ the traceback stack if an error occurred in this event ๐ญ. This is only visible to cloud admins by default.
host โ the name of the host on which the event occurred. This is only visible to cloud admins by default.
host_id โ an obfuscated hashed host ID string, or the empty string if there's no host for the event. It's a hashed value so it will not actually look like a hostname, and it's hashed with data from the project_id โ so the same physical host seen by two different project_ids will come out different ๐. Super useful when, within the same project, you need to figure out whether two events happened on the same physical host or on different ones.
details โ details of the event. May be unset.
๐ธ openstack.compute.v2.server_diagnostics
The ServerDiagnostics Class
The ServerDiagnostics class inherits from Resource <#openstack.resource.Resource>, bestie ๐ซถ
class openstack.compute.v2.server_diagnostics.ServerDiagnostics(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'diagnostics' โ singular form of key for resource.
base_path = '/servers/%(server_id)s/diagnostics' โ the base part of the URI for this resource.
allow_fetch = True โ allow get operation for this resource.
requires_id = False โ do calls for this resource require an ID.
has_config_drive โ indicates whether or not a config drive was used for this server.
state โ the current state of the VM.
driver โ the driver on which the VM is running.
hypervisor โ the hypervisor on which the VM is running.
hypervisor_os โ the hypervisor OS.
uptime โ the amount of time in seconds that the VM has been running.
num_cpus โ the number of vCPUs.
num_disks โ the number of disks.
num_nics โ the number of vNICs.
memory_details โ the dictionary with information about VM memory usage.
cpu_details โ the list of dictionaries with detailed information about VM CPUs.
disk_details โ the list of dictionaries with detailed information about VM disks.
nic_details โ the list of dictionaries with detailed information about VM NICs.
server_id โ the ID for the server ๐ฅ๏ธ
๐ฆ openstack.compute.v2.server_external_event
The ServerExternalEvent Class
The ServerExternalEvent class inherits from Resource <#openstack.resource.Resource> ๐
class openstack.compute.v2.server_external_event.ServerExternalEvent(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>`.connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = None โ singular form of key for resource.
resources_key = 'events' โ plural form of key for resource.
base_path = '/os-server-external-events' โ the base part of the URI for this resource.
requires_id = False โ do calls for this resource require an ID.
create_opts โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create():
CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=False, response_has_body=True)
allow_create = True โ allow create operation for this resource.
allow_fetch = False โ allow get operation for this resource.
allow_delete = False โ allow delete operation for this resource.
allow_list = False โ allow list operation for this resource.
allow_commit = False โ allow update operation for this resource.
name โ the name of this event โจ
code โ the result code (set in the response)
๐ openstack.compute.v2.server_group
The ServerGroup Class
The ServerGroup class inherits from Resource <#openstack.resource.Resource> ๐ธ
class openstack.compute.v2.server_group.ServerGroup(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>`.connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'server_group' โ singular form of key for resource.
resources_key = 'server_groups' โ plural form of key for resource.
base_path = '/os-server-groups' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
name โ a name identifying the server group ๐ท๏ธ
policies โ the list of policies supported by the server group (till 2.63)
policy โ the policy field represents the name of the policy (from 2.64)
member_ids โ the list of members in the server group ๐ฏ
metadata โ the metadata associated with the server group. This is always empty and only used for preserving compatibility. (so yeah, it's giving decorative ๐)
project_id โ the project ID who owns the server group.
rules โ the rules field, which is a dict, can be applied to the policy. Currently, only the max_server_per_host rule is supported for the anti-affinity policy. The max_server_per_host rule allows specifying how many members of the anti-affinity group can reside on the same compute host. If not specified, only one member from the same anti-affinity group can reside on a given host.
user_id โ the user ID who owns the server group
๐
openstack.compute.v2.server_interface
The ServerInterface Class
The ServerInterface class inherits from Resource <#openstack.resource.Resource> ๐ฆ
class openstack.compute.v2.server_interface.ServerInterface(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>`.connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'interfaceAttachment' โ singular form of key for resource.
resources_key = 'interfaceAttachments' โ plural form of key for resource.
base_path = '/servers/%(server_id)s/os-interface' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = False โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
fixed_ips โ fixed IP addresses with subnet IDs.
mac_addr โ the MAC address.
net_id โ the network ID ๐
port_idโ the ID of the port you're making an interface for, bestie ๐port_stateโ the port state. that's the whole vibe.server_idโ the ID for the server ๐tagโ tags for the virtual interfaces ๐ท๏ธ
๐ openstack.compute.v2.server_ip ๐
The ServerIP Class โจ
okay so the ServerIP class inherits from Resource <#openstack.resource.Resource> โ it's giving "chip off the old block," iconic behavior ๐
class openstack.compute.v2.server_ip.ServerIP(_synchronized=False,
connection=None, **attrs)
the base resource ๐ซถ
Parameters
_synchronizedโ ngl this is not meant to be used directly, bestie. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead ๐connectionโ a reference to theConnectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. and like, if you're usingself._connectioninsideResourcecode, protect yourself with a check forNoneโ periodt ๐resources_key = 'addresses'โ the plural form of the key for the resource ๐base_path = '/servers/%(server_id)s/ips'โ the base part of the URI for this resource ๐ธallow_list = Trueโ allow the list operation for this resource, slay โจaddressโ the IP address. the format of the address depends onversion๐network_labelโ the network label, likepublicorprivate๐ฆserver_idโ the ID for the server ๐
classmethod list(session, paginated=False, base_path=None,
allow_unknown_params=False, *, microversion=None, headers=None,
max_items=None, server_id=None, network_label=None, **params)
this method is a generator which yields resource objects ๐ฅ this resource object list generator handles pagination and takes query params for response filtering. lowkey does it all.
Parameters
sessionโ the session to use for making this request ๐paginatedโTrueif a GET to this resource returns a paginated series of responses, orFalseif a GET returns only one page of data. whenpaginatedisFalse, only one page of data gets returned regardless of the API's support of pagination ๐base_pathโ the base part of the URI for listing resources, if it's different frombase_path<#openstack.resource.Resource.base_path> ๐ค๏ธallow_unknown_paramsโTrueto accept, but discard, unknown query parameters. this lets you get a list of 'filters' and pass everything known to the server.Falsewill result in a validation exception when unknown query parameters are passed โ ๏ธmicroversionโ the API version to override the negotiated one ๐headersโ additional headers to inject into the HTTP request ๐ฌmax_itemsโ the maximum number of items to return. typically this must be used withpaginated=True๐paramsโ these keyword arguments get passed through the_transpose()method to find if any of them match expected query parameters to be sent in theparamsargument toget(). they're additionally checked against thebase_path<#openstack.resource.Resource.base_path> format string to see if any path fragments need to be filled in by the contents of this argument. parameters supported as filters by the server side are passed in the API call, and the remaining parameters are applied as filters to the retrieved results ๐ง
Returns โ a generator of Resource objects ๐ซ
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_list is not set to True ๐ญ
Raises InvalidResourceQuery <#openstack.exceptions.InvalidResourceQuery> if the query contains invalid params ๐จ
๐ openstack.compute.v2.server_migration ๐
The ServerMigration Class ๐
the ServerMigration class inherits from Resource <#openstack.resource.Resource> โ main character energy fr fr ๐
class
openstack.compute.v2.server_migration.ServerMigration(_synchronized=False,
connection=None, **attrs)
the base resource ๐ซถ
Parameters
_synchronizedโ not intended to be used directly, bestie. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> ๐connectionโ a reference to theConnectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'migration'โ the singular form of the key for the resource ๐resources_key = 'migrations'โ the plural form of the key for the resource โจbase_path = '/servers/%(server_id)s/migrations'โ the base part of the URI for this resource ๐ค๏ธallow_fetch = Trueโ allow the get operation for this resource ๐allow_list = Trueโ allow the list operation for this resource ๐allow_delete = Trueโ allow the delete operation for this resource ๐๏ธserver_idโ the ID for the server, from the URI of the resource ๐created_atโ the date and time when the resource was created โฐdest_hostโ the target host of the migration ๐ฅ๏ธdest_computeโ the target compute of the migration โ๏ธdest_nodeโ the target node of the migration ๐disk_processed_bytesโ the amount of disk, in bytes, that has been processed during the migration ๐พdisk_remaining_bytesโ the amount of disk, in bytes, that still needs to be migrated ๐พdisk_total_bytesโ the total amount of disk, in bytes, that needs to be migrated ๐พmemory_processed_bytesโ the amount of memory, in bytes, that has been processed during the migration ๐งmemory_remaining_bytesโ the amount of memory, in bytes, that still needs to be migrated ๐งmemory_total_bytesโ the total amount of memory, in bytes, that needs to be migrated ๐งproject_idโ the ID of the project that initiated the server migration (since microversion 2.80) ๐ท๏ธserver_uuidโ the UUID of the server, from the response body ๐source_computeโ the source compute of the migration โ๏ธsource_nodeโ the source node of the migration ๐statusโ the current status of the migration ๐updated_atโ the date and time when the resource was last updated โฐuser_idโ the ID of the user that initiated the server migration (since microversion 2.80) ๐uuidโ the UUID of the migration (since microversion 2.59) ๐force_complete(session)โ force an on-going live migration to complete ๐
๐ฆ openstack.compute.v2.server_remote_console ๐ฆ
The ServerRemoteConsole Class โจ
the ServerRemoteConsole class inherits from Resource <#openstack.resource.Resource> โ we love a console glow-up ๐
class
openstack.compute.v2.server_remote_console.ServerRemoteConsole(_synchronized=False,
connection=None, **attrs)
the base resource ๐ซถ
Parameters
_synchronizedโ this is not intended to be used directly. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> ๐connectionโ a reference to theConnectionbeing used. defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone๐ซถresource_key = 'remote_console'โ the singular form of the key for the resource ๐base_path = '/servers/%(server_id)s/remote-consoles'โ the base part of the URI for this resource ๐ค๏ธallow_create = Trueโ allow the create operation for this resource โallow_fetch = Falseโ allow the get operation for this resource โallow_commit = Falseโ allow the update operation for this resource โallow_delete = Falseโ allow the delete operation for this resource โallow_list = Falseโ allow the list operation for this resource โprotocolโ protocol of the remote console ๐typeโ type of the remote console ๐ท๏ธurlโ URL used to connect to the console ๐server_idโ the ID for the server ๐
๐ธ openstack.compute.v2.service ๐ธ
The Service Class ๐
the Service class inherits from Resource <#openstack.resource.Resource> โ serving looks, literally ๐โโ๏ธ
class openstack.compute.v2.service.Service(_synchronized=False,
connection=None, **attrs)
the base resource ๐ซถ
Parameters
_synchronizedโ nope, not intended to be used directly. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> ๐connectionโ a reference to theConnectionbeing used. defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone๐
okay so, we're jumping back into the Service attribute list mid-glow-upโno recap, just vibes and facts:
resource_key = 'service'โ singular form of the key for this resource. ๐resources_key = 'services'โ plural form of the key for this resource. โจbase_path = '/os-services'โ the base part of the URI for this resource. ๐allow_list = Trueโ allow list operation for this resource. ๐allow_commit = Trueโ allow update operation for this resource. ๐ฅallow_delete = Trueโ allow delete operation for this resource. ๐availability_zoneโ the availability zone of service. ๐ธbinaryโ binary name of service. ๐งdisabled_reasonโ disabled reason of service. ๐is_forced_downโ whether or not this service was forced down manually by an administrator after the service was fenced. ๐ซถhostโ the name of the host where service runs. ๐nameโ service name. โญstateโ state of service. ๐statusโ status of service. ๐ฆupdated_atโ the date and time when the resource was updated. ๐
๐ classmethod find
classmethod find(session, name_or_id, ignore_missing=True,
list_base_path=None, *, microversion=None, all_projects=None,
**params)
Finds a resource by its name or id. It's giving search-bar main character energy, no cap.
๐งพ Parameters
sessionโ the session to use for making this request.name_or_idโ this resource's identifier, if needed by the request. The default isNone.ignore_missingโ when set toFalse,openstack.exceptions.NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.list_base_pathโ thebase_pathto use when you need to list resources.microversionโ API version to override the negotiated one.paramsโ any additional parameters to be passed into underlying methods, such as toexisting()(openstack.resource.Resource.existing) in order to pass on URI parameters.
Returns โ the Resource object matching the given name or id, or None if nothing matches.
Raises openstack.exceptions.DuplicateResource if more than one resource is found for this request.
Raises openstack.exceptions.NotFoundException if nothing is found and ignore_missing is False.
๐พ commit(session, prepend_key=False, *args, **kwargs)
commit(session, prepend_key=False, *args, **kwargs)
Commits the state of the instance to the remote resource. Iconic commit behavior, fr fr.
๐งพ Parameters
sessionโ the session to use for making this request.prepend_keyโ whether theresource_key(openstack.resource.Resource.resource_key) should be prepended in a resource creation request. Default toTrue. (Yes, the signature saysprepend_key=Falseand this blurb says โDefault toTrueโโboth are straight from the source, bestie. ๐ซถ)retry_on_conflictโ whether to enable retries onHTTP CONFLICT (409). Value ofNoneleaves the Adapter defaults.base_pathโ base part of the URI for modifying resources, if different frombase_path(openstack.resource.Resource.base_path).microversionโ API version to override the negotiated one.attrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns โ this Resource instance.
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_commit is not set to True.
Here are the service action methodsโsame session energy, different jobs:
set_forced_down(session, host=None, binary=None, forced=False)โ updatesforced_downinformation of a service.force_down(session, host=None, binary=None, forced=False)โ updatesforced_downinformation of a service.enable(session, host, binary)โ enables service.disable(session, host, binary, reason=None)โ disables service.
๐ธ openstack.compute.v2.usage ๐ธ
๐ The Usage Class ๐
The Usage class inherits from Resource.
class openstack.compute.v2.usage.Usage(_synchronized=False,
connection=None, **attrs)
The base resource. Lowkey the blueprint for everything, periodt.
๐งพ Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = 'tenant_usage'โ singular form of the key for this resource. ๐resources_key = 'tenant_usages'โ plural form of the key for this resource. โจbase_path = '/os-simple-tenant-usage'โ the base part of the URI for this resource. ๐allow_create = Falseโ allow create operation for this resource. ๐allow_fetch = Trueโ allow get operation for this resource. ๐ฅallow_delete = Falseโ allow delete operation for this resource. ๐allow_list = Trueโ allow list operation for this resource. ๐allow_commit = Falseโ allow update operation for this resource. ๐ซถproject_idโ the UUID of the project in a multi-tenancy cloud. ๐server_usagesโ a list of the server usage objects. ๐ฆtotal_local_gb_usageโ multiplying the server disk size (in GiB) by hours the server exists, and then adding that all together for each server. ๐งtotal_vcpus_usageโ multiplying the number of virtual CPUs of the server by hours the server exists, and then adding that all together for each server. โญtotal_memory_mb_usageโ multiplying the server memory size (in MiB) by hours the server exists, and then adding that all together for each server. ๐total_hoursโ the total duration that servers exist (in hours). ๐startโ the beginning time to calculate usage statistics on compute and storage resources. ๐ธstopโ the ending time to calculate usage statistics on compute and storage resources. โจ
๐ง The ServerUsage Class ๐ง
The ServerUsage class inherits from Resource.
class openstack.compute.v2.usage.ServerUsage(_synchronized=False,
connection=None, **attrs)
The base resource. Same template tea, different resource vibes.
๐งพ Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = Noneโ singular form of the key for this resource. ๐resources_key = Noneโ plural form of the key for this resource. โจallow_create = Falseโ allow create operation for this resource. ๐allow_fetch = Falseโ allow get operation for this resource. ๐allow_delete = Falseโ allow delete operation for this resource. ๐allow_list = Falseโ allow list operation for this resource. ๐ซถallow_commit = Falseโ allow update operation for this resource. ๐ฆhoursโ the duration that the server exists (in hours). โญflavorโ the display name of a flavor. ๐instance_idโ the UUID of the server. ๐nameโ the server name. ๐project_idโ the UUID of the project in a multi-tenancy cloud. ๐ธmemory_mbโ the memory size of the server (in MiB). ๐งlocal_gbโ the sum of the root disk size of the server and the ephemeral disk size of it (in GiB). โจvcpusโ the number of virtual CPUs that the server uses. ๐ฅstarted_atโ the date and time when the server was launched. ๐ended_atโ the date and time when the server was deleted. ๐stateโ the VM state. ๐uptimeโ the uptime of the server. ๐ฆ
๐ฆ openstack.compute.v2.volume_attachment ๐ฆ
๐ The VolumeAttachment Class ๐
The VolumeAttachment class inherits from Resource.
class
openstack.compute.v2.volume_attachment.VolumeAttachment(_synchronized=False,
connection=None, **attrs)
The base resource. Attachment era, but make it resourceful.
๐งพ Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = 'volumeAttachment'โ singular form of the key for this resource. ๐resources_key = 'volumeAttachments'โ plural form of the key for this resource. โจbase_path='/servers/%(server_id)s/os-volume_attachments'โ the base chunk of the URI for this resource, bestie. It's the address bar starter pack โจallow_create=Trueโ yup, you can create this one ๐ซถallow_fetch=Trueโ and get it too, lowkey essential ๐allow_commit=Trueโ updates are allowed, slay ๐allow_delete=Trueโ and yes, you can delete it, no capallow_list=Trueโ listing is on the menu too ๐ธserver_idโ the ID for the server, obviously ๐deviceโ name of the device, like,/dev/vdb. That's literally what the original says, comma and all โ keeping it exactly as-is ๐idโ the ID of the attachment, iconic identifier behavior ๐volume_idโ the ID of the attached volume ๐attachment_idโ the UUID of the associated volume attachment in Cinder. That's the Cinder one, not the other one, iykyk ๐ฆbdm_idโ the ID of the block device mapping record for the attachment โญtagโ virtual device tags for the attachment ๐delete_on_terminationโ says whether to delete the volume when the server gets destroyed. Big consequences energy ๐ญ
openstack.compute.version
The Version Class โจ
So the Version class inherits from Resource <#openstack.resource.Resource>, bestie. Family tree moment ๐
class openstack.compute.version.Version(_synchronized=False, connection=None, **attrs)
The base resource โ that's the whole vibe ๐ซถ
Parameters
_synchronizedโ okay so this one is not intended to be used directly, periodt. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>instead ๐connectionโ reference to theConnectionbeing used. It defaults toNoneso thatResourceobjects can be used without an activeConnection, like in unit tests. And if you're usingself._connectioninsideResourcecode, you gotta protect yourself with a check forNone๐ฅresource_key='version'โ the singular form of the key for the resource ๐resources_key='versions'โ and the plural form, the more the merrier โจbase_path='/'โ the base part of the URI for this resource. Just a slash. Minimalist icon ๐allow_list=Trueโ listing allowed, we love to see it ๐ธ
Container Infrastructure Management Resources
It's giving whole new continent of resources, bestie ๐ฆ
openstack.container_infrastructure_management.v1.cluster
The Cluster Class ๐
The Cluster class inherits from Resource <#openstack.resource.Resource> too. Nepo baby but make it API ๐ญ
class openstack.container_infrastructure_management.v1.cluster.Cluster(_synchronized=False, connection=None, **attrs)
The base resource โ same as before, the foundation of it all ๐
Parameters
_synchronizedโ again, not intended to be used directly, don't do it ๐ซถ Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used, defaults toNonesoResourceobjects work without an activeConnection, like in unit tests. And use ofself._connectioninResourcecode should protect itself with a check forNone, fr fr ๐resources_key='clusters'โ plural form of key for resource ๐base_path='/clusters'โ the base part of the URI for this resource โญallow_create=Trueโ can create โจallow_fetch=Trueโ can get ๐allow_commit=Trueโ can update ๐allow_delete=Trueโ can delete ๐ฆallow_list=Trueโ can list ๐ธallow_patch=Trueโ and can patch, fancy ๐commit_method='PATCH'โ the method for committing a resource. This must bePATCHifallow_patchisTrue. That's a hard requirement, not a suggestion, no cap ๐ฅapi_addressโ the endpoint URL of the COE API exposed to end-users ๐cluster_template_idโ the UUID of the cluster template ๐coe_versionโ version info of the chosen COE in the bay/cluster, which helps the client pick the right version of the client. Helpful king behavior โญcreate_timeoutโ the timeout for cluster creation in minutes. The value expected is a positive integer. If the timeout is reached during the cluster creation process, the operation will be aborted and the cluster status will be set toCREATE_FAILED. Defaults to60. So yeahโฆ don't sleep on it ๐ญcreated_atโ the date and time when the resource was created. The date and time stamp format is ISO 8601:
CCYY-MM-DDThh:mm:ssยฑhh:mm
For example, 2015-08-27T09:49:58-05:00. The ยฑhh:mm value, if included, is the time zone as an offset from UTC. ISO girlies rise ๐
discovery_urlโ the custom discovery url for node discovery. This is used by the COE to discover the servers that have been created to host the containers. The actual discovery mechanism varies with the COE. In some cases, the service fills in the server info in the discovery service. In other cases, if thediscovery_urlis not specified, the service will use the public discovery service athttps://discovery.etcd.io. In this case, the service will generate a unique url here for each bay and store the info for the servers ๐ฆfixed_networkโ the name or ID of the network to provide connectivity to the internal network for the bay/cluster ๐fixed_subnetโ the fixed subnet to use when allocating network addresses for nodes in bay/cluster ๐ธflavor_idโ the flavor name or ID to use when booting the node servers. Defaults tom1.small๐is_floating_ip_enabledโ whether to enable using the floating IP of the cloud provider. Some cloud providers use floating IPs while some use public IPs. When set totrue, floating IPs will be used. If this value is not provided, the value offloating_ip_enabledprovided in the template will be used. Ship it โจis_master_lb_enabledโ whether to enable the master load balancer. Since multiple masters may exist in a bay/cluster, a Neutron load balancer is created to provide the API endpoint for the bay/cluster and to direct requests to the masters. In some cases, such as when the LBaaS service is not available, this option can be set tofalseto create a bay/cluster without the load balancer. In this case, one of the masters will serve as the API endpoint. The default istrue, i.e. to create the load balancer for the bay. Main character load balancer energy ๐keypairโ the name of the SSH keypair to configure in the bay/cluster servers for SSH access. Users will need the key to be able to ssh to the servers in the bay/cluster. The login name is specific to the bay/cluster driver. For example, with thefedora-atomicimage the default login name isfedora๐labelsโ arbitrary labels. The accepted keys and valid values are defined in the bay/cluster drivers. They're used as a way to pass additional parameters that are specific to a bay/cluster driver ๐ท๏ธmaster_addressesโ a list of floating IPs of all master nodes ๐master_countโ the number of servers that will serve as master for the bay/cluster. Set it to more than1master to enable High Availability. If the optionmaster-lb-enabledis specified in the baymodel/cluster template, the master servers will be placed in a load balancer pool. Defaults to1๐master_flavor_idโ the flavor of the master node for this baymodel/cluster template โญnameโ name of the resource. Justโฆ the name. Simple, iconic ๐node_countโ the number of servers that will serve as node in the bay/cluster. Defaults to1๐ธnode_addressesโ a list of floating IPs of all servers that serve as nodes ๐ฆstack_idโ the reference UUID of the orchestration stack from the Heat orchestration service ๐ฅstatusโ the current state of the bay/cluster ๐status_reasonโ the reason of the bay/cluster's current status. Receipts, basically ๐งพupdated_atโ the date and time when the resource was updated. The date and time stamp format is ISO 8601:
CCYY-MM-DDThh:mm:ssยฑhh:mm
For example, 2015-08-27T09:49:58-05:00. The ยฑhh:mm value, if included, is the time zone as an offset from UTC. If the updated_at date and time stamp is not set, its value is null. It's giving "no update yet" ๐
uuidโ the UUID of the cluster โจproject_idโ the project the cluster belongs to ๐ซถ
resize(session, *, node_count, nodes_to_remove=None)
Resize the cluster. Glow-up but for infrastructure ๐
resize(session, *, node_count, nodes_to_remove=None)
Parameters
node_countโ the number of servers that will serve as node in the bay/cluster. The default is1๐nodes_to_removeโ the server ID list will be removed if downsizing the cluster. Bye bestie ๐
Returns
The UUID of the resized cluster โจ
Raises
NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found. So likeโฆ if it's not there ๐ญ
upgrade(session, *, cluster_template, max_batch_size=None)
Upgrade the cluster. Level-up arc ๐
upgrade(session, *, cluster_template, max_batch_size=None)
Parameters
cluster_templateโ the UUID of the cluster template ๐max_batch_sizeโ the max batch size each time when doing upgrade. The default is1๐
Returns
The UUID of the updated cluster โญ
Raises
NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found. Same deal, if it's missing it's missing ๐
๐ธ openstack.container_infrastructure_management.v1.cluster_certificate
The Cluster Certificate Class โ okay so the ClusterCertificate class inherits from Resource <#openstack.resource.Resource>.
class openstack.container_infrastructure_management.v1.cluster_certificate.ClusterCertificate(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.base_path='/certificates'โ The base part of the URI for this resource.allow_create=Trueโ Allow create operation for this resource.allow_list=Falseโ Allow list operation for this resource.allow_fetch=Trueโ Allow get operation for this resource.bay_uuidโ The UUID of the bay.cluster_uuidโ The UUID of the cluster.csrโ Certificate Signing Request (CSR) for authenticating client key.pemโ CA certificate for the bay/cluster.
๐ openstack.container_infrastructure_management.v1.cluster_template
The Cluster Template Class โ the ClusterTemplate class inherits from Resource <#openstack.resource.Resource>.
class openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key='clustertemplates'โ Plural form of key for resource.base_path='/clustertemplates'โ The base part of the URI for this resource.allow_create=Trueโ Allow create operation for this resource.allow_fetch=Trueโ Allow get operation for this resource.allow_commit=Trueโ Allow update operation for this resource.allow_delete=Trueโ Allow delete operation for this resource.allow_list=Trueโ Allow list operation for this resource.allow_patch=Trueโ Allow patch operation for this resource.commit_method='PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.apiserver_portโ The exposed port of COE API server.cluster_distroโ Display the attributeos_distrodefined as appropriate metadata in image for the bay/cluster driver.coeโ Specify the Container Orchestration Engine to use. Supported COEs includekubernetes,swarm,mesos.created_atโ The date and time when the resource was created.docker_storage_driverโ The name of a driver to manage the storage for the images and the container's writable layer.docker_volume_sizeโ The size in GB for the local storage on each server for the Docker daemon to cache the images and host the containers.dns_nameserverโ The DNS nameserver for the servers and containers in the bay/cluster to use.external_network_idโ The name or network ID of a Neutron network to provide connectivity to the external internet for the bay/cluster.fixed_networkโ The name or network ID of a Neutron network to provide connectivity to the internal network for the bay/cluster.fixed_subnetโ Fixed subnet that are using to allocate network address for nodes in bay/cluster.flavor_idโ The nova flavor ID or name for booting the node servers.http_proxyโ The IP address for a proxy to use when direct http access from the servers to sites on the external internet is blocked. This may happen in certain countries or enterprises, and the proxy allows the servers and containers to access these sites. The format is a URL including a port number. The default isNone.https_proxyโ The IP address for a proxy to use when direct https access from the servers to sites on the external internet is blocked.image_idโ The name or UUID of the base image in Glance to boot the servers for the bay/cluster.insecure_registryโ The URL pointing to user's own private insecure docker registry to deploy and run docker containers.is_floating_ip_enabledโ Whether enable or not using the floating IP of cloud provider.is_hiddenโ Indicates whether theClusterTemplateis hidden or not.is_master_lb_enabledโ this option can be set tofalseto create a bay/cluster without the load balancer.is_tls_disabledโ Specifying this parameter will disable TLS so that users can access the COE endpoints without a certificate.is_publicโ Setting this flag makes the baymodel/cluster template public and accessible by other users.is_registry_enabledโ This option provides an alternative registry based on the Registry V2keypair_idโ The name of the SSH keypair to configure in the bay/cluster servers for ssh access.labelsโ Arbitrary labels. The accepted keys and valid values are defined in the bay/cluster drivers. They are used as a way to pass additional parameters that are specific to a bay/cluster driver.master_flavor_idโ The flavor of the master node for this baymodel/cluster template.network_driverโ The name of a network driver for providing the networks for the containers.no_proxyโ When a proxy server is used, some sites should not go through the proxy and should be accessed normally.server_typeโ The servers in the bay/cluster can bevmorbaremetal.updated_atโ The date and time when the resource was updated.uuidโ The UUID of the cluster template.volume_driverโ The name of a volume driver for managing the persistent storage for the containers.
๐ฆ openstack.container_infrastructure_management.v1.service
The Service Class โ the Service class inherits from Resource <#openstack.resource.Resource>.
class openstack.container_infrastructure_management.v1.service.Service(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key='mservices'โ Plural form of key for resource.base_path='/mservices'โ The base part of the URI for this resource.allow_list=Trueโ Allow list operation for this resource.binaryโ The name of the binary form of the Magnum service.created_atโ The date and time when the resource was created.disabled_reasonโ The disable reason of the service,nullif the service is enabled or disabled without reason provided.hostโ The host for the service.report_countโ The total number of report.stateโ The current state of Magnum services.updated_atโ The date and time when the resource was updated.
๐พ Database Resources
๐ openstack.database.v1.database
The Database Class โ the Database class inherits from Resource <#openstack.resource.Resource>.
class openstack.database.v1.database.Database(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key='database'โ Singular form of key for resource.resources_key='databases'โ Plural form of key for resource.base_path='/instances/%(instance_id)s/databases'โ The base part of the URI for this resource.allow_create=Trueโ Allow create operation for this resource.allow_delete=Trueโ Allow delete operation for this resource.allow_list=Trueโ Allow list operation for this resource.character_setโ the set of symbols and encodings, like the alphabet the database speaks. default isutf8โจcollateโ the ruleset for comparing characters inside that character set. default isutf8_general_ciinstance_idโ the ID of the instancenameโ the name of the database
๐ฆ openstack.database.v1.flavor
The Flavor Class ๐
okay so the Flavor class inherits from Resource (iykyk, that's the base of everything around here).
class openstack.database.v1.flavor.Flavor(_synchronized=False, connection=None, **attrs)
The base resource ๐ซถ that's literally what it says on the tin.
Parameters
- _synchronized โ not a thing you touch directly, bestie, fr fr. go look at
new()andexisting()instead. - connection โ a reference to the
Connectionbeing used. it defaults toNonesoResourceobjects can exist without an activeConnection, like in unit tests. if you're usingself._connectioninsideResourcecode, guard it with aNonecheck, okay? protect yourself ๐
Attributes:
resource_key = 'flavor'โ the singular form of the key for this resourceresources_key = 'flavors'โ the plural form of the key for this resourcebase_path = '/flavors'โ the base part of the URI for this resourceallow_list = Trueโ allow list operation for this resource, yes queen ๐allow_fetch = Trueโ allow get operation for this resourcelinksโ links associated with the flavornameโ the name of the flavorramโ the size in MB of RAM the flavor has
๐ openstack.database.v1.instance
The Instance Class ๐ฅ
this one inherits from Resource too, obviously.
class openstack.database.v1.instance.Instance(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
- _synchronized โ don't use this directly, seriously. see
new()andexisting(). - connection โ a reference to the
Connectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection(unit tests, hello). ifResourcecode usesself._connection, it should protect itself with aNonecheck ๐
Attributes:
resource_key = 'instance'โ the singular form of the key for this resourceresources_key = 'instances'โ the plural form of the key for this resourcebase_path = '/instances'โ the base part of the URI for this resourceallow_create = Trueโ allow create operation for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Trueโ allow delete operation for this resourceallow_list = Trueโ allow list operation for this resourceflavorโ the flavor of the instancelinksโ links associated with the instancenameโ the name of the instancestatusโ the status of the instancevolumeโ the size of the volumedatastoreโ a dictionary of datastore details, usually with'type'and'version'keysidโ the ID of this instanceregionโ the region this instance resides inhostnameโ the name of the hostcreated_atโ the timestamp of when this instance was createdupdated_atโ the timestamp of when this instance was updated
Methods, let's gooo:
enable_root_user(session)โ enable login for the root user. this operation enables login from any host for the root user and hands the user a generated root password. parameters:session(Adapter) โ the session to use for making this request. returns: a dictionary with the keysnameandpasswordspecifying the login credentials ๐is_root_enabled(session)โ determine if root is enabled on an instance. specifically, whether root is enabled on this particular instance. parameters:session(Adapter) โ the session to use for making this request. returns:Trueif the root user is enabled for the specified database instance,Falseotherwiserestart(session)โ restart the database instance. returns:Noneresize(session, flavor_reference)โ resize the database instance. returns:Noneresize_volume(session, volume_size)โ resize the volume attached to the instance. returns:None
๐ openstack.database.v1.user
The User Class ๐
yep, inherits from Resource again. it's giving family reunion.
class openstack.database.v1.user.User(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
- _synchronized โ not intended to be used directly. see
new()andexisting(). - connection โ a reference to the
Connectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone๐
Attributes:
resource_key = 'user'โ the singular form of the key for this resourceresources_key = 'users'โ the plural form of the key for this resourcebase_path = '/instances/%(instance_id)s/users'โ the base part of the URI for this resource (yes, there's a%(instance_id)sin there, it's a template, don't panic)allow_create = Trueโ allow create operation for this resourceallow_delete = Trueโ allow delete operation for this resourceallow_list = Trueโ allow list operation for this resourcedatabasesโ databases the user has access tonameโ the name of the userpasswordโ the password of the user
๐ธ DNS Resources
openstack.dns.v2.blacklist
The Blacklist Class ๐ค
the Blacklist class inherits from Resource.
class openstack.dns.v2.blacklist.Blacklist(_synchronized=False, connection=None, **attrs)
DNS Blacklist Resource โ iconic.
The base resource
Parameters
- _synchronized โ this is not intended to be used directly. see
new()andexisting(). - connection โ reference to the
Connectionbeing used. defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone.
Attributes:
resources_key = 'blacklists'โ plural form of key for resourcebase_path = '/blacklists'โ the base part of the URI for this resourceallow_list = Trueโ allow list operation for this resourceallow_create = Trueโ allow create operation for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Trueโ allow delete operation for this resourcecommit_method = 'PATCH'โ the method for committing a resource. this must bePATCHifallow_patchisTrue๐idโ properties ID for the resourcepatternโ pattern for this blacklistdescriptionโ description for this blacklistcreated_atโ timestamp of when the blacklist was createdupdated_atโ timestamp of when the blacklist was last updatedlinksโ links to the resource, and the other related resources
openstack.dns.v2.floating_ip
The FloatingIP Class ๐ฆ
the DNS class inherits from Resource.
class openstack.dns.v2.floating_ip.FloatingIP(_synchronized=False, connection=None, **attrs)
DNS Floating IP Resource โ floating, literally.
The base resource
Parameters
- _synchronized โ not intended to be used directly. see
new()andexisting(). - connection โ reference to the
Connectionbeing used. defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. use ofself._connectioninResourcecode should protect itself with a check forNone.
Attributes:
resources_key = 'floatingips'โ plural form of key for resourcebase_path = '/reverse/floatingips'โ the base part of the URI for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_list = Trueโ allow list operation for this resourcecommit_method = 'PATCH'โ method for committing a resource. this must bePATCHifallow_patchisTrueactionโ the properties' current action in progress on the resourceaddressโ the floatingip address for this PTR recorddescriptionโ description for this PTR recordptrdnameโ domain name for this PTR recordstatusโ status of the resourcettlโ time to live for this PTR record โณ
โจ openstack.dns.v2.limit โจ
๐ธ The Limit Class ๐ธ
The Limit class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.limit.Limit(_synchronized=False, connection=None,
**attrs)
DNS Limit Resource โ okay bestie, this one is the base resource. ๐
Parameters:
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = 'limit'โ Singular form of key for resource.base_path = '/limits'โ The base part of the URI for this resource.allow_list = Trueโ Allow list operation for this resource.max_page_limitโ Properties: The max amount of items allowed per page.max_recordset_name_lengthโ The max length of a recordset name.max_recordset_recordsโ The max amount of records contained in a recordset.max_zone_name_lengthโ The max length of a zone name.max_zone_recordsโ The max amount of records in a zone.max_zone_recordsetsโ The max amount of recordsets per zone.max_zonesโ The max amount of zones for this project.min_ttlโ The lowest ttl allowed on this system.
โจ openstack.dns.v2.quota โจ
๐ The Quota Class ๐
The Quota class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.quota.Quota(_synchronized=False, connection=None,
**attrs)
DNS Quota Resource โ yep, the base resource again, bestie. ๐ซถ
Parameters:
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.base_path = '/quotas'โ The base part of the URI for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.commit_method = 'PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.projectโ The ID of the project.api_export_sizeโ The maximum amount of recordsets allowed in a zone export. Type:intrecordset_recordsโ The maximum amount of records allowed per recordset. Type:intzone_recordsโ The maximum amount of records allowed per zone. Type:intzone_recordsetsโ The maximum amount of recordsets allowed per zone. Type:intzonesโ The maximum amount of zones allowed per project. Type:int
๐ ๏ธ fetch(...) ๐ ๏ธ
fetch(session, requires_id=True, base_path=None,
error_message=None, skip_cache=False, *,
resource_response_key=None, microversion=None, **params)
Get a remote resource based on this instance.
Parameters:
sessionโ The session to use for making this request.requires_idโ Whether resource ID should be part of the requested URI.base_pathโ Base part of the URI for fetching resources, if different frombase_path<# openstack.resource.Resource.base_path>.error_messageโ An error message to be returned if requested object does not exist.skip_cacheโ A boolean indicating whether optional API cache should be skipped for this invocation.resource_response_keyโ Overrides the usage ofself.resource_keywhen processing the response body.microversionโ API version to override the negotiated one.paramsโ Additional parameters that can be consumed.
Returns: This Resource instance.
๐ Raises:MethodNotSupported<#openstack.exceptions.MethodNotSupported> ifResource.allow_fetchis not set toTrue.
๐ Raises: NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found.
๐ openstack.dns.v2.recordset ๐
๐ฆ The Recordset Class ๐ฆ
The DNS class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.recordset.Recordset(_synchronized=False,
connection=None, **attrs)
DNS Recordset Resource โ the base resource, but make it DNS. โจ
Parameters:
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resources_key = 'recordsets'โ Plural form of key for resource.base_path = '/zones/%(zone_id)s/recordsets'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.actionโ Properties: current action in progress on the resource.created_atโ Timestamp when the zone was created.descriptionโ Recordset description.linksโ Links contains a self pertaining to this zone or a next pertaining to next page.nameโ DNS Name of the recordset.project_idโ ID of the project which the recordset belongs to.recordsโ DNS record value list.statusโ Recordset status Valid values include:PENDING_CREATE,ACTIVE,PENDING_DELETE,ERROR.ttlโ Time to live, default300, available value300-2147483647(seconds).typeโ DNS type of the recordset Valid values includeA,AAAA,MX,CNAME,TXT,NS,SSHFP,SPF,SRV,PTR.updated_atโ Timestamp when the zone was last updated.zone_idโ The id of the Zone which this recordset belongs to.zone_nameโ The name of the Zone which this recordset belongs to.
โญ openstack.dns.v2.service_status โญ
๐ The ServiceStatus Class ๐
The ServiceStatus class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.service_status.ServiceStatus(_synchronized=False,
connection=None, **attrs)
Designate Service Statuses โ the base resource, serving status realness. ๐
Parameters:
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resources_key = 'service_statuses'โ Plural form of key for resource.base_path = '/service_statuses'โ The base part of the URI for this resource.allow_create = Falseโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Falseโ Allow update operation for this resource.allow_delete = Falseโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.capabilitiesโ Capabilities for the service.created_atโ Timestamp when the resource was created.heartbeated_atโ Timestamp when the last heartbeat was received.hostnameโ Hostname of the host with the service instance Type:strlinksโ Links contains a self pertaining to this service status or a next pertaining to next page.service_nameโ The name of the Designate service instance Type:strstatsโ Statistics for the service.statusโ The status of the resource Type:enumupdated_atโ Timestamp when the resource was last updated.
๐ง openstack.dns.v2.tld ๐ง
๐ The TLD Class ๐
The DNS class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.tld.TLD(_synchronized=False, connection=None,
**attrs)
DNS TLD Resource โ the base resource, top-level domain edition. ๐
Parameters:
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.
okay so continuing the tld resource deets, bestie:
connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'tlds'โ Plural form of key for resource.base_path = '/tlds'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.commit_method = 'PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.nameโ TLD namedescriptionโ TLD descriptioncreated_atโ Timestamp when the tld was createdupdated_atโ Timestamp when the tld was last updatedlinksโ Links contains a self pertaining to this tld or a next pertaining to next page
๐ธ openstack.dns.v2.zone ๐ธ
The Zone Class ๐ฆ
The DNS class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.zone.Zone(_synchronized=False, connection=None, **attrs)
DNS ZONE Resource ๐
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'zones'โ Plural form of key for resource.base_path = '/zones'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.commit_method = 'PATCH'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.actionโ Properties current action in progress on the resourceattributesโ Attributes Key:Value pairs of information about this zone, and the pool the user would like to place the zone in. This information can be used by the scheduler to place zones on the correct pool.created_atโ Timestamp when the zone was createddescriptionโ Zone description Type:stremailโ The administrator email of this zone Type:strlinksโ Links contains a self pertaining to this zone or a next pertaining to next pagemastersโ The master list for slaver server to fetch DNSnameโ Zone namepool_idโ The pool which manages the zone, assigned by systemproject_idโ The project id which the zone belongs toserialโ Serial number in the SOA record set in the zone, which identifies the change on the primary DNS server Type:intstatusโ Zone status Valid values includePENDING_CREATE,ACTIVE,PENDING_DELETE,ERRORttlโ SOA TTL time, unit is seconds, default300, TTL range300-2147483647Type:inttypeโ Zone type, Valid values includePRIMARY,SECONDARYType:strupdated_atโ Timestamp when the zone was last updatedis_sharedโ Whether the zone is shared with other projects Type:booldelete_sharesโ If true, delete any existing zone shares along with the zone
๐ openstack.dns.v2.zone_export ๐
The ZoneExport Class ๐
The DNS class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.zone_export.ZoneExport(_synchronized=False, connection=None, **attrs)
DNS Zone Exports Resource โจ
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = ''โ Singular form of key for resource.resources_key = 'exports'โ Plural form of key for resource.base_path = '/zones/tasks/export'โ The base part of the URI for this resource.create_optsโ Class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate().
create_opts = CreateOpts(request_key=None,
response_key=<Unset.UNSET: 'UNSET'>, method='POST',
requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.created_atโ Properties Timestamp when the zone was createdlinksโ Links contains a self pertaining to this zone or a next pertaining to next pagemessageโ Messagemetadataโ Returns thetotal_countof resources matching this filterproject_idโ The project id which the zone belongs tostatusโ Current status of the zone exportupdated_atโ Timestamp when the zone was last updatedversionโ Version of the resourcezone_idโ ID for the zone that was created by this export
๐ฆ openstack.dns.v2.zone_import ๐ฆ
The ZoneImport Class ๐
The DNS class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.zone_import.ZoneImport(_synchronized=False, connection=None, **attrs)
DNS Zone Import Resource ๐
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = ''โ Singular form of key for resource.resources_key = 'imports'โ Plural form of key for resource.base_path = '/zones/tasks/imports'โ The base part of the URI for this resource.create_optsโ Class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate().
create_opts = CreateOpts(request_key=None,
response_key=<Unset.UNSET: 'UNSET'>, method='POST',
requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.created_atโ Properties Timestamp when the zone was createdlinksโ Links contains a self pertaining to this zone or a next pertaining to next pagemessageโ Messagemetadataโ Returns thetotal_countof resources matching this filterproject_idโ The project id which the zone belongs tostatusโ Current status of the zone importupdated_atโ Timestamp when the zone was last updatedversionโ Version of the resourcezone_idโ ID for the zone that was created by this import
๐ openstack.dns.v2.zone_share ๐
The ZoneShare Class ๐ซถ
The DNS class inherits from Resource <#openstack.resource.Resource>.
class openstack.dns.v2.zone_share.ZoneShare(_synchronized=False, connection=None, **attrs)
DNS ZONE Share Resource ๐ฅ
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'shared_zones'โ Plural form of key for resource.base_path = '/zones/%(zone_id)s/shares'โ The base part of the URI for this resource.allow_create = Trueโ you can create this resource, yes ma'am โจallow_delete = Trueโ and you can yeet it too ๐allow_fetch = Trueโ get/fetch is allowed, go offallow_list = Trueโ listing? allowed, obviously ๐ซถzone_idโ the ID of the zone being shared, keeping it cute and identifiablecreated_atโ timestamp of when the share was created ๐updated_atโ timestamp of when the member was last updatedproject_idโ the project ID that owns the share, main character energy frtarget_project_idโ the target project ID that the zone is shared with
๐ฆ openstack.dns.v2.zone_transfer
The ZoneTransferRequest Class
okay so this DNS class inherits from Resource <#openstack.resource.Resource>, slay ๐
class openstack.dns.v2.zone_transfer.ZoneTransferRequest(_synchronized=False, connection=None, **attrs)
DNS Zone Transfer Request Resource โ that's the whole vibe. It's the base resource.
Parameters (yes, both of them, no skipping ๐)
_synchronizedโ bestie, do not use this directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead, okay?connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection(like in unit tests, iykyk). Any use ofself._connectioninResourcecode should protect itself with a check forNone.base_path = '/zones/tasks/transfer_requests'โ the base part of the URI for this resource, literallyresources_key = 'transfer_requests'โ plural form of the key for the resourceallow_create = Trueโ create is allowed โจallow_fetch = Trueโ fetch is allowedallow_delete = Trueโ delete is allowedallow_list = Trueโ list is allowedallow_commit = Trueโ update is allowed too, we love range ๐ฅdescriptionโ description. That's it. That's the description ๐target_project_idโ a project ID that the request will be limited to. No other project will be allowed to accept this request. Exclusive. Periodt ๐zone_nameโ name for the zone that's being exported
The ZoneTransferAccept Class
same deal, this DNS class inherits from Resource <#openstack.resource.Resource> ๐ง
class openstack.dns.v2.zone_transfer.ZoneTransferAccept(_synchronized=False, connection=None, **attrs)
DNS Zone Transfer Accept Resource โ the base resource ๐
Parameters
_synchronizedโ again, not for direct use. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.base_path = '/zones/tasks/transfer_accepts'โ the base part of the URI for this resourceresources_key = 'transfer_accepts'โ plural form of the key for the resourceallow_create = Trueโ create: allowed ๐ธallow_fetch = Trueโ fetch: allowedallow_list = Trueโ list: allowedzone_transfer_request_idโ name for the zone that's being exported (yes, that's what the doc says, no I'm not changing it ๐)
๐ Identity Resources
Identity v2 Resources
openstack.identity.v2.extension
The Extension Class
this Extension class inherits from Resource <#openstack.resource.Resource>, iconic โญ
class openstack.identity.v2.extension.Extension(_synchronized=False, connection=None, **attrs)
the base resource, as ever ๐ซถ
Parameters
_synchronizedโ nope, not meant for direct use. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an activeConnection(unit tests say hi). Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'extension'โ singular form of the key for the resourceresources_key = 'extensions'โ plural form of the key for the resourcebase_path = '/extensions'โ the base part of the URI for this resourceallow_list = Trueโ list is allowedallow_fetch = Trueโ fetch is allowedaliasโ a unique identifier which will be used for accessing the extension through a dedicated url/extensions/*alias*. The extension alias uniquely identifies an extension and is prefixed by a vendor identifier. Type:stringdescriptionโ a description of the extension. Type:stringlinksโ links to the documentation in various format. Type:stringnameโ the name of the extension. Type:stringnamespaceโ the second unique identifier of the extension after the alias. It's usually a URL which will be used. Example:http://docs.openstack.org/identity/api/ext/s3tokens/v1.0. Type:stringupdated_atโ the last time the extension has been modified (update date)
classmethod list(...) โ the big one ๐
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, headers=None, max_items=None, **params)
This method is a generator which yields resource objects ๐ It handles pagination and takes query params so you can filter your little heart out.
Parameters
sessionโ the session to use for making this requestpaginatedโTrueif a GET to this resource returns a paginated series of responses, orFalseif a GET returns only one page of data. WhenpaginatedisFalseonly one page of data will be returned, regardless of whether the API supports pagination. no cap.base_pathโ base part of the URI for listing resources, if it's different frombase_path<#openstack.resource.Resource.base_path>allow_unknown_paramsโTrueto accept but discard unknown query parameters. This lets you get a list of 'filters' and pass everything known to the server.Falsewill result in a validation exception when unknown query parameters are passed ๐ญmicroversionโ API version to override the negotiated oneheadersโ additional headers to inject into the HTTP requestmax_itemsโ the maximum number of items to return. Typically this must be used withpaginated=True.paramsโ these keyword arguments get passed through the_transpose()method to find if any of them match expected query parameters to be sent in theparamsargument toget(). They're additionally checked against thebase_path<#openstack.resource.Resource.base_path> format string to see if any path fragments need to be filled in by the contents of this argument. Parameters supported as filters by the server side are passed in the API call, and the remaining parameters are applied as filters to the retrieved results. chef's kiss ๐
Returns โ a generator of Resource objects โจ
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_list is not set to True.
Raises InvalidResourceQuery <#openstack.exceptions.InvalidResourceQuery> if the query contains invalid params.
openstack.identity.v2.role
The Role Class
the Role class inherits from Resource <#openstack.resource.Resource>, your honor ๐
class openstack.identity.v2.role.Role(_synchronized=False, connection=None, **attrs)
the base resource, again, always ๐
Parameters
_synchronizedโ please do not use directly, bestie. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, e.g. in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'role'โ singular form of the key for the resourceresources_key = 'roles'โ plural form of the key for the resourcebase_path = '/OS-KSADM/roles'โ the base part of the URI for this resource, exactly like that, don't touch it ๐allow_create = Trueโ create: allowedallow_fetch = Trueโ fetch: allowedallow_commit = Trueโ update: allowedallow_delete = Trueโ delete: allowedallow_list = Trueโ list: alloweddescriptionโ the description of the role. Type:string
Okay, finishing the role fields real quick:
is_enabledโ set this attribute toFalseand this role is literally not available in the role list anymore. Type:boolnameโ unique role name, no duplicates bestie. Type:string
๐ openstack.identity.v2.tenant โ The Tenant Class
The Tenant class inherits from Resource, as it should.
class openstack.identity.v2.tenant.Tenant(_synchronized=False, connection=None, **attrs)
This is the base resource.
Parameters
_synchronizedโ not intended to be used directly, bestie. Seenew()andexisting()for the actual moves.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection, like in unit tests. If you're usingself._connectioninResourcecode, protect it with a check forNone. Periodt.resource_key = 'tenant'โ singular form of the key for this resource.resources_key = 'tenants'โ plural form of the key for this resource.base_path = '/tenants'โ the base part of the URI for this resource.allow_create = Trueโ create operation is allowed for this resource.allow_fetch = Trueโ get operation is allowed for this resource.allow_commit = Trueโ update operation is allowed for this resource.allow_delete = Trueโ delete operation is allowed for this resource.allow_list = Trueโ list operation is allowed for this resource.descriptionโ the description of the tenant. Type:stringis_enabledโ setting this attribute toFalseprevents users from authorizing against this tenant. Also, all pre-existing tokens authorized for the tenant are immediately invalidated. Re-enabling a tenant does not re-enable those pre-existing tokens, so don't think you can just flip it back and pretend nothing happened. Type:boolnameโ unique tenant name. Type:string
๐ฆ openstack.identity.v2.user โ The User Class
The User class inherits from Resource, naturally.
class openstack.identity.v2.user.User(_synchronized=False, connection=None, **attrs)
This is the base resource.
Parameters
_synchronizedโ not for direct use, bestie. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can work without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with aNonecheck.resource_key = 'user'โ singular form of the key for this resource.resources_key = 'users'โ plural form of the key for this resource.base_path = '/users'โ the base part of the URI for this resource.allow_create = Trueโ create operation is allowed for this resource.allow_fetch = Trueโ get operation is allowed for this resource.allow_commit = Trueโ update operation is allowed for this resource.allow_delete = Trueโ delete operation is allowed for this resource.allow_list = Trueโ list operation is allowed for this resource.emailโ the email of this user. Type:stringis_enabledโ setting this value toFalseprevents the user from authenticating or receiving authorization. Also, all pre-existing tokens held by the user are immediately invalidated. Re-enabling a user does not re-enable pre-existing tokens. Type:boolnameโ the name of this user. Type:string
๐ Identity v3 Resources
๐ openstack.identity.v3.application_credential โ The ApplicationCredential Class
The ApplicationCredential class inherits from Resource.
class openstack.identity.v3.application_credential.ApplicationCredential(_synchronized=False, connection=None, **attrs)
This is the base resource.
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'application_credential'โ singular form of the key for this resource.resources_key = 'application_credentials'โ plural form of the key for this resource.base_path = '/users/%(user_id)s/application_credentials'โ the base part of the URI for this resource.allow_create = Trueโ create operation is allowed for this resource.allow_fetch = Trueโ get operation is allowed for this resource.allow_commit = Trueโ update operation is allowed for this resource.allow_delete = Trueโ delete operation is allowed for this resource.allow_list = Trueโ list operation is allowed for this resource.user_idโ user ID using the application credential. Type:stringuserโ user object using the application credential. Type:stringlinksโ the links for the application credential resource.nameโ name of the user. Type:stringdescriptionโ description of the application credential's purpose. Type:stringexpires_atโ expire time of the application credential. Type:stringrolesโ roles of the user. Type:listunrestrictedโ restricts the application credential. Type:booleanproject_idโ ID of project. Type:stringaccess_rulesโ access rules for the application credential. Type:list
๐ฅ openstack.identity.v3.credential โ The Credential Class
The Credential class inherits from Resource.
class openstack.identity.v3.credential.Credential(_synchronized=False, connection=None, **attrs)
This is the base resource.
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'credential'โ singular form of the key for this resource.resources_key = 'credentials'โ plural form of the key for this resource.base_path = '/credentials'โ the base part of the URI for this resource.allow_create = Trueโ create operation is allowed for this resource.allow_fetch = Trueโ get operation is allowed for this resource.allow_commit = Trueโ update operation is allowed for this resource.allow_delete = Trueโ delete operation is allowed for this resource.allow_list = Trueโ list operation is allowed for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.blobโ arbitrary blob of the credential data, to be parsed according to the type. Type:stringproject_idโ references a project ID which limits the scope the credential applies to. This attribute is mandatory if the credential type isec2. Type:stringtypeโ representing the credential type, such asec2orcert. A specific implementation may determine the list of supported types. Type:stringuser_idโ references the user ID which owns the credential. Type:string
๐ openstack.identity.v3.domain โ The Domain Class
The Domain class inherits from Resource.
class openstack.identity.v3.domain.Domain(_synchronized=False, connection=None, **attrs)
This is the base resource.
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'domain'โ singular form of the key for this resource.resources_key = 'domains'โ plural form of the key for this resource.base_path = '/domains'โ the base part of the URI for this resource.allow_create = Trueโ create operation is allowed for this resource.allow_fetch = Trueโ get operation is allowed for this resource.allow_commit = Trueโ update operation is allowed for this resource.allow_delete = Trueโ delete operation is allowed for this resource.allow_list = Trueโ list operation is allowed for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.descriptionโ the description of this domain. Type:stringis_enabledโ set this toFalseand likeโฆ users can't authorize against this domain or any project it owns, and users owned by the domain can't authenticate or get any other authorization, periodt. And bestie, hear me: every pre-existing token that applies to all those entities gets immediately invalidated. Re-enabling the domain does not bring those old tokens back. Type:bool๐optionsโ the resource options for the project. Heads up: available resource options are immutable. Not me trying to change them ๐linksโ the links related to the domain resource. โจassign_role_to_user(session, user, role, inherited)โ assign role to user on domain. Slay, give them the role ๐validate_user_has_role(session, user, role, inherited)โ validates that a user has a role on a domain. The vibe check, but for permissions ๐ซถunassign_role_from_user(session, user, role, inherited)โ unassigns a role from a user on a domain. Revoking rights, we hate to see it but we respect it ๐ญassign_role_to_group(session, group, role, inherited)โ assign role to group on domain. Group chat gets the power ๐validate_group_has_role(session, group, role, inherited)โ validates that a group has a role on a domain. Checking receipts on the group's permissions ๐งพunassign_role_from_group(session, group, role, inherited)โ unassigns a role from a group on a domain. Taking it back, no hard feelings โจ
๐ฆ openstack.identity.v3.domain_config
The Domain Class
The DomainConfig class inherits from Resource <#openstack.resource.Resource>. Family tree is giving legacy, honestly.
class openstack.identity.v3.domain_config.DomainConfig(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ literally not meant to be used directly, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneso thatResourceobjects can be used without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. Stay safe out there ๐ซถresource_key = 'config'โ singular form of key for resource.base_path = '/domains/%(domain_id)s/config'โ the base part of the URI for this resource ๐requires_id = Falseโ do calls for this resource require an ID? Nope, bestie, not this one.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. The way it has to be PATCH, no cap.create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='PUT', requires_id=False, response_has_body=True)โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate(). Iconic inheritance behaviour honestly ๐allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.domain_idโ the domain ID.identityโ an identity object โจldapโ the config object.
๐ธ openstack.identity.v3.endpoint
The Endpoint Class
The Endpoint class inherits from Resource <#openstack.resource.Resource>. Bestie, this one does have an ID.
class openstack.identity.v3.endpoint.Endpoint(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, periodt. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'endpoint'โ singular form of key for resource.resources_key = 'endpoints'โ plural form of key for resource. Plural era ๐base_path = '/endpoints'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. Yes, you can see them all ๐commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.interfaceโ describes the interface of the endpoint according to one of the following values:public: intended for consumption by end users, generally on a publicly available network interface ๐internal: not intended for consumption by end users, generally on an unmetered internal network interface ๐admin: intended only for consumption by those needing administrative access to the service, generally on a secure network interface ๐
Type: string
is_enabledโ setting this value toFalseprevents the endpoint from appearing in the service catalog. Type:bool. Ghosting the catalog, honestly ๐linksโ the links for the region resource.region_idโ represents the containing region ID of the service endpoint. New in v3.2. Type:stringโจservice_idโ references the service ID to which the endpoint belongs. Type:stringurlโ fully qualified URL of the service endpoint. Type:string๐
๐ง openstack.identity.v3.federation_protocol
The FederationProtocol Class
The FederationProtocol class inherits from Resource <#openstack.resource.Resource>. Long class name, long vibes.
class openstack.identity.v3.federation_protocol.FederationProtocol(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ nope, don't touch it directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'protocol'โ singular form of key for resource.resources_key = 'protocols'โ plural form of key for resource.base_path = '/OS-FEDERATION/identity_providers/%(idp_id)s/protocols'โ the base part of the URI for this resource. Look at that path, it's giving โจfederationโจallow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='PUT', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate(). ๐commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.nameโ name of the protocol (read only). Type:string. Read only, so don't even try it bestie ๐
๐ openstack.identity.v3.group
The Group Class
The Group class inherits from Resource <#openstack.resource.Resource>. Group chat but make it IAM.
class openstack.identity.v3.group.Group(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, fr fr. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'group'โ singular form of key for resource.resources_key = 'groups'โ plural form of key for resource.base_path = '/groups'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.descriptionโ the description of this group. Type:stringโจdomain_idโ references the domain ID which owns the group; if a domain ID is not specified by the client, the Identity service implementation will default it to the domain ID to which the client's token is scoped. Type:string. It just picks one for you, main character energy ๐nameโ unique group name, within the owning domain. Type:string๐ธadd_user(session, user)โ adds that user to the group, simple as ๐remove_user(session, user)โ yeets the user out of the groupcheck_user(session, user)โ asks the vibes question: does this user actually belong to this group? ๐ต๏ธโโ๏ธ
The UserGroup Class
So UserGroup is a subclass of Group โ it inherits all the group energy and just does its own thing. It's the the user is in the group resource, iykyk ๐
class openstack.identity.v3.group.UserGroup(_synchronized=False,
connection=None, **attrs)
The base resource โ every resource in this library starts from here, it's giving founding mother ๐ซถ
Parameters
- _synchronized โ bestie, this is not meant to be used directly. Go look at
new()andexisting()instead (#openstack.resource.Resource.new,#openstack.resource.Resource.existing). - connection โ a reference to the
Connectionbeing used. It defaults toNoneso you can useResourceobjects with no activeConnectionat all, like in unit tests. Any code insideResourcethat touchesself._connectionshould protect itself with a check forNone. Ngl, guard your heart (and your attributes) ๐
base_path = '/users/%(user_id)s/groups' โ the base part of the URI for this resource.
user_id โ the ID for the user, pulled straight out of the URI of the resource.
allow_create = False โ creation? not allowed, we don't do that here ๐
โโ๏ธ
allow_fetch = False โ get operation? also no.
allow_commit = False โ update? nope.
allow_delete = False โ delete? absolutely not.
allow_list = True โ but listing? oh we slay, that one's allowed โจ
openstack.identity.v3.identity_provider
The IdentityProvider Class
The IdentityProvider class inherits from Resource (#openstack.resource.Resource) โ 10/10 lineage, no notes.
class openstack.identity.v3.identity_provider.IdentityProvider(_synchronized=False,
connection=None, **attrs)
The base resource โจ
Parameters
- _synchronized โ do not use this directly, seriously. Peep
new()andexisting()(#openstack.resource.Resource.new,#openstack.resource.Resource.existing). - connection โ reference to the
Connectionin play. Defaults toNonesoResourceobjects work without an activeConnection(hello unit tests ๐). Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = 'identity_provider' โ the singular form of the key for this resource.
resources_key = 'identity_providers' โ the plural form, because plurals are a whole vibe now ๐
base_path = '/OS-FEDERATION/identity_providers' โ the base part of the URI for this resource.
allow_create = True โ create: yes ๐
allow_fetch = True โ get: yes.
allow_commit = True โ update: yes.
allow_delete = True โ delete: yes.
allow_list = True โ list: yes. All five ate, no crumbs ๐
create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='PUT', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True) โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create() โ iconic design choice honestly ๐
commit_method = 'PATCH' โ the method used for committing a resource. It must be PATCH if allow_patch is True. Don't test it, just respect it ๐
description โ a description of this identity provider. Type: string.
is_enabled โ whether the identity provider is currently enabled. Type: bool.
remote_ids โ remote IDs associated with the identity provider. Type: list.
authorization_ttl โ the length of validity in minutes for group memberships. Type: int.
name โ the identifier of the identity provider (read only). Type: string.
openstack.identity.v3.limit
The Limit Class
The Limit class inherits from Resource (#openstack.resource.Resource) โ limits! boundaries! structure! we love a resource with self-respect ๐
class openstack.identity.v3.limit.Limit(_synchronized=False,
connection=None, **attrs)
The base resource ๐ซถ
Parameters
- _synchronized โ not for direct use, bestie. See
new()andexisting()(#openstack.resource.Resource.new,#openstack.resource.Resource.existing). - connection โ reference to the
Connectionbeing used. Defaults toNonesoResourceobjects work without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = 'limit' โ singular form of key for resource.
resources_key = 'limits' โ plural form of key for resource.
base_path = '/limits' โ the base part of the URI for this resource.
allow_create = True โ create operation: allowed โจ
allow_fetch = True โ get operation: allowed.
allow_commit = True โ update operation: allowed.
allow_delete = True โ delete operation: allowed.
allow_list = True โ list operation: allowed. Full house, we love to see it ๐
commit_method = 'PATCH' โ the method for committing a resource. This must be PATCH if allow_patch is True.
create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key='limits', method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True) โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create(). Note the response_key='limits' and method='POST' โ very much on purpose ๐ฅ
domain_id โ the ID of the domain. Type: string.
description โ user-facing description of the registered_limit. Type: string.
links โ the links for the registered_limit resource.
service_id โ ID of service. Type: string.
region_id โ ID of region, if any. Type: string. (The "if any" is doing a lot of emotional labour there ๐ญ)
resource_name โ the resource name. Type: string.
resource_limit โ the resource limit value. Type: int.
project_id โ ID of project. Type: string.
openstack.identity.v3.mapping
The Mapping Class
The Mapping class inherits from Resource (#openstack.resource.Resource) โ mappings, the federated identity girlies' best friend ๐ง
class openstack.identity.v3.mapping.Mapping(_synchronized=False,
connection=None, **attrs)
The base resource โญ
Parameters
- _synchronized โ please do not use this directly, it's not that kind of parameter. See
new()andexisting()(#openstack.resource.Resource.new,#openstack.resource.Resource.existing). - connection โ reference to the
Connectionbeing used. Defaults toNoneto letResourceobjects exist without an activeConnection, e.g. in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = 'mapping' โ singular form of key for resource.
resources_key = 'mappings' โ plural form of key for resource.
base_path = '/OS-FEDERATION/mappings' โ the base part of the URI for this resource.
allow_create = True โ create: yes ๐ธ
allow_fetch = True โ get: yes.
allow_commit = True โ update: yes.
allow_delete = True โ delete: yes.
allow_list = True โ list: yes. All of them green, we're thriving ๐ฑ
create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='PUT', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True) โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create().
commit_method = 'PATCH' โ method for committing a resource. This must be PATCH if allow_patch is True.
rules โ the rules of this mapping. Type: list. The rules! we live by them ๐
schema_version โ the attribute mapping schema version. Type: string.
name โ the identifier of the mapping. Type: string.
openstack.identity.v3.policy
The Policy Class
The Policy class inherits from Resource (#openstack.resource.Resource) โ policies, the main character energy of access control ๐
class openstack.identity.v3.policy.Policy(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
- _synchronized โ not intended for direct use. See
new()andexisting()(#openstack.resource.Resource.new,#openstack.resource.Resource.existing). - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resource_key = 'policy' โ singular form of key for resource.
resources_key = 'policies' โ plural form of key for resource.
base_path = '/policies' โ the base part of the URI for this resource.
allow_create = True โ create operation: allowed ๐
allow_fetch = True โ get operation: allowed.
allow_commit = True โ update operation: allowed.
allow_delete = True โ delete operation: allowed.
allow_list = True โ list operation: allowed. Every flag set to True, periodt โจ
commit_method = 'PATCH' โ method for committing a resource. This must be PATCH if allow_patch is True.
blobโ the policy rule set itself, as a serialized blob. Type:stringโจlinksโ the links for the policy resource ๐project_idโ the ID for the project ๐ซถtypeโ the MIME Media Type of the serialized policy blob. Type:string๐user_idโ the ID of the user who owns the policy ๐
๐ธ openstack.identity.v3.project
๐ซถ The Project Class
The Project class inherits from Resource <#openstack.resource.Resource>. Bestie, it's giving "whole project energy" and honestly? Iconic. ๐
class openstack.identity.v3.project.Project(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐งชresource_key = 'project'โ singular form of key for resource ๐resources_key = 'projects'โ plural form of key for resource ๐base_path = '/projects'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ allow create operation for this resource โallow_fetch = Trueโ allow get operation for this resource โallow_commit = Trueโ allow update operation for this resource โallow_delete = Trueโ allow delete operation for this resource โallow_list = Trueโ allow list operation for this resource โcommit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. ๐descriptionโ the description of the project. Type:string๐domain_idโ references the domain ID which owns the project; if a domain ID is not specified by the client, the Identity service implementation will default it to the domain ID to which the client's token is scoped. Type:string๐is_domainโ indicates whether the project also acts as a domain. If set toTrue, the project acts as both a project and a domain. Default isFalse. New in version 3.6 โจis_enabledโ setting this attribute toFalseprevents users from authorizing against this project. Additionally, all pre-existing tokens authorized for the project are immediately invalidated. Re-enabling a project does not re-enable pre-existing tokens. Type:boolโ ๏ธoptionsโ the resource options for the project. Available resource options are immutable. ๐parent_idโ the ID of the parent of the project. New in version 3.4 ๐งฌlinksโ the links related to the project resource ๐assign_role_to_user(session, user, role, inherited)โ assign role to user on project ๐validate_user_has_role(session, user, role, inherited)โ validates that a user has a role on a project โunassign_role_from_user(session, user, role, inherited)โ unassigns a role from a user on a project โassign_role_to_group(session, group, role, inherited)โ assign role to group on project ๐ฅvalidate_group_has_role(session, group, role, inherited)โ validates that a group has a role on a project โunassign_role_from_group(session, group, role, inherited)โ unassigns a role from a group on a project โassociate_endpoint(session, endpoint_id)โ associate endpoint with project. ๐ซถ
Parameters
sessionโ The session to use for making this request.endpoint_idโ The ID of an endpoint.
Returns
None
disassociate_endpoint(session, endpoint_id)โ disassociate endpoint from project. ๐
Parameters
sessionโ The session to use for making this request.endpoint_idโ The ID of an endpoint.
Returns
None
๐ฆ openstack.identity.v3.region
๐ The Region Class
The Region class inherits from Resource <#openstack.resource.Resource>. Regional queen behavior, no cap. ๐
class openstack.identity.v3.region.Region(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐งชresource_key = 'region'โ singular form of key for resource ๐resources_key = 'regions'โ plural form of key for resource ๐base_path = '/regions'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ allow create operation for this resource โallow_fetch = Trueโ allow get operation for this resource โallow_commit = Trueโ allow update operation for this resource โallow_delete = Trueโ allow delete operation for this resource โallow_list = Trueโ allow list operation for this resource โcommit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. ๐descriptionโ user-facing description of the region. Type:string๐linksโ the links for the region resource ๐parent_region_idโ ID of parent region, if any. Type:string๐งฌ
๐ openstack.identity.v3.registered_limit
๐ The RegisteredLimit Class
The RegisteredLimit class inherits from Resource <#openstack.resource.Resource>. Limits? Registered. Vibes? Immaculate. โจ
class openstack.identity.v3.registered_limit.RegisteredLimit(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐งชresource_key = 'registered_limit'โ singular form of key for resource ๐resources_key = 'registered_limits'โ plural form of key for resource ๐base_path = '/registered_limits'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ allow create operation for this resource โallow_fetch = Trueโ allow get operation for this resource โallow_commit = Trueโ allow update operation for this resource โallow_delete = Trueโ allow delete operation for this resource โallow_list = Trueโ allow list operation for this resource โcommit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. ๐create_optsโCreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key='registered_limits', method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True). Class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate(). ๐ ๏ธdescriptionโ user-facing description of theregistered_limit. Type:string๐linksโ the links for theregistered_limitresource ๐service_idโ ID of service. Type:string๐๏ธregion_idโ ID of region, if any. Type:string๐resource_nameโ the resource name. Type:string๐ท๏ธdefault_limitโ the default limit value. Type:int๐ข
๐ธ openstack.identity.v3.role
๐ The Role Class
The Role class inherits from Resource <#openstack.resource.Resource>. It's giving main-character permissions, fr fr. ๐
class openstack.identity.v3.role.Role(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ This is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. ๐connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐งชresource_key = 'role'โ singular form of key for resource ๐resources_key = 'roles'โ plural form of key for resource ๐base_path = '/roles'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ allow create operation for this resource โallow_fetch = Trueโ allow get operation for this resource โallow_commit = Trueโ allow update operation for this resource โallow_delete = Trueโ allow delete operation for this resource โallow_list = Trueโ allow list operation for this resource โcommit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. ๐nameโ the role's unique name, scoped inside the domain that owns it. Type:stringdescriptionโ the user-facing description of the role. Type:stringdomain_idโ references the domain ID that owns the role. Type:stringoptionsโ the resource options for the role. Heads up bestie: the available resource options are immutable, so no take-backsies. ๐ซถlinksโ the links for the service resource.
openstack.identity.v3.role_assignment
The RoleAssignment Class โจ
The RoleAssignment class inherits from Resource <#openstack.resource.Resource>.
class openstack.identity.v3.role_assignment.RoleAssignment(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ nope, don't touch this one directly, it's not meant to be used like that. Peepnew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>instead.connectionโ a reference to theConnectionbeing used. Defaults toNoneso you can makeResourceobjects without an activeConnection(think unit tests, iconic behaviour). Any use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'role_assignment'โ singular form of key for resource.resources_key = 'role_assignments'โ plural form of key for resource.base_path = '/role_assignments'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.linksโ the links for the service resource.roleโ the role (dictionary contains onlyid).scopeโ the scope (either domain or project; dictionary contains onlyid).userโ the user (dictionary contains onlyid).groupโ the group (dictionary contains onlyid).
openstack.identity.v3.role_domain_group_assignment
The RoleDomainGroupAssignment Class ๐ฆ
The RoleDomainGroupAssignment class inherits from Resource <#openstack.resource.Resource>.
class openstack.identity.v3.role_domain_group_assignment.RoleDomainGroupAssignment(_synchronized=False,
connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ again, not for direct use, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an activeConnection, like in unit tests. Code that usesself._connectionshould guard with aNonecheck.
resource_key = 'role'โ singular form of key for resource.resources_key = 'roles'โ plural form of key for resource.base_path = '/domains/%(domain_id)s/groups/%(group_id)s/roles'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.nameโ name of the role. Type:stringlinksโ the links for the service resource.domain_idโ the ID of the domain to list assignment from. Type:stringgroup_idโ the ID of the group to list assignment from. Type:string
openstack.identity.v3.role_domain_user_assignment
The RoleDomainUserAssignment Class ๐
The RoleDomainUserAssignment class inherits from Resource <#openstack.resource.Resource>.
class openstack.identity.v3.role_domain_user_assignment.RoleDomainUserAssignment(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ do not use directly, fr fr. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection, like in unit tests.self._connectionusage inside Resource code should protect itself with aNonecheck.
resource_key = 'role'โ singular form of key for resource.resources_key = 'roles'โ plural form of key for resource.base_path = '/domains/%(domain_id)s/users/%(user_id)s/roles'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.nameโ name of the role. Type:stringlinksโ the links for the service resource.domain_idโ the ID of the domain to list assignment from. Type:stringuser_idโ the ID of the user to list assignment from. Type:string
openstack.identity.v3.role_project_group_assignment
The RoleProjectGroupAssignment Class ๐ธ
The RoleProjectGroupAssignment class inherits from Resource <#openstack.resource.Resource>.
class openstack.identity.v3.role_project_group_assignment.RoleProjectGroupAssignment(_synchronized=False,
connection=None, **attrs)
The base resource โญ
Parameters
_synchronizedโ not meant to be used directly, okay? Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, e.g. in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'role'โ singular form of key for resource.resources_key = 'roles'โ plural form of key for resource.base_path = '/projects/%(project_id)s/groups/%(group_id)s/roles'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.nameโ name of the role. Type:stringlinksโ the links for the service resource.project_idโ the ID of the project to list assignment from. Type:stringgroup_idโ the ID of the group to list assignment from. Type:string
openstack.identity.v3.role_project_user_assignment
The RoleProjectUserAssignment Class ๐ง
The RoleProjectUserAssignment class inherits from Resource <#openstack.resource.Resource>.
class openstack.identity.v3.role_project_user_assignment.RoleProjectUserAssignment(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this one's not for direct use, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'role'โ singular form of key for resource.resources_key = 'roles'โ plural form of key for resource.base_path = '/projects/%(project_id)s/users/%(user_id)s/roles'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.nameโ name of the role. Type:stringlinksโ the links for the service resource.project_idโ the ID of the project to list assignment from. Type:stringuser_idโ the ID of the user to list assignment from. Type:string
openstack.identity.v3.role_system_group_assignment
The RoleSystemGroupAssignment Class ๐ฅ
The RoleSystemGroupAssignment class inherits from Resource <#openstack.resource.Resource>.
class openstack.identity.v3.role_system_group_assignment.RoleSystemGroupAssignment(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ no direct use, ngl. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'role'โ singular form of key for resource.resources_key = 'roles'โ plural form of key for resource.base_path = '/system/groups/%(group_id)s/roles'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.group_idโ the ID of the group to list assignment from. Type:stringsystem_idโ the name of the system to list assignment from. Type:string
openstack.identity.v3.role_system_user_assignment
The RoleSystemUserAssignment Class ๐ฆ
The RoleSystemUserAssignment class inherits from Resource <#openstack.resource.Resource>.
class openstack.identity.v3.role_system_user_assignment.RoleSystemUserAssignment(_synchronized=False,
connection=None, **attrs)
The base resource ๐ซ
Parameters
_synchronizedโ not intended to be used directly, periodt. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'role'โ singular form of key for resource.allow_list = Trueโ allow the list operation for this resource โจbase_path = '/system/users/%(user_id)s/roles'โ the base part of the URI for this resource ๐resources_key = 'roles'โ the plural form of the key for the resource ๐allow_list = Trueโ allow the list operation for this resource โจsystem_idโ the name of the system to list assignment from. Type: stringuser_idโ the ID of the user to list assignment from. Type: string
๐ openstack.identity.v3.service
๐ The Service Class
okay so the Service class inherits from Resource (that's <#openstack.resource.Resource> bestie, keep up ๐ซถ).
class openstack.identity.v3.service.Service(_synchronized=False,
connection=None, **attrs)
The base resource ๐ธ
Parameters โ the deets ๐
_synchronizedโ literally not meant to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>) instead ๐connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests ngl. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'service'โ the singular form of the key for the resourceresources_key = 'services'โ the plural form of the key for the resourcebase_path = '/services'โ the base part of the URI for this resource ๐ฆallow_create = Trueโ allow the create operation for this resource โจallow_fetch = Trueโ allow the get operation for this resource โจallow_commit = Trueโ allow the update operation for this resource โจallow_delete = Trueโ allow the delete operation for this resource โจallow_list = Trueโ allow the list operation for this resource โจcommit_method = 'PATCH'โ the method for committing a resource. This must bePATCHifallow_patchisTrue๐descriptionโ user-facing description of the service. Type: stringis_enabledโ setting this value toFalseprevents the service and its endpoints from appearing in the service catalog. Type: boollinksโ the links for the service resourcenameโ user-facing name of the service. Type: stringtypeโ describes the API implemented by the service. The following values are recognized within the OpenStack ecosystem:compute,image,ec2,identity,volume,network. To support non-core and future projects, the value should not be validated against this list. Type: string ๐ฅ
๐ฆ openstack.identity.v3.system
๐ The System Class
the System class inherits from Resource (<#openstack.resource.Resource>), obviously ๐
class openstack.identity.v3.system.System(_synchronized=False,
connection=None, **attrs)
The base resource ๐ธ
Parameters โ again, the essentials ๐
_synchronizedโ not intended to be used directly, periodt. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>)connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'system'โ the singular form of the key for the resourcebase_path = '/system'โ the base part of the URI for this resource ๐assign_role_to_user(session, user, role)โ assign role to user on system โจvalidate_user_has_role(session, user, role)โ validates that a user has a role on a system ๐unassign_role_from_user(session, user, role)โ unassigns a role from a user on a system ๐assign_role_to_group(session, group, role)โ assign role to group on system โจvalidate_group_has_role(session, group, role)โ validates that a group has a role on a system ๐unassign_role_from_group(session, group, role)โ unassigns a role from a group on a system ๐
๐ openstack.identity.v3.token
โญ The Token Class
the Token class inherits from Resource (<#openstack.resource.Resource>) ๐ซถ
class openstack.identity.v3.token.Token(_synchronized=False,
connection=None, **attrs)
The base resource ๐ธ
Parameters ๐
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>)connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'token'โ the singular form of the key for the resourcebase_path = '/auth/tokens'โ the base part of the URI for this resource ๐ฅallow_fetch = Falseโ allow get operation for this resourceallow_delete = Falseโ allow delete operation for this resourceallow_list = Falseโ allow list operation for this resourceallow_head = Falseโ allow head operation for this resource ๐subject_tokenโ an authentication token. This is used rather thanX-Auth-Tokento allow users to check or revoke a token other than their own ๐audit_idsโ a list of one or two audit IDs. An audit ID is a unique, randomly generated, URL-safe string that you can use to track a token. The first audit ID is the current audit ID for the token. The second audit ID is present for only re-scoped tokens and is the audit ID from the token before it was re-scoped. A re-scoped token is one that was exchanged for another token of the same or different scope. You can use these audit IDs to track the use of a token or chain of tokens across multiple requests and endpoints without exposing the token ID to non-privileged users ๐ super useful nglcatalogโ the service catalog ๐ฆexpires_atโ the date and time when the token expiresissued_atโ the date and time when the token was issuedmethodsโ the authentication methoduserโ the user that owns the tokenprojectโ the project that the token is scoped to, if anydomainโ the domain that the token is scoped to, if anyis_domainโ whether the project, if set, is acting as a domainsystemโ the parts of the system the token is scoped to, if system-scopedrolesโ the roles associated with the user ๐
๐ธ openstack.identity.v3.trust
๐ง The Trust Class
the Trust class inherits from Resource (<#openstack.resource.Resource>) ๐ซถ
class openstack.identity.v3.trust.Trust(_synchronized=False,
connection=None, **attrs)
The base resource ๐
Parameters ๐
_synchronizedโ not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>)connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'trust'โ the singular form of the key for the resourceresources_key = 'trusts'โ the plural form of the key for the resourcebase_path = '/OS-TRUST/trusts'โ the base part of the URI for this resource โจallow_create = Trueโ allow create operation for this resource โจallow_fetch = Trueโ allow get operation for this resource โจallow_delete = Trueโ allow delete operation for this resource โจallow_list = Trueโ allow list operation for this resource โจallow_redelegationโ a boolean indicating whether the trust can be issued by the trustee as a regulart trust. Default isFalse๐ (yes bestie, "regulart" is exactly what the original says, don't come for me ๐)expires_atโ specifies the expiration time of the trust. A trust may be revoked ahead of expiration. If the value represents a time in the past, the trust is deactivated โฐis_impersonationโ if impersonation is set totrue, then the user attribute of tokens that are generated based on the trust will represent that of the trustor rather than the trustee, thus allowing the trustee to impersonate the trustor. If impersonation is set toFalse, then the token's user attribute will represent that of the trustee. Type: bool ๐linksโ links for the trust resourceproject_idโ ID of the project upon which the trustor is delegating authorization. Type: stringrole_linksโ a role links object that includes'next','previous', and self links for roles ๐rolesโ specifies the subset of the trustor's roles on theproject_idto be granted to the trustee when the token is consumed. The trustor must already be granted these roles in the project referenced by theproject_idattribute. Type: list ๐redelegated_trust_idโ returned with redelegated trust provides information about the predecessor in the trust chain ๐ฆredelegation_countโ redelegation count ๐ขremaining_usesโ how many times this trust can be used to get a token. Every time a token gets issued through the trust, the value goes down. Once it hits zero, no more tokens get issued through the trust. That's the whole vibe.trustee_user_idโ the user ID of the person who can actually consume the trust. Type:stringtrustor_user_idโ the user ID of the person who created the trust and whose authorization is being delegated. Type:string
โจ openstack.identity.v3.user โจ
๐ The User Class ๐
The User class inherits from Resource (openstack.resource.Resource). Iconic.
class openstack.identity.v3.user.User(_synchronized=False,
connection=None, **attrs)
The base resource. Constructor params, bestie:
_synchronizedโ not meant to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection, like in unit tests. IfResourcecode usesself._connection, it should guard with aNonecheck.resource_key = 'user'โ singular form of the key for this resource.resources_key = 'users'โ plural form of the key for this resource.base_path = '/users'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue.default_project_idโ references the user's default project ID to authorize against, if the API user doesn't explicitly specify one when creating a token. Setting this attribute does not grant any actual authorization on the project โ it's just there for the user's convenience. So yes, the referenced project doesn't even need to exist within the user's domain. New in version 3.1: if the user doesn't have authorization to their default project, the default project gets ignored at token creation. Type:stringdescriptionโ the description of this user. Type:stringdomain_idโ references the domain ID that owns the user. If the client doesn't specify a domain ID, the Identity service implementation defaults it to the domain ID the client's token is scoped to. Type:stringemailโ the email of this user. Type:stringis_enabledโ setting this toFalsestops the user from authenticating or receiving authorization. Also, every pre-existing token held by the user is immediately invalidated. Re-enabling the user does not re-enable those pre-existing tokens. Type:boollinksโ the links for the user resource.nameโ unique user name within the owning domain. Type:stringpasswordโ the default form of credential used during authentication. Type:stringpassword_expires_atโ the date and time when the password expires. Time zone is UTC. ANonevalue means the password never expires.
This is a response object attribute, not valid for requests. New in version 3.7.
federatedโ list of federated identity mappings associated with the user. Each item containsidp_idandprotocols(a list of objects withprotocol_idandunique_id). New in version 3.14.optionsโ a dictionary of the user's extra options.update_password(session, current_password, password)โ update the password for this user. Params:sessionโ the session to use for the request.current_password(str) โ the user's current password.password(str) โ the user's new password.
๐ Other Resources ๐
๐ openstack.identity.version ๐
The Version Class
The Version class inherits from Resource (openstack.resource.Resource). Slay.
class openstack.identity.version.Version(_synchronized=False,
connection=None, **attrs)
The base resource. Params:
_synchronizedโ not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'version'โ singular form of the key for this resource.resources_key = 'versions'โ plural form of the key for this resource.base_path = '/'โ the base part of the URI for this resource.allow_list = Trueโ allow list operation for this resource.
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, headers=None, **params)
This method is a generator that yields resource objects. It handles pagination and takes query params for response filtering. Params:
sessionโ the session to use for making this request.paginatedโTrueif a GET to this resource returns a paginated series of responses, orFalseif a GET returns only one page of data. WhenpaginatedisFalse, only one page of data will be returned regardless of the API's support of pagination.base_pathโ base part of the URI for listing resources, if different frombase_path(openstack.resource.Resource.base_path).allow_unknown_paramsโTrueto accept, but discard, unknown query parameters. This allows getting a list of 'filters' and passing everything known to the server.Falsewill result in a validation exception when unknown query parameters are passed.microversionโ API version to override the negotiated one.headersโ additional headers to inject into the HTTP request.max_itemsโ the maximum number of items to return. Typically this must be used withpaginated=True.paramsโ these keyword arguments are passed through the_transpose()method to find if any of them match expected query parameters to be sent in the params argument toget(). They're additionally checked against thebase_path(openstack.resource.Resource.base_path) format string to see if any path fragments need to be filled in by the contents of this argument. Parameters supported as filters by the server side are passed in the API call, remaining parameters are applied as filters to the retrieved results.
Returns: a generator of Resource objects.
Raises: MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_list is not set to True.
Raises: InvalidResourceQuery (openstack.exceptions.InvalidResourceQuery) if query contains invalid params.
๐ฆ Image Resources ๐ฆ
๐ธ Image v1 Resources ๐ธ
๐
openstack.image.v1.image ๐
The Image Class
The Image class inherits from Resource (openstack.resource.Resource). Periodt.
class openstack.image.v1.image.Image(_synchronized=False,
connection=None, **attrs)
The base resource. Params:
_synchronizedโ this is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'image'โ singular form of the key for this resource.resources_key = 'images'โ plural form of the key for this resource.base_path = '/images'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.checksumโ hash of the image data used. The Image service uses this value for verification.container_formatโ so this one's about whether the VM image lives in a file format that also carries metadata about the actual VM. Container formats include OVF and Amazon AMI. Also? A VM image might straight up have no container format at all โ in which case it's just a blob of unstructured data, no thoughts, head empty ๐copy_fromโ a URL to copy an image from โจcreated_atโ the timestamp when this image was created ๐disk_formatโ valid values are:aki,ari,ami,raw,iso,vhd,vdi,qcow2, orvmdk. The disk format of a VM image is the format of the underlying disk image. Virtual appliance vendors all have different formats for laying out the info contained in a VM disk image โ iconic of them, honestly ๐ฆis_protectedโ defines whether the image can be deleted. Type:bool๐is_publicโTrueif this is a public image. Type:boollocationโ a location for the image identified by a URImin_diskโ the minimum disk size in GB that is required to boot the image ๐พmin_ramโ the minimum amount of RAM in MB that is required to boot the imagenameโ name for the image. Note that the name of an image is not unique to a Glance node. The API cannot expect users to know the names of images owned by others ๐ownerโ the ID of the owner, or project, of the imageowner_idโ the ID of the owner, or project, of the image (backwards compat)propertiesโ properties, if any, that are associated with the imagesizeโ the size of the image data, in bytesstatusโ the image statusupdated_atโ the timestamp when this image was last updated โญ
๐ธ classmethod find(session, name_or_id, ignore_missing=True, list_base_path=None, *, microversion=None, all_projects=None, **params)
Find a resource by its name or id, bestie. That's the whole vibe ๐ซถ
Parameters
session(Adapter) โ the session to use for making this request.name_or_idโ this resource's identifier, if needed by the request. The default isNone.ignore_missing(bool) โ when set toFalse,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.params(dict) โ any additional parameters to be passed into underlying methods, such as toexisting()in order to pass on URI parameters.
Returns
The Resource object matching the given name or id, or None if nothing matches ๐ญ
Raises
openstack.exceptions.DuplicateResource if more than one resource is found for this request.
Raises
openstack.exceptions.NotFoundException if nothing is found and ignore_missing is False.
๐ Image v2 Resources
openstack.image.v2.image
๐ The Image Class
The Image class inherits from Resource.
โจ class openstack.image.v2.image.Image(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resources_key = 'images'โ plural form of key for resource.base_path = '/images'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource โallow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.allow_patch = Trueโ allow patch operation for this resource.commit_method = 'PATCH'โ method for committing a resource. This must bePATCHifallow_patchisTrue. No cap, that's the rule ๐ฅchecksumโ hash of the image data used. The Image service uses this value for verification.container_formatโ the container format refers to whether the VM image is in a file format that also contains metadata about the actual VM. Container formats include OVF and Amazon AMI. In addition, a VM image might not have a container format โ instead, the image is just a blob of unstructured data.created_atโ the date and time when the image was created.disk_formatโ valid values are:aki,ari,ami,raw,iso,vhd,vdi,qcow2, orvmdk. The disk format of a VM image is the format of the underlying disk image. Virtual appliance vendors have different formats for laying out the information contained in a VM disk image.is_hiddenโ this field controls whether an image is displayed in the default image-list response ๐is_protectedโ defines whether the image can be deleted. Type:boolhash_algoโ the algorithm used to compute a secure hash of the image data for this image ๐hash_valueโ the hexdigest of the secure hash of the image data computed using the algorithm whose name is the value of theos_hash_algoproperty.min_diskโ the minimum disk size in GB that is required to boot the image.min_ramโ the minimum amount of RAM in MB that is required to boot the image.nameโ the name of the image.ownerโ the ID of the owner, or project, of the image.owner_idโ the ID of the owner, or project, of the image (backwards compat).propertiesโ properties, if any, that are associated with the image.sizeโ the size of the image data, in bytes.storeโ when present, Glance will attempt to store the disk image data in the backing store indicated by the value of the header. When not present, Glance will store the disk image data in the backing store that is marked default. Valid values are:file,s3,rbd,swift,cinder,gridfs,sheepdog, orvsphere๐statusโ the image status.updated_atโ the date and time when the image was updated.virtual_sizeโ the virtual size of the image.visibilityโ the image visibility ๐๏ธfileโ the URL for the virtual machine image file.locationsโ a list of URLs to access the image file in external store. This list appears if theshow_multiple_locationsoption is set totruein the Image service's configuration file.direct_urlโ the URL to access the image file kept in external store. It appears when you set theshow_image_direct_urloption totruein the Image service's configuration file.urlโ the URL to access the image file kept in external store.metadataโ the location metadata.architectureโ the CPU architecture that must be supported by the hypervisor ๐ฅ๏ธhypervisor_typeโ the hypervisor type. Note thatqemuis used for both QEMU and KVM hypervisor types.instance_type_rxtx_factorโ optional property allows created servers to have a different bandwidth cap than that defined in the network they are attached to.instance_uuidโ create this image. (that's genuinely all it says, bestie, I'm not hiding anything from you ๐ญ)needs_config_driveโ specifies whether the image needs a config drive.mandatoryoroptional(default if property is not used).kernel_idโ the ID of an image stored in the Image service that should be used as the kernel when booting an AMI-style image.os_distroโ the common name of the operating system distribution in lowercase.os_versionโ the operating system version as specified by the distributor.needs_secure_bootโ Secure Boot is a security standard. When the instance starts, Secure Boot first examines software such as firmware and OS by their signature and only allows them to run if the signatures are valid ๐os_shutdown_timeoutโ time for graceful shutdown.ramdisk_idโ the ID of image stored in the Image service that should be used as the ramdisk when booting an AMI-style image.vm_modeโ the virtual machine mode. This represents the host/guest ABI (application binary interface) used for the virtual machine.hw_cpu_socketsโ the preferred number of sockets to expose to the guest.hw_cpu_coresโ the preferred number of cores to expose to the guest. ๐งhw_cpu_threadsโ the preferred number of threads to expose to the guest. ๐ปhw_disk_busโ specifies the type of disk controller to attach disk devices to. One ofscsi,virtio,uml,xen,ide, orusb.hw_cpu_policyโ used to pin the virtual CPUs (vCPUs) of instances to the host's physical CPU cores (pCPUs). ๐hw_cpu_thread_policyโ defines how hardware CPU threads in a simultaneous multithreading-based (SMT) architecture get used.hw_rng_modelโ adds a random-number generator device to the image's instances. ๐ฒhw_machine_typeโ for libvirt: enables booting an ARM system using the specified machine type. For Hyper-V: specifies whether the Hyper-V instance will be a generation 1 or generation 2 VM.hw_scsi_modelโ enables the use of VirtIO SCSI (virtio-scsi) to provide block device access for compute instances; by default, instances use VirtIO Block (virtio-blk).hw_serial_port_countโ specifies the count of serial ports that should be provided.hw_video_modelโ the video image driver used. ๐ฌhw_video_ramโ maximum RAM for the video image.hw_watchdog_actionโ enables a virtual hardware watchdog device that carries out the specified action if the server hangs. ๐os_command_lineโ the kernel command line to be used by the libvirt driver, instead of the default.hw_vif_modelโ specifies the model of virtual network interface device to use.is_hw_vif_multiqueue_enabledโ if true, this enables the virtio-net multiqueue feature. In this case, the driver sets the number of queues equal to the number of guest vCPUs. This makes the network performance scale across a number of vCPUs. ๐is_hw_boot_menu_enabledโ if true, enables the BIOS bootmenu.vmware_adaptertypeโ the virtual SCSI or IDE controller used by the hypervisor.vmware_ostypeโ a VMware GuestID which describes the operating system installed in the image.has_auto_disk_configโ if true, the root partition on the disk is automatically resized before the instance boots. ๐ ๏ธos_typeโ the operating system installed on the image.os_admin_userโ the operating system admin username.hw_qemu_guest_agentโ a string boolean, which if"true", QEMU guest agent will be exposed to the instance.os_require_quiesceโ if true, require quiesce on snapshot via QEMU guest agent.schemaโ the URL for the schema describing a virtual machine image. ๐
deactivate(session)โ deactivate an image.
Note: only administrative users can view image locations for deactivated images. ๐
reactivate(session)โ reactivate an image.
Note: the image must exist in order to be reactivated.
๐
upload(session, *, data=None, size=None)
Upload data into an existing image. ๐ซถ
Parameters:
sessionโ the session to use for making this request.dataโ optional data to be uploaded. If not provided, the~Image.dataattribute will be used.sizeโ optional size of the data in bytes. Providing this allows Glance to pre-allocate storage and can improve upload performance. If not provided and data is a file-like object, the size will be calculated automatically.
Returns: the server response.
๐ stage(session, *, data=None, size=None)
Stage binary image data into an existing image. โจ
Parameters:
sessionโ the session to use for making this request.dataโ optional data to be uploaded. If not provided, the~Image.dataattribute will be used.sizeโ optional size of the data in bytes. Providing this allows Glance to pre-allocate storage and can improve upload performance. If not provided and data is a file-like object, the size will be calculated automatically.
Returns: the server response.
๐ import_image(session, method='glance-direct', *, uri=None, remote_region=None, remote_image_id=None, remote_service_interface=None, store=None, stores=None, all_stores=None, all_stores_must_succeed=None)
Import Image via interoperable image import process. ๐ฅ
โญ classmethod find
classmethod find(session, name_or_id, ignore_missing=True,
list_base_path=None, *, microversion=None, all_projects=None,
**params)
Find a resource by its name or id. ๐
Parameters:
sessionโ the session to use for making this request.name_or_idโ this resource's identifier, if needed by the request. The default isNone.ignore_missingโ when set toFalse,NotFoundExceptionwill be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.list_base_pathโbase_pathto be used when you need listing resources.microversionโ API version to override the negotiated one.paramsโ any additional parameters to be passed into underlying methods, such as toexisting()in order to pass on URI parameters.
Returns: the Resource object matching the given name or id or None if nothing matches.
Raises openstack.exceptions.DuplicateResource if more than one resource is found for this request.
Raises openstack.exceptions.NotFoundException if nothing is found and ignore_missing is False.
๐ฆ openstack.image.v2.member
๐ The Member Class
The Member class inherits from Resource. ๐ซถ
class openstack.image.v2.member.Member(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'members'โ plural form of key for resource.base_path = '/images/%(image_id)s/members'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.member_idโ the ID of the image member. An image member is a tenant with whom the image is shared. ๐ฏcreated_atโ the date and time when the member was created.image_idโ image ID stored through the image API. Typically a UUID.statusโ the status of the image.schemaโ the URL for schema of the member.updated_atโ the date and time when the member was updated.
๐ธ openstack.image.v2.metadef_namespace
๐ The MetadefNamespace Class
The MetadefNamespace class inherits from Resource. โจ
class
openstack.image.v2.metadef_namespace.MetadefNamespace(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'namespaces'โ plural form of key for resource.base_path = '/metadefs/namespaces'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_list = Trueโ allow list operation for this resource.allow_delete = Trueโ allow delete operation for this resource.delete_all_properties(session)โ delete all properties in a namespace. ๐งน
Parameters
sessionโ the session to use for making this request.
Returns โ the server response. ๐
delete_all_objects(session)
Delete all objects in a namespace.
Parameters
sessionโ the session to use for making this request.
Returns โ the server response.
add_tag(session, tag)
Adds a single tag to the resource.
Parameters
sessionโ the session to use for making this request.tagโ the tag as a string.
set_tags(session, tags, append=False)
Sets/Replaces all tags on the resource.
Parameters
sessionโ the session to use for making this request.tags(list) โ list with tags to be set on the resource.appendโ if set totrue, adds new tags to existing tags, else overwrites the existing tags with new ones.
๐ฆ openstack.image.v2.metadef_object
The MetadefObject Class
The MetadefObject class inherits from Resource (<#openstack.resource.Resource>). ๐ซถ
class openstack.image.v2.metadef_object.MetadefObject(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resources_key = 'objects' โ plural form of key for resource.
base_path = '/metadefs/namespaces/%(namespace_name)s/objects' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
name โ the name of this resource.
๐ธ openstack.image.v2.metadef_property
The MetadefProperty Class
The MetadefProperty class inherits from Resource (<#openstack.resource.Resource>). โจ
class openstack.image.v2.metadef_property.MetadefProperty(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
base_path = '/metadefs/namespaces/%(namespace_name)s/properties' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
namespace_name โ an identifier (a name) for the namespace.
name โ the name of the property.
type โ the property type.
title โ the title of the property.
description โ detailed description of the property.
operators โ a list of operator.
default โ default property description.
is_readonly โ indicates whether this is a read-only property.
minimum โ minimum allowed numerical value.
maximum โ maximum allowed numerical value.
enum โ enumerated list of property values.
pattern โ a regular expression (ECMA 262, http://www.ecma-international.org/publications/standards/Ecma-262.htm) that a string value must match.
min_length โ minimum allowed string length.
max_length โ maximum allowed string length.
items โ schema for the items in an array.
require_unique_items โ indicates whether all values in the array must be distinct.
min_items โ minimum length of an array.
max_items โ maximum length of an array.
allow_additional_items โ describes extra items, if you use tuple typing. If the value of items is an array (tuple typing) and the instance is longer than the list of schemas in items, the additional items are described by the schema in this property. If this value is false, the instance cannot be longer than the list of schemas in items. If this value is true, that is equivalent to the empty schema (anything goes).
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, **params)
This method is a generator which yields resource objects.
A re-implementation of list() (<#openstack.resource.Resource.list>) that handles glance's single, unpaginated list implementation.
Refer to list() (<#openstack.resource.Resource.list>) for full documentation including parameter, exception and return type documentation.
๐ openstack.image.v2.metadef_resource_type
The MetadefResourceType Class
The MetadefResourceType class inherits from Resource (<#openstack.resource.Resource>). ๐ฅ
class openstack.image.v2.metadef_resource_type.MetadefResourceType(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resources_key = 'resource_types' โ plural form of key for resource.
base_path = '/metadefs/resource_types' โ the base part of the URI for this resource.
allow_list = True โ allow list operation for this resource.
name โ the name of metadata definition resource type.
created_at โ the date and time when the resource type was created.
updated_at โ the date and time when the resource type was updated.
The MetadefResourceTypeAssociation Class
The MetadefResourceTypeAssociation class inherits from Resource (<#openstack.resource.Resource>). ๐
class openstack.image.v2.metadef_resource_type.MetadefResourceTypeAssociation(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
resources_key = 'resource_type_associations' โ plural form of key for resource.
base_path = '/metadefs/namespaces/%(namespace_name)s/resource_types' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
namespace_name โ the name of the namespace whose details you want to see.
name โ the name of metadata definition resource type.
created_at โ the date and time when the resource type was created.
updated_at โ the date and time when the resource type was updated.
prefix โ prefix for any properties in the namespace that you want to apply to the resource type. If you specify a prefix, you must append a prefix separator, such as the colon (:) character.
properties_target โ some resource types allow more than one key and value pair for each instance. For example, the Image service allows both user and image metadata on volumes. The properties_target parameter enables a namespace target to remove the ambiguity.
๐ฆ openstack.image.v2.metadef_schema
The MetadefSchema Class
The MetadefSchema class inherits from Resource (<#openstack.resource.Resource>). ๐
class openstack.image.v2.metadef_schema.MetadefSchema(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ bestie do NOT touch this one directly, it's not meant for you ๐ peepnew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead.connectionโ a reference to the Connection that's being used. It defaults toNoneso Resource objects can exist without an active Connection, like in unit tests, no cap. And anyself._connectionusage in Resource code better guard itself with aNonecheck, fr fr.
base_path = '/schemas/metadefs' โ the base part of the URI for this resource. iconic little prefix โจ
allow_fetch = True โ allow get operation for this resource. we love a readable resource ๐ซถ
additional_properties โ a boolean value that indicates allows users to add custom properties.
definitions โ a set of definitions.
required โ a list of required resources.
properties โ schema properties. yes those are the actual words, it's giving minimalist ๐ธ
๐ฆ openstack.image.v2.service_info ๐ฆ
โญ The Store Class โญ
The Store class inherits from Resource <#openstack.resource.Resource>. ok lineage slay ๐
class openstack.image.v2.service_info.Store(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resources_key = 'stores' โ plural form of key for resource. keys but make it plural ๐
base_path = '/info/stores' โ the base part of the URI for this resource.
allow_list = True โ allow list operation for this resource. lists are literally her whole thing ๐
description โ description of the store
is_default โ default
properties โ (yes, that's the whole description, she said what she said ๐)
delete_image(session, image, *, ignore_missing=False) โ delete image from store
Parameters
sessionโ the session to use for making this request.imageโ the value can be either the ID of an image or a Image <#openstack.image.v2.image.Image> instance.
Returns โ the result of the delete if resource found, else None.
Raises โ NotFoundException <#openstack.exceptions.NotFoundException> when ignore_missing if False and a nonexistent resource is attempted to be deleted. so like, if you set it to False and the thing isn't there, it's gonna yell at you ๐ญ
๐ The Import Info Class ๐
The Import class inherits from Resource <#openstack.resource.Resource>.
class openstack.image.v2.service_info.Import(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
base_path = '/info/import' โ the base part of the URI for this resource.
allow_fetch = True โ allow get operation for this resource.
import_methods โ import methods
๐ openstack.image.v2.task ๐
๐ The Task Class ๐
The Task class inherits from Resource <#openstack.resource.Resource>.
class openstack.image.v2.task.Task(_synchronized=False, connection=None,
**attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resources_key = 'tasks' โ plural form of key for resource.
base_path = '/tasks' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_list = True โ allow list operation for this resource.
created_at โ the date and time when the task was created.
expires_at โ the date and time when the task is subject to removal. bye bestie โณ
input โ a JSON object specifying the input parameters to the task.
message โ human-readable text, possibly an empty string, usually displayed in an error situation to provide more information about what has occurred.
owner_id โ the ID of the owner, or project, of the task.
result โ a JSON object specifying the outcome of the task.
schema โ the URL for schema of the task.
status โ the status of the task.
type โ the type of task represented by this content.
updated_at โ the date and time when the task was updated.
๐ KeyManager Resources ๐
๐ง openstack.key_manager.v1.container ๐ง
๐ธ The Container Class ๐ธ
The Container class inherits from Resource <#openstack.resource.Resource>.
class openstack.key_manager.v1.container.Container(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resources_key = 'containers' โ plural form of key for resource.
base_path = '/containers' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource. she does it all, main character energy โจ
container_ref โ a URI for this container
container_id โ the ID for this container
created_at โ the timestamp when this container was created.
name โ the name of this container
secret_refs โ a list of references to secrets in this container
status โ the status of this container
type โ the type of this container
updated_at โ the timestamp when this container was updated.
consumers โ a party interested in this container.
๐ openstack.key_manager.v1.container_acl ๐
๐ The ContainerACL Class ๐
The ContainerACL class inherits from Resource <#openstack.resource.Resource>.
class
openstack.key_manager.v1.container_acl.ContainerACL(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
base_path = '/containers/%(container_id)s/acl' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = False โ allow list operation for this resource. nope, not this one ๐
โโ๏ธ
create_opts = ... โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create(). the full default is literally:
CreateOpts(request_key=<Unset.UNSET: 'UNSET'>,
response_key=<Unset.UNSET: 'UNSET'>, method='PUT',
requires_id=False, response_has_body=True)
commit_method = 'PATCH' โ method for committing a resource. This must be PATCH if allow_patch is True. โ ๏ธ like, for real, it must be ๐
requires_id = False โ do calls for this resource require an ID.
container_id โ the ID of the container this ACL belongs to
acl_ref โ a URI for this container ACL
read โ read operation settings, e.g. {'users': [str], 'project-access': bool}.
created_at โ the timestamp when this ACL was created (ISO 8601 format)
updated_at โ the timestamp when this ACL was last updated (ISO 8601 format)
๐ openstack.key_manager.v1.order ๐
๐ฆ The Order Class ๐ฆ
The Order class inherits from Resource <#openstack.resource.Resource>.
class openstack.key_manager.v1.order.Order(_synchronized=False, connection=None, **attrs)
The base resource ๐ซถ
Parameters
_synchronizedโ bestie, do NOT pass this directly, it's not for you. Seenew()andexisting()instead, they've got you.connectionโ a reference to the Connection being used. It defaults toNoneso you can make Resource objects without an active Connection, like in unit tests. And heads up: if you're usingself._connectioninside Resource code, guard it with aNonecheck. No cap.
resources_key = 'orders' โ the plural form of the key for this resource.
base_path = '/orders' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
created_at โ timestamp in ISO8601 format of when the order was created.
creator_id โ Keystone Id of the user who created the order.
meta โ a dictionary containing key-value parameters which specify the details of an order request.
order_ref โ a URI for this order.
order_id โ the ID of this order.
secret_ref โ secret href associated with the order.
secret_id โ secret ID associated with the order.
sub_status โ metadata associated with the order.
sub_status_message โ metadata associated with the order.
updated_at โ timestamp in ISO8601 format of the last time the order was updated.
๐ธ openstack.key_manager.v1.project_quota โ the ProjectQuota Class ๐ธ
The ProjectQuota class inherits from Resource.
class openstack.key_manager.v1.project_quota.ProjectQuota(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, fr. Seenew()andexisting().connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can exist without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'project_quotas' โ singular form of key for resource.
resources_key = 'project_quotas' โ plural form of key for resource.
base_path = '/project-quotas' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
secrets โ contains the configured quota value of the requested project for the secret resource.
orders โ contains the configured quota value of the requested project for the orders resource.
containers โ contains the configured quota value of the requested project for the containers resource.
consumers โ contains the configured quota value of the requested project for the consumers resource.
cas โ contains the configured quota value of the requested project for the CAs resource.
๐ฆ openstack.key_manager.v1.quota โ the Quota Class ๐ฆ
The Quota class inherits from Resource.
class openstack.key_manager.v1.quota.Quota(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'quotas' โ singular form of key for resource.
resources_key = 'quotas' โ plural form of key for resource.
base_path = '/quotas' โ the base part of the URI for this resource.
allow_fetch = True โ allow get operation for this resource.
secrets โ contains the effective quota value of the current project for the secret resource.
orders โ contains the effective quota value of the current project for the orders resource.
containers โ contains the effective quota value of the current project for the containers resource.
consumers โ contains the effective quota value of the current project for the consumers resource.
cas โ contains the effective quota value of the current project for the CAs resource.
Lowkey note the difference here โproject_quotagives you the configured values for the requested project, andquotagives you the effective values for the current project. Two different vibes entirely ๐
๐ openstack.key_manager.v1.secret โ the Secret Class ๐
The Secret class inherits from Resource.
class openstack.key_manager.v1.secret.Secret(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resources_key = 'secrets' โ plural form of key for resource.
base_path = '/secrets' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
algorithm โ metadata provided by a user or system for informational purposes.
bit_length โ metadata provided by a user or system for informational purposes. Value must be greater than zero, okay? like, non-negotiable.
content_types โ a list of content types.
expires_at โ once this timestamp has past, the secret will no longer be available. it's giving expiry date, bestie ๐ญ
created_at โ timestamp of when the secret was created.
mode โ the type/mode of the algorithm associated with the secret information.
name โ the name of the secret set by the user.
secret_ref โ a URI to the secret.
secret_store_id โ computed UUID of the secret store currently holding the payload (microversion 1.3+; JSON null when N/A).
secret_store_ref โ computed HREF of the secret store currently holding the payload (microversion 1.3+; JSON null when N/A).
secret_type โ used to indicate the type of secret being stored.
status โ the status of this secret.
updated_at โ a timestamp when this secret was updated.
payload โ the secret's data to be stored. payload_content_type must also be supplied if payload is included. (optional)
payload_content_type โ the media type for the content of the payload. (required if payload is included)
payload_content_encoding โ the encoding used for the payload to be able to include it in the JSON request. Currently only base64 is supported. (required if payload is encoded)
๐ซถ the payload trio is a package deal โ includepayloadwithoutpayload_content_typeand it's a bad time. include an encoded payload withoutpayload_content_encodingand, again, bad time.
fetch โ the glow-up method โจ
fetch(session, requires_id=True, base_path=None, error_message=None, skip_cache=False, *, resource_response_key=None, microversion=None, **params)
Get a remote resource based on this instance. literally what it says on the tin.
Parameters
sessionโ the session to use for making this request.requires_idโ whether resource ID should be part of the requested URI.base_pathโ base part of the URI for fetching resources, if different frombase_path.error_messageโ an error message to be returned if requested object does not exist.skip_cacheโ a boolean indicating whether optional API cache should be skipped for this invocation.resource_response_keyโ overrides the usage ofself.resource_keywhen processing the response body.microversionโ API version to override the negotiated one.paramsโ additional parameters that can be consumed.
๐ heads up on the signature: everything after that lone*is keyword-only, soresource_response_keyandmicroversionhave to be passed by name. no sneaky positional business, iykyk.
Returns โ this Resource instance, bestie. Like, the whole thing. ๐
Raises MethodNotSupported (<#openstack.exceptions.MethodNotSupported>) if Resource.allow_fetch is not set to True.
Raises NotFoundException (<#openstack.exceptions.NotFoundException>) if the resource literally was not found. gone. missing. ๐ญ
migrate_store(session, secret_store_id, *, microversion=None)
Okay so this one migrates your secret onto a different secret store. Moving houses but for secrets ๐โจ
It requires key-manager microversion 1.3. But lowkey, prefer migrate_secret_store() instead โ that one actually enforces the microversion and accepts UUID/URI/SecretStore. iykyk ๐ซถ
Parameters
sessionโ the session you're using to make this request.secret_store_idโ destination store UUID (or, plot twist, the trailing path segment of aโฆ/secret-stores/<uuid>URI).microversionโ the API microversion to use. Defaults to the negotiated microversion for this resource.
Returns โ None. That's it. Nothing to show off. ๐คทโโ๏ธ
๐ openstack.key_manager.v1.secret_acl ๐
The SecretACL Class
The SecretACL class inherits from Resource (<#openstack.resource.Resource>). iconic behaviour honestly ๐
class openstack.key_manager.v1.secret_acl.SecretACL(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly, bestie. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. And if you're usingself._connectioninResourcecode, protect yourself with a check forNone. fr fr, protect yourself. ๐ซถ
Attributes
base_path = '/secrets/%(secret_id)s/acl'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource. nope, not today.allow_fetch = Trueโ allow get operation for this resource. yes queen.allow_commit = Trueโ allow update operation for this resource. slay.allow_delete = Trueโ allow delete operation for this resource. bye bestie ๐allow_list = Falseโ allow list operation for this resource. no listing.requires_id = Falseโ do calls for this resource require an ID? apparently not.secret_idโ the UUID of the parent secret used in the URL.readโ ACL definition for read operations (dict).acl_refโ reference URL returned byPUT/PATCH.
๐ฆ openstack.key_manager.v1.secret_consumer ๐ฆ
The SecretConsumer Class
class openstack.key_manager.v1.secret_consumer.SecretConsumer(_synchronized=False, connection=None, **attrs)
Bases: Resource (<#openstack.resource.Resource>)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Attributes
resources_key = 'consumers'โ plural form of key for resource. cute.base_path = '/secrets/%(secret_id)s/consumers'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource. โจallow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. we love a listable queen.requires_id = Falseโ do calls for this resource require an ID? no ma'am.secret_idโ URI attributes.serviceโ body attributes.resource_typeโ body attributes.resource_idโ body attributes.
๐ธ openstack.key_manager.v1.secret_store ๐ธ
The SecretStore Class
The SecretStore class inherits from Resource (<#openstack.resource.Resource>). ๐
class openstack.key_manager.v1.secret_store.SecretStore(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Attributes
resources_key = 'secret_stores'โ plural form of key for resource.base_path = '/secret-stores'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Falseโ allow update operation for this resource.allow_delete = Falseโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. ๐nameโ the name of the secret store.statusโ the status of the secret store.created_atโ timestamp of when the secret store was created.updated_atโ timestamp of when the secret store was last updated.secret_store_refโ a URI to the secret store.secret_store_idโ the ID of the secret store (fromsecret_store_refhref, or the explicitsecret_store_idfield on microversion 1.3+).global_defaultโ flag indicating if this secret store is global default.crypto_pluginโ the crypto plugin name.secret_store_pluginโ the secret store plugin name.
๐ Load Balancer Resources ๐
๐
openstack.load_balancer.v2.amphora ๐
The Amphora Class
The Amphora class inherits from Resource (<#openstack.resource.Resource>). amphora is such a fun word honestly, say it out loud. amphora. ๐บ
class openstack.load_balancer.v2.amphora.Amphora(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Attributes
resource_key = 'amphora'โ singular form of key for resource.resources_key = 'amphorae'โ plural form of key for resource. yes,amphorae. latin ate. ๐๏ธbase_path = '/octavia/amphorae'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Falseโ allow update operation for this resource.allow_delete = Falseโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
Fields, bestie ๐ซถ
idโ the ID of the amphora.loadbalancer_idโ the ID of the load balancer.compute_idโ the ID of the amphora resource in the compute system.lb_network_ipโ the management IP of the amphora.vrrp_ipโ the address of the vrrp port on the amphora.ha_ipโ the IP address of the Virtual IP (VIP).vrrp_port_idโ the vrrp port's ID in the networking system.ha_port_idโ the ID of the Virtual IP (VIP) port.cert_expirationโ the date the certificate for the amphora expires.cert_busyโ whether the certificate is in the process of being replaced.roleโ the role configured for the amphora. One ofSTANDALONE,MASTER,BACKUP.statusโ the status of the amphora. One of:BOOTING,ALLOCATED,READY,PENDING_CREATE,PENDING_DELETE,DELETED,ERROR.vrrp_interfaceโ the bound interface name of the vrrp port on the amphora.vrrp_idโ the vrrp group's ID for the amphora.vrrp_priorityโ the priority of the amphora in the vrrp group.cached_zoneโ the availability zone of a compute instance, cached at create time.created_atโ the UTC date and timestamp when the resource was created.updated_atโ the UTC date and timestamp when the resource was last updated.image_idโ the ID of the glance image used for the amphora.compute_flavorโ the ID of the compute flavor used for the amphora.
configure(session)
Configure load balancer. ๐๏ธ
Update the amphora agent configuration. This will push the new configuration to the amphora agent and will update the configuration options that are mutatable.
Parameters
sessionโ the session to use for making this request.
Returns โ None.
failover(session)
Failover load balancer. iykyk, it's giving dramatic exit but make it infrastructure ๐
Parameters
sessionโ the session to use for making this request.
Returns โ None.
๐ธ The AmphoraConfig Class ๐ธ
Okay so the AmphoraConfig class inherits from Resource <#openstack.resource.Resource> โ yep, that's the base class, she's the parent, we love her.
class openstack.load_balancer.v2.amphora.AmphoraConfig(_synchronized=False,
connection=None, **attrs)
It's the base resource ๐
Parameters
_synchronizedโ bestie do NOT use this directly, like fr. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead.connectionโ a reference to theConnectionbeing used. Defaults toNoneso thatResourceobjects can be used without an active Connection, like in unit tests. And listen โ any use ofself._connectioninResourcecode should protect itself with a check forNone. Protect yourself, queen ๐ซถ
Attributes, in order, no skipping:
base_path = '/octavia/amphorae/%(amphora_id)s/config'โ the base part of the URI for this resource ๐allow_create = Falseโ nope, no create operation for this resourceallow_fetch = Falseโ no get operation either, sorryallow_commit = Trueโ oh THIS one's a yes, update operation allowedallow_delete = Falseโ no delete operationallow_list = Falseโ and no list operationallow_empty_commit = Trueโ commits happen without the header or body being dirty. Iconic, low maintenancerequires_id = Falseโ do calls for this resource require an ID? No ma'amamphora_idโ the ID of the amphora ๐
commit(session, prepend_key=True, has_body=False, *args, **kwargs)
Commit the state of the instance to the remote resource. Slay, go off, update the world โจ
Parameters
sessionโ the session to use for making this requestprepend_keyโ whether theresource_key<#openstack.resource.Resource.resource_key> should be prepended in a resource creation request. Defaults toTrueretry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults alone ๐base_pathโ base part of the URI for modifying resources, if it's different frombase_path<#openstack.resource.Resource.base_path>microversionโ API version to override the negotiated oneattrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource
Returns
This Resource instance ๐
Raises
MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True. So like, don't even try it.
๐ฆ The AmphoraFailover Class ๐ฆ
The AmphoraFailover class inherits from Resource <#openstack.resource.Resource>. Same base resource energy, different path, we move ๐ง
class openstack.load_balancer.v2.amphora.AmphoraFailover(_synchronized=False,
connection=None, **attrs)
It's the base resource ๐
Parameters
_synchronizedโ not intended to be used directly, bestie. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an active Connection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone
Attributes:
base_path = '/octavia/amphorae/%(amphora_id)s/failover'โ the base part of the URI for this resourceallow_create = Falseโ allow create operation for this resourceallow_fetch = Falseโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Falseโ allow delete operation for this resourceallow_list = Falseโ allow list operation for this resourceallow_empty_commit = Trueโ commits happen without header or body being dirtyrequires_id = Falseโ do calls for this resource require an IDamphora_idโ the ID of the amphora
commit(session, prepend_key=True, has_body=False, *args, **kwargs)
Commit the state of the instance to the remote resource.
Parameters
sessionโ the session to use for making this requestprepend_keyโ whether theresource_key<#openstack.resource.Resource.resource_key> should be prepended in a resource creation request. Default toTrueretry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). Value ofNoneleaves the Adapter defaultsbase_pathโ base part of the URI for modifying resources, if different frombase_path<#openstack.resource.Resource.base_path>microversionโ API version to override the negotiated oneattrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource
Returns
This Resource instance.
Raises
MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True.
๐ openstack.load_balancer.v2.availability_zone ๐
The AvailabilityZone Class
The AvailabilityZone class inherits from Resource <#openstack.resource.Resource> โ she's got range, look at all those Trues โญ
class openstack.load_balancer.v2.availability_zone.AvailabilityZone(_synchronized=False,
connection=None, **attrs)
It's the base resource ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an active Connection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone
Attributes:
resource_key = 'availability_zone'โ singular form of key for resourceresources_key = 'availability_zones'โ plural form of key for resourcebase_path = '/lbaas/availabilityzones'โ the base part of the URI for this resourceallow_create = Trueโ allow create operation for this resource โallow_fetch = Trueโ allow get operation for this resource โallow_commit = Trueโ allow update operation for this resource โallow_delete = Trueโ allow delete operation for this resource โallow_list = Trueโ allow list operation for this resource โnameโ the name of the availability zonedescriptionโ the availability zone descriptionavailability_zone_profile_idโ the associated availability zone profile IDis_enabledโ whether the availability zone is enabled for use or not
๐ openstack.load_balancer.v2.availability_zone_profile ๐
The AvailabilityZoneProfile Class
The AvailabilityZoneProfile class inherits from Resource <#openstack.resource.Resource>. Another full-access icon, we love to see it ๐
class openstack.load_balancer.v2.availability_zone_profile.AvailabilityZoneProfile(_synchronized=False,
connection=None, **attrs)
It's the base resource ๐
Parameters
_synchronizedโ not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an active Connection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone
Attributes:
resource_key = 'availability_zone_profile'โ singular form of key for resourceresources_key = 'availability_zone_profiles'โ plural form of key for resourcebase_path = '/lbaas/availabilityzoneprofiles'โ the base part of the URI for this resourceallow_create = Trueโ allow create operation for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Trueโ allow delete operation for this resourceallow_list = Trueโ allow list operation for this resourceidโ the ID of the availability zone profilenameโ the name of the availability zone profileprovider_nameโ the provider this availability zone profile is foravailability_zone_dataโ the JSON string containing the availability zone metadata. It's giving raw JSON realness, handle with care ๐ซถ
๐ openstack.load_balancer.v2.flavor ๐
The Flavor Class
The Flavor class inherits from Resource <#openstack.resource.Resource>. Yes, a load balancer flavor is a whole thing, and yes she's valid ๐
class openstack.load_balancer.v2.flavor.Flavor(_synchronized=False,
connection=None, **attrs)
It's the base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>connectionโ your lil pointer to theConnectionin play. It defaults toNoneso you can totally buildResourceobjects without a live connection (unit tests say hi ๐). Heads up: if you're usingself._connectioninsideResourcecode, guard it with aNonecheck, okay?resource_key = 'flavor'โ the singular key for this resource โจresources_key = 'flavors'โ the plural key for this resource โจbase_path = '/lbaas/flavors'โ the base chunk of the URI for this resource ๐ฃ๏ธallow_create = Trueโ green light for create, bestie ๐allow_fetch = Trueโ green light for get ๐ซถallow_commit = Trueโ green light for update โ๏ธallow_delete = Trueโ green light for delete ๐๏ธallow_list = Trueโ green light for list ๐idโ the ID of the flavor ๐nameโ the name of the flavor ๐ท๏ธdescriptionโ the flavor description, iykyk ๐flavor_profile_idโ the associated flavor profile ID ๐is_enabledโ whether the flavor is enabled for use or not (yes/no energy) โ
openstack.load_balancer.v2.flavor_profile
The FlavorProfile Class
okay so the FlavorProfile class inherits from Resource <#openstack.resource.Resource> โ iconic inheritance moment ๐
class openstack.load_balancer.v2.flavor_profile.FlavorProfile(_synchronized=False, connection=None, **attrs)
The base resource โ literally the blueprint ๐ง
Parameters
_synchronizedโ not meant to be used directly, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'flavorprofile'โ the singular key for this resource ๐ธresources_key = 'flavorprofiles'โ the plural key for this resource ๐ธbase_path = '/lbaas/flavorprofiles'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ create? allowed, obviously ๐allow_fetch = Trueโ get? allowed ๐ซถallow_commit = Trueโ update? allowed โ๏ธallow_delete = Trueโ delete? allowed ๐๏ธallow_list = Trueโ list? allowed ๐idโ the ID of the flavor profile ๐nameโ the name of the flavor profile ๐ท๏ธprovider_nameโ the provider this flavor profile is for ๐ขflavor_dataโ the JSON string containing the flavor metadata ๐งพ
openstack.load_balancer.v2.health_monitor
The HealthMonitor Class
HealthMonitor inherits from Resource <#openstack.resource.Resource> โ it's giving "watching you breathe" energy ๐
class openstack.load_balancer.v2.health_monitor.HealthMonitor(_synchronized=False, connection=None, **attrs)
The base resource ๐ง
Parameters
_synchronizedโ not intended to be used directly, fr. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'healthmonitor'โ the singular key for this resource ๐resources_key = 'healthmonitors'โ the plural key for this resource ๐base_path = '/lbaas/healthmonitors'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ create is a yes ๐allow_list = Trueโ list is a yes ๐allow_fetch = Trueโ get is a yes ๐ซถallow_delete = Trueโ delete is a yes ๐๏ธallow_commit = Trueโ update is a yes โ๏ธ
not me pointing out thatallow_listsits beforeallow_fetchhere โ that's the original order, keep it, no cap ๐
created_atโ properties timestamp when the health monitor was created โฐdelayโ the time, in seconds, between sending probes to members โฑ๏ธexpected_codesโ the expected http status codes to get from a successful health check ๐ฏhttp_methodโ the HTTP method that the monitor uses for requests ๐ฎis_admin_state_upโ the administrative state of the health monitor. Type:bool๐max_retriesโ the number of successful checks before changing the operating status of the member toONLINE๐max_retries_downโ the number of allowed check failures before changing the operating status of the member toERROR๐nameโ the health monitor name ๐ท๏ธoperating_statusโ operating status of the member ๐poolsโ list of associated pools. Type:listofdicts which contain the pool IDs ๐pool_idโ the ID of the associatedPool๐project_idโ the ID of the project ๐provisioning_statusโ the provisioning status of this member โ๏ธtimeoutโ the time, in seconds, after which a health check times out โtypeโ the type of health monitor ๐งฌupdated_atโ timestamp when the member was last updated ๐url_pathโ the HTTP path of the request to test the health of a member ๐ค๏ธ
openstack.load_balancer.v2.l7_policy
The L7Policy Class
L7Policy inherits from Resource <#openstack.resource.Resource> โ layer 7 decisions, main character energy ๐
class openstack.load_balancer.v2.l7_policy.L7Policy(_synchronized=False, connection=None, **attrs)
The base resource ๐ง
Parameters
_synchronizedโ not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'l7policy'โ the singular key for this resource ๐resources_key = 'l7policies'โ the plural key for this resource ๐base_path = '/lbaas/l7policies'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ create: slay โallow_list = Trueโ list: slay ๐allow_fetch = Trueโ get: slay ๐ซถallow_commit = Trueโ update: slay โ๏ธallow_delete = Trueโ delete: slay ๐๏ธ
and yeah, the order iscreate,list,fetch,commit,deletein this one โ different from the others, that's just how it is, periodt ๐
actionโ properties the action to be taken when l7policy is matched ๐ฌcreated_atโ timestamp when the L7 policy was created โฐdescriptionโ the l7policy description ๐is_admin_state_upโ the administrative state of the l7policy. Type:bool๐listener_idโ the ID of the listener associated with this l7policy ๐งnameโ the l7policy name ๐ท๏ธoperating_statusโ operating status of the member ๐positionโ sequence number of this l7policy ๐ขproject_idโ the ID of the project this l7policy is associated with ๐provisioning_statusโ the provisioning status of this l7policy โ๏ธredirect_pool_idโ the ID of the pool to which the requests will be redirected ๐redirect_prefixโ the URL prefix to which the requests should be redirected ๐redirect_urlโ the URL to which the requests should be redirected ๐rulesโ the list ofL7Rules associated with the l7policy ๐updated_atโ timestamp when the member was last updated ๐
openstack.load_balancer.v2.l7_rule
The L7Rule Class
L7Rule inherits from Resource <#openstack.resource.Resource> โ the little rule that could, bestie ๐ฆ
class openstack.load_balancer.v2.l7_rule.L7Rule(_synchronized=False, connection=None, **attrs)
The base resource ๐ง
Parameters
_synchronizedโ not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'rule'โ the singular key for this resource โญresources_key = 'rules'โ the plural key for this resource โญbase_path = '/lbaas/l7policies/%(l7policy_id)s/rules'โ the base part of the URI for this resource. note the%(l7policy_id)ssubstitution โ it's nested inside a policy, iykyk ๐ชallow_create = Trueโ create? yes ๐allow_list = Trueโ list? yes ๐allow_fetch = Trueโ get? yes ๐ซถallow_commit = Trueโ update? yes โ๏ธallow_delete = Trueโ delete? yes ๐๏ธis_admin_state_upโ properties the administrative state of the l7policy. Type:bool๐compare_typeโ the comparison type that gets used with the value in this L7 rule ๐ฏcreated_atโ timestamp of when this L7 rule was created โฐkeyโ the key to use for the comparison ๐l7_policy_idโ the ID of the l7 policy it's attached to ๐ซถoperating_statusโ the operating status of this l7rule ๐ซproject_idโ the ID of the project this l7policy is associated with ๐ท๏ธprovisioning_statusโ the provisioning status of this l7policy ๐ฆtypeโ the type of L7 rule โจupdated_atโ timestamp of when this L7 rule was last updated ๐rule_valueโ the value to be compared against โ๏ธ
๐ง openstack.load_balancer.v2.listener
The Listener Class ๐
so this one inherits from Resource (peep openstack.resource.Resource, it's the blueprint of the whole fam):
class openstack.load_balancer.v2.listener.Listener(_synchronized=False, connection=None, **attrs)
The base resource โ that's the whole vibe of it, no cap.
Parameters
_synchronizedโ not a thing you should touch directly, bestie ๐ seenew()andexisting()instead.connectionโ a reference to theConnectionin use. Defaults toNonesoResourceobjects can exist without an activeConnection(think unit tests, etc.). Anything inResourcecode reaching forself._connectionshould protect itself with a check forNoneโ like, be responsible pls ๐ซก
Class attributes, coming right up:
resource_key = 'listener'โ the singular form of the key for this resource.resources_key = 'listeners'โ the plural form of the key for this resource.base_path = '/lbaas/listeners'โ the base part of the URI for this resource.allow_create = Trueโ creation is allowed, slay.allow_fetch = Trueโ fetching is allowed.allow_commit = Trueโ updating is allowed.allow_delete = Trueโ deleting is allowed.allow_list = Trueโ listing is allowed.
And the fields themselves:
allowed_cidrsโ a list of IPv4 or IPv6 CIDRs.alpn_protocolsโ a list of ALPN protocols.connection_limitโ the max number of connections permitted for this load balancer. Default is infinite โพ๏ธcreated_atโ timestamp of when the listener was created.default_poolโ the default pool that requests get routed to.default_pool_idโ the ID of the default pool. It must have a compatible protocol with the listener, so don't be messy about it ๐ญdefault_tls_container_refโ a reference to a container of TLS secrets ๐descriptionโ a description for the listener.is_hsts_include_subdomainsโ defines whether theinclude_subdomainsdirective is used for HSTS or not.hsts_max_ageโ enables HTTP Strict Transport Security (HSTS) and sets themax_agedirective to the given value.is_hsts_preloadโ defines whether thehsts_preloaddirective is used for HSTS or not.insert_headersโ a dictionary of additional headers to insert into the HTTP header.is_admin_state_upโ the administrative state of the listener: upTrueor downFalse. Type:bool.l7_policiesโ a list of l7policies associated with this listener.load_balancer_idโ the ID of the parent load balancer.load_balancersโ a list of load balancers associated with this listener. Type: list of dicts which contain the load balancer IDs.nameโ the listener's name โจoperating_statusโ the operating status of the listener.project_idโ the ID of the project this listener is associated with.protocolโ the protocol of the listener, which isTCP,HTTP,HTTPSorTERMINATED_HTTPS.protocol_portโ the port the listener listens on, e.g.80.provisioning_statusโ the provisioning status of this listener.sni_container_refsโ a list of references to TLS secrets. Type:list.updated_atโ timestamp of when the listener was last updated.timeout_client_dataโ frontend client inactivity timeout, in milliseconds.timeout_member_connectโ backend member connection timeout, in milliseconds.timeout_member_dataโ backend member inactivity timeout, in milliseconds.timeout_tcp_inspectโ time, in milliseconds, to wait for additional TCP packets so it can inspect the content ๐tls_ciphersโ stores a cipher string in OpenSSL format.tls_versionsโ a list of TLS protocols to be used by the listener.
The ListenerStats Class ๐
yep, this one also inherits from Resource (openstack.resource.Resource), keeping the family tradition alive:
class openstack.load_balancer.v2.listener.ListenerStats(_synchronized=False, connection=None, **attrs)
The base resource โ periodt.
Parameters
_synchronizedโ do not use this directly, bestie ๐ โโ๏ธ seenew()andexisting().connectionโ a reference to theConnectionin use. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. Code usingself._connectionshould always guard againstNone.
Class attributes:
resource_key = 'stats'โ singular form of the key for this resource.base_path = '/lbaas/listeners/%(listener_id)s/stats'โ the base part of the URI for this resource.allow_create = Falseโ nope, no creating stats, they're not yours to invent ๐allow_fetch = Trueโ fetching? yes.allow_commit = Falseโ no updating either.allow_delete = Falseโ and definitely no deleting.allow_list = Falseโ no listing. it's giving read-only-for-one ๐
Fields:
listener_idโ the ID of the listener.active_connectionsโ the currently active connections.bytes_inโ the total bytes received.bytes_outโ the total bytes sent.request_errorsโ the total requests that were unable to be fulfilled ๐ญtotal_connectionsโ the total connections handled.
๐ openstack.load_balancer.v2.load_balancer
The LoadBalancer Class ๐
the big one. inherits from Resource (openstack.resource.Resource), as everything does:
class openstack.load_balancer.v2.load_balancer.LoadBalancer(_synchronized=False, connection=None, **attrs)
The base resource โ main character energy tbh.
Parameters
_synchronizedโ not intended for direct use, friend ๐ seenew()andexisting().connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection, e.g. in unit tests. Anyself._connectionusage inResourcecode should protect itself with a check forNone.
Class attributes:
resource_key = 'loadbalancer'โ singular form of the key for this resource.resources_key = 'loadbalancers'โ plural form of the key for this resource.base_path = '/lbaas/loadbalancers'โ the base part of the URI for this resource.allow_create = Trueโ create: yes.allow_fetch = Trueโ fetch: yes.allow_commit = Trueโ update: yes.allow_delete = Trueโ delete: yes.allow_list = Trueโ list: yes. we love a fully-enabled resource ๐
Fields:
is_admin_state_upโ the administrative state of the load balancer. Type:bool.availability_zoneโ the name of the target Octavia availability zone.created_atโ timestamp of when the load balancer was created.descriptionโ the load balancer description.flavor_idโ the load balancer flavor ID.listenersโ a list of listeners associated with this load balancer.nameโ the load balancer's name โจoperating_statusโ the operating status of the load balancer.poolsโ a list of pools associated with this load balancer.project_idโ the ID of the project this load balancer is associated with.providerโ the provider name for the load balancer.provisioning_statusโ the provisioning status of this load balancer.updated_atโ timestamp of when the load balancer was last updated.vip_addressโ the VIP address of the load balancer.vip_network_idโ the VIP network ID (the docs spell it "netowrk" and honestly? iconic, we're leaving it ๐ซถ).vip_port_idโ the VIP port ID.vip_subnet_idโ the VIP subnet ID.vip_sg_idsโ a list of security group IDs for the VIP port.additional_vipsโ additional VIPs. yes, more of them ๐
Methods:
failover(session)โ failover the load balancer.
Parameters
sessionโ the session to use for making this request.
Returns
None
The LoadBalancerStats Class ๐
inherits from Resource (openstack.resource.Resource), because of course it does:
class openstack.load_balancer.v2.load_balancer.LoadBalancerStats(_synchronized=False, connection=None, **attrs)
The base resource โ same energy as ever.
Parameters
_synchronizedโ ngl bestie, don't touch this one directly ๐ it's internal. Peepnew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead.connectionโ a reference to the Connection in use. Defaults toNoneso Resource objects can exist without an active Connection (think unit tests, vibes only). Anyself._connectionuse inside Resource code should guard itself with aNonecheck, fr fr.
resource_key = 'stats' โ the singular form of the key for this resource.
base_path = '/lbaas/loadbalancers/%(lb_id)s/stats' โ the base part of the URI for this resource.
allow_create = False โ create operation? Not allowed, sorry bestie.
allow_fetch = True โ get operation is a yes ๐
allow_commit = False โ update? nope.
allow_delete = False โ delete? also nope.
allow_list = False โ list? absolutely not.
lb_id โ the ID of the load balancer. iconic identifier behavior.
active_connections โ the currently active connections.
bytes_in โ the total bytes received.
bytes_out โ the total bytes sent.
request_errors โ the total requests that were unable to be fulfilled. ๐ญ
total_connections โ the total connections handled.
๐ The LoadBalancerFailover Class
The LoadBalancerFailover class inherits from Resource <#openstack.resource.Resource>. slay.
openstack.load_balancer.v2.load_balancer.LoadBalancerFailover(_synchronized=False,
connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not meant for direct use, bestie. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneso Resource objects work without an active Connection, like in unit tests. Any use ofself._connectionin Resource code should protect itself with a check forNone. ๐ซถ
base_path = '/lbaas/loadbalancers/%(lb_id)s/failover' โ the base part of the URI for this resource.
allow_create = False โ create operation not allowed.
allow_fetch = False โ get operation, also no.
allow_commit = True โ update operation is allowed! we love a commit ๐
allow_delete = False โ delete operation not allowed.
allow_list = False โ list operation not allowed.
allow_empty_commit = True โ commits happen without the header or body being dirty. no notes.
requires_id = False โ do calls for this resource require an ID? nope, false.
lb_id โ the ID of the load balancer.
commit(session, prepend_key=True, has_body=False, *args, **kwargs) โ commit the state of the instance to the remote resource. let's go โจ
Parameters
sessionโ the session to use for making this request.prepend_keyโ whether theresource_key<#openstack.resource.Resource.resource_key> should be prepended in a resource creation request. Defaults toTrue.retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults. ๐base_pathโ base part of the URI for modifying resources, if it's different frombase_path<#openstack.resource.Resource.base_path>.microversionโ API version to override the negotiated one.attrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns This Resource instance. ๐
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True. periodt.
๐ธ openstack.load_balancer.v2.member
The Member Class
The Member class inherits from Resource <#openstack.resource.Resource>. bestie she's giving full CRUD energy.
openstack.load_balancer.v2.member.Member(_synchronized=False,
connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'member' โ singular form of key for resource.
resources_key = 'members' โ plural form of key for resource.
base_path = '/lbaas/pools/%(pool_id)s/members' โ the base part of the URI for this resource.
allow_create = True โ create operation allowed ๐
allow_fetch = True โ get operation allowed.
allow_commit = True โ update operation allowed.
allow_delete = True โ delete operation allowed.
allow_list = True โ list operation allowed. full set, we ate.
address โ the IP address of the member.
created_at โ timestamp when the member was created.
is_admin_state_up โ the administrative state of the member, which is up True or down False. Type: bool.
monitor_address โ IP address used to monitor this member.
monitor_port โ port used to monitor this member.
name โ name of the member.
operating_status โ operating status of the member.
pool_id โ the ID of the owning pool.
provisioning_status โ the provisioning status of this member.
project_id โ the ID of the project this member is associated with.
protocol_port โ the port on which the application is hosted.
subnet_id โ subnet ID in which to access this member.
updated_at โ timestamp when the member was last updated.
weight โ a positive integer value that indicates the relative portion of traffic that this member should receive from the pool. For example, a member with a weight of 10 receives five times as much traffic as a member with weight of 2. math queen ๐งฎ
backup โ a bool value that indicates whether the member is a backup or not. Backup members only receive traffic when all non-backup members are down. lowkey the emergency contact of the pool.
๐ฆ openstack.load_balancer.v2.pool
The Pool Class
The Pool class inherits from Resource <#openstack.resource.Resource>. main character energy, honestly.
openstack.load_balancer.v2.pool.Pool(_synchronized=False,
connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'pool' โ singular form of key for resource.
resources_key = 'pools' โ plural form of key for resource.
base_path = '/lbaas/pools' โ the base part of the URI for this resource.
allow_create = True โ create operation allowed.
allow_list = True โ list operation allowed.
allow_fetch = True โ get operation allowed.
allow_delete = True โ delete operation allowed.
allow_commit = True โ update operation allowed.
alpn_protocols โ properties List of ALPN protocols.
created_at โ timestamp when the pool was created.
description โ description for the pool.
health_monitor_id โ Health Monitor ID.
is_admin_state_up โ the administrative state of the pool. Type: bool.
lb_algorithm โ the loadbalancing algorithm used in the pool.
listener_id โ ID of listener associated with this pool.
listeners โ list of listeners associated with this pool.
loadbalancer_id โ ID of load balancer associated with this pool.
loadbalancers โ list of loadbalancers associated with this pool.
members โ members associated with this pool.
name โ the pool name.
operating_status โ operating status of the pool.
project_id โ the ID of the project.
protocol โ the protocol of the pool.
provisioning_status โ provisioning status of the pool.
tls_ciphers โ stores a string of cipher strings in OpenSSL format.
session_persistence โ a JSON object specifying the session persistence for the pool.
tls_versions โ a list of TLS protocol versions to be used in by the pool.
updated_atโ timestamp of when the pool got its last glow-up โจtls_enabledโ do we TLS the connections to the backend member servers? Type:boolca_tls_container_refโ holds the CA certificate that the backend servers use ๐crl_container_refโ holds the revocation list file
๐ฆ openstack.load_balancer.v2.provider ๐ฆ
The Provider Class
ok so the Provider class inherits from Resource <#openstack.resource.Resource> โ that's the family tree, no cap ๐ณ
class openstack.load_balancer.v2.provider.Provider(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not meant to be used directly, bestie. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead ๐connectionโ a reference to theConnectionbeing used. Defaults toNoneso thatResourceobjects can be used without an activeConnection, like in unit tests. Any use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ซถresources_key = 'providers'โ plural form of the key for this resource.base_path = '/lbaas/providers'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource. (nope, not happening ๐)allow_fetch = Falseโ allow get operation for this resource.allow_commit = Falseโ allow update operation for this resource.allow_delete = Falseโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. this one slays โจnameโ the provider name.descriptionโ the provider description.
The Provider Flavor Capabilities Class
and ProviderFlavorCapabilities also inherits from Resource <#openstack.resource.Resource> ๐ง
class openstack.load_balancer.v2.provider.ProviderFlavorCapabilities(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ not meant to be used directly, fr fr. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an activeConnection, like in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'flavor_capabilities'โ plural form of the key for this resource.base_path = '/lbaas/providers/%(provider)s/flavor_capabilities'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource.allow_fetch = Falseโ allow get operation for this resource.allow_commit = Falseโ allow update operation for this resource.allow_delete = Falseโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. ๐providerโ the provider name to query.nameโ the provider name.descriptionโ the provider description.
๐ openstack.load_balancer.v2.quota ๐
The Quota Class
Quota inherits from Resource <#openstack.resource.Resource> โ the whole quota situation lives here ๐
class openstack.load_balancer.v2.quota.Quota(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ do not use this directly, bestie. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'quota'โ singular form of the key for this resource.resources_key = 'quotas'โ plural form of the key for this resource.base_path = '/lbaas/quotas'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.load_balancersโ the maximum amount of load balancers you can have. Type:intlistenersโ the maximum amount of listeners you can create. Type:intpoolsโ the maximum amount of pools you can create. Type:inthealth_monitorsโ the maximum amount of health monitors you can create. Type:intmembersโ the maximum amount of members you can create. Type:intproject_idโ the ID of the project this quota is associated with.
๐ง Network Resources ๐ง
openstack.network.v2.address_group
The AddressGroup Class
AddressGroup inherits from Resource <#openstack.resource.Resource>. it's giving "address group extension" energy ๐ธ
class openstack.network.v2.address_group.AddressGroup(_synchronized=False, connection=None, **attrs)
Address group extension.
The base resource
Parameters
_synchronizedโ not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'address_group'โ singular form of the key for this resource.resources_key = 'address_groups'โ plural form of the key for this resource.base_path = '/address-groups'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.idโ the ID of the address group.nameโ the address group name.descriptionโ the address group name. (yes, it literally says that in the docs, i'm not making this up ๐ญ)project_idโ the ID of the project that owns the address group.tenant_idโTenant_id(deprecated attribute). โ ๏ธ deprecated, so maybe don't build your whole personality on it.addressesโ the IP addresses of the address group.add_addresses(session, addresses)โ add addresses into the address group.
Parameters
session(Adapter) โ the session to communicate through.addresses(list) โ the list of address strings.
Returns the response as a AddressGroup object with updated addresses
Raises SDKException <#openstack.exceptions.SDKException> on error.
remove_addresses(session, addresses)โ remove addresses from the address group.
Parameters
session(Adapter) โ the session to communicate through.addresses(list) โ the list of address strings.
Returns the response as a AddressGroup object with updated addresses
Raises SDKException <#openstack.exceptions.SDKException> on error.
openstack.network.v2.address_scope
The AddressScope Class
AddressScope inherits from Resource <#openstack.resource.Resource>. address scope extension, let's go ๐
class openstack.network.v2.address_scope.AddressScope(_synchronized=False, connection=None, **attrs)
Address scope extension.
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'address_scope'โ singular form of the key for this resource.resources_key = 'address_scopes'โ plural form of the key for this resource.base_path = '/address-scopes'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. ๐nameโ the address scope name.project_idโ the ID of the project that owns the address scope.tenant_idโTenant_id(deprecated attribute). โ ๏ธ same deal, deprecated!ip_versionโ the IP address family of the address scope. Type:intis_sharedโ indicates whether this address scope is shared across all projects. Type:bool
๐ openstack.network.v2.agent
๐ The Agent Class
Okay so the Agent class inherits from Resource <#openstack.resource.Resource>, bestie. It's giving very much "base class energy."
class openstack.network.v2.agent.Agent(_synchronized=False,
connection=None, **attrs)
Neutron agent extension. Slay. And underneath it all it's literally just the base resource.
Parameters โ the whole squad of args:
_synchronizedโ ngl you are not supposed to touch this directly. Peepnew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead. ๐connectionโ a reference to theConnectionbeing used. Defaults toNoneso thatResourceobjects can vibe without an activeConnection, like in unit tests. Any use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ซถ
Class attributes, go off:
resource_key = 'agent'โ singular form of key for resource. โจresources_key = 'agents'โ plural form of key for resource.base_path = '/agents'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource. (Not today, bestie.)allow_fetch = Trueโ allow get operation for this resource. ๐allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
Instance attributes, the main characters:
agent_typeโ the type of network agent.availability_zoneโ availability zone for the network agent.binaryโ the name of the network agent's application binary. ๐ฅconfigurationโ network agent configuration data specific to theagent_type.created_atโ timestamp when the network agent was created. ๐descriptionโ the network agent description.last_heartbeat_atโ timestamp when the network agent's heartbeat was last seen. ๐hostโ the host the agent is running on.is_admin_state_upโ the administrative state of the network agent, which is upTrueor downFalse. Type:bool. ๐ฆis_aliveโ whether or not the network agent is alive. Type:bool.resources_syncedโ whether or not the agent is successfully synced towards placement (the docs spell it "succesffully" and honestly? iconic of them). Agents supporting the guaranteed minimum bandwidth feature share their resource view withneutron-server, andneutron-servershares this view with placement;resources_syncedrepresents the success of the latter. The valueNonemeans no resource view synchronization to Placement was attempted.true/falsevalues signify the success of the last synchronization attempt. Type:bool. ๐งstarted_atโ timestamp when the network agent was last started.topicโ the messaging queue topic the network agent subscribes to. ๐ฌha_stateโ the HA state of the L3 agent. This is one of'active','standby'or'fault'for HA routers, orNonefor other types of routers.ha_chassis_priorityโ the HA chassis priority for this agent in the router'sHA_Chassis_Group(OVN). Higher values indicate higher priority; the highest priority chassis is the active gateway.Nonefor non-OVN backends. Type:int. ๐
๐ซถ get_bgp_speakers_hosted_by_dragent(session)
List BGP speakers hosted by a Dynamic Routing Agent. Periodt.
Parameters:
session(Adapter) โ the session to communicate through.
Returns: a list of BgpSpeakers.
Return type: BgpSpeaker <#openstack.network.v2.bgp_speaker.BgpSpeaker>
๐ฆ openstack.network.v2.auto_allocated_topology
The Auto Allocated Topology Class
The Auto Allocated Topology class inherits from Resource <#openstack.resource.Resource>. (Original docs say "Toplogy" โ we love a typo queen.) ๐
class
openstack.network.v2.auto_allocated_topology.AutoAllocatedTopology(_synchronized=False,
connection=None, **attrs)
The base resource. That's the whole vibe.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>. ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Class attributes:
resource_key = 'auto_allocated_topology'โ singular form of key for resource. โจbase_path = '/auto-allocated-topology'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource. ๐ฅallow_commit = Falseโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Falseโ allow list operation for this resource.
Instance attributes:
project_idโ Project ID. If project is not specified the topology will be created for the project the user is authenticated against. Will return in error if resources have not been configured correctly. To use this featureauto-allocated-topology,subnet_allocation,external-netandrouterextensions must be enabled and set up. ๐tenant_idโ Tenant_id (deprecated attribute). ๐ญ Deprecated, so like... don't.
๐ธ openstack.network.v2.availability_zone
The AvailabilityZone Class
The AvailabilityZone class inherits from Resource <#openstack.resource.Resource>.
class
openstack.network.v2.availability_zone.AvailabilityZone(_synchronized=False,
connection=None, **attrs)
The base resource, as always bestie.
Parameters:
_synchronizedโ not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>. ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Class attributes:
resource_key = 'availability_zone'โ singular form of key for resource.resources_key = 'availability_zones'โ plural form of key for resource.base_path = '/availability_zones'โ the base part of the URI for this resource.allow_create = Falseโ allow create operation for this resource.allow_fetch = Falseโ allow get operation for this resource.allow_commit = Falseโ allow update operation for this resource.allow_delete = Falseโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. She only lists, and honestly? Same. ๐
Instance attributes:
nameโ name of the availability zone.resourceโ type of resource for the availability zone, such asnetwork.stateโ state of the availability zone, eitheravailableorunavailable. โญ
๐ openstack.network.v2.bgp_peer
The BgpPeer Class
The BgpPeer class inherits from Resource <#openstack.resource.Resource>. Peers gonna peer. ๐ซถ
class openstack.network.v2.bgp_peer.BgpPeer(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters:
_synchronizedโ not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>. โจconnectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Class attributes:
resource_key = 'bgp_peer'โ singular form of key for resource.resources_key = 'bgp_peers'โ plural form of key for resource.base_path = '/bgp-peers'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource. ๐ฅallow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource. Full menu, no cap. ๐
Instance attributes:
idโ the Id of the BGP Peer.nameโ the BGP Peer's name.project_idโ the ID of the project that owns the BGP Peer.tenant_idโ Tenant_id (deprecated attribute). ๐auth_typeโ the authentication type for the BGP Peer, can benoneormd5.noneby default.remote_asโ the remote Autonomous System number of the BGP Peer.peer_ipโ the ip address of the Peer. ๐ฆ
๐ openstack.network.v2.bgp_speaker
The BgpSpeaker Class
The BgpSpeaker class inherits from Resource <#openstack.resource.Resource>. Speaker of the house, literally.
class openstack.network.v2.bgp_speaker.BgpSpeaker(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters:
_synchronizedโ this is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>. ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protectconnectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. If you useself._connectioninResourcecode, protect it with a check forNone. ๐ซถ
Class-level keys, bestie โ these are the ones doing the heavy lifting โจ:
resource_key = 'bgp_speaker'โ singular form of key for resource.resources_key = 'bgp_speakers'โ plural form of key for resource.base_path = '/bgp-speakers'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
And the attrs, slay ๐ :
idโ theIdof the BGP Speaker.nameโ the BGP speaker's name.project_idโ the ID of the project that owns the BGP Speaker.tenant_idโTenant_id(deprecated attribute).ip_versionโ the IP version (4or6) of the BGP Speaker.advertise_floating_ip_host_routesโ whether to enable or disable the advertisement of floating ip host routes by the BGP Speaker.Trueby default.advertise_tenant_networksโ whether to enable or disable the advertisement of tenant network routes by the BGP Speaker.Trueby default.local_asโ the local Autonomous System number of the BGP Speaker.networksโ a list of network IDs to which the BGP Speaker is associated.
Methods time, no cap ๐ฅ:
add_bgp_peer(session, peer_id)โ add BGP Peer to a BGP Speaker.- Parameters:
session(Adapter) โ the session to communicate through.peer_idโ id of the peer to associate with the speaker.
- Returns: a dictionary as the API Reference describes it.
- Raises:
SDKException <#openstack.exceptions.SDKException>on error.
- Parameters:
remove_bgp_peer(session, peer_id)โ remove BGP Peer from a BGP Speaker.- Parameters:
session(Adapter) โ the session to communicate through.peer_idโ the ID of the peer to disassociate from the speaker.
- Raises:
SDKException <#openstack.exceptions.SDKException>on error.
- Parameters:
add_gateway_network(session, network_id)โ add Network to a BGP Speaker.Param session:The session to communicate through.- Parameters:
network_idโ the ID of the network to associate with the speaker.
- Returns: a dictionary as the API Reference describes it.
remove_gateway_network(session, network_id)โ delete Network from a BGP Speaker.- Parameters:
session(Adapter) โ the session to communicate through.network_idโ the ID of the network to disassociate from the speaker.
- Parameters:
get_advertised_routes(session)โ list routes advertised by a BGP Speaker.- Parameters:
session(Adapter) โ the session to communicate through. - Returns: the response as a list of routes (
cidr/nexthoppair advertised by the BGP Speaker. - Raises:
SDKException <#openstack.exceptions.SDKException>on error.
- Parameters:
get_bgp_dragents(session)โ list Dynamic Routing Agents hosting a specific BGP Speaker.- Parameters:
session(Adapter) โ the session to communicate through. - Returns: the response as a list of dragents hosting a specific BGP Speaker.
- Return type:
Agent <#openstack.network.v2.agent.Agent> - Raises:
SDKException <#openstack.exceptions.SDKException>on error.
- Parameters:
add_bgp_speaker_to_dragent(session, bgp_agent_id)โ add BGP Speaker to a Dynamic Routing Agent.- Parameters:
session(Adapter) โ the session to communicate through.bgp_agent_idโ the id of the dynamic routing agent to which add the speaker.
- Parameters:
remove_bgp_speaker_from_dragent(session, bgp_agent_id)โ delete BGP Speaker from a Dynamic Routing Agent.- Parameters:
session(Adapter) โ the session to communicate through.bgp_agent_idโ the id of the dynamic routing agent from which remove the speaker.
- Parameters:
๐ openstack.network.v2.bgpvpn ๐
๐ The BgpVpn Class ๐
The BgpVpn class inherits from Resource <#openstack.resource.Resource>.
class openstack.network.v2.bgpvpn.BgpVpn(_synchronized=False,
connection=None, **attrs)
The base resource ๐ซถ
- Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Class-level keys, iconic behavior โจ:
resource_key = 'bgpvpn'โ singular form of key for resource.resources_key = 'bgpvpns'โ plural form of key for resource.base_path = '/bgpvpn/bgpvpns'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
Attrs, bestie ๐:
idโ theIdof the BGPVPN.nameโ the BGPVPN's name.project_idโ the ID of the project that owns the BGPVPN.tenant_idโTenant_id(deprecated attribute).route_distinguishersโ list of route distinguisher strings.route_targetsโ Route Targets that will be both imported and used for export.import_targetsโ additional Route Targets that will be imported.export_targetsโ additional Route Targets that will be used for export.local_prefโ the default BGPLOCAL_PREFof routes that will be advertised to the BGPVPN.vniโ the globally-assigned VXLAN vni for the BGP VPN.typeโ selection of the type of VPN and the technology behind it. Allowed values arel2orl3.
๐ฆ openstack.network.v2.bgpvpn_network_association ๐ฆ
โจ The BgpVpnNetworkAssociation Class โจ
The BgpVpnNetworkAssociation class inherits from Resource <#openstack.resource.Resource>.
class
openstack.network.v2.bgpvpn_network_association.BgpVpnNetworkAssociation(_synchronized=False,
connection=None, **attrs)
The base resource ๐
- Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Class-level keys, periodt ๐ :
resource_key = 'network_association'โ singular form of key for resource.resources_key = 'network_associations'โ plural form of key for resource.base_path = '/bgpvpn/bgpvpns/%(bgpvpn_id)s/network_associations'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Falseโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
Attrs, lowkey essential ๐ธ:
idโ theIdof the BGPVPN.bgpvpn_idโ the ID of the BGPVPN who owns Network Association.project_idโ the ID of the project that owns the BGPVPN.tenant_idโTenant_id(deprecated attribute).network_idโ the ID of a Neutron network with which to associate the BGP VPN.
๐ openstack.network.v2.bgpvpn_port_association ๐
๐ The BgpVpnPortAssociation Class ๐
The BgpVpnPortAssociation class inherits from Resource <#openstack.resource.Resource>.
class
openstack.network.v2.bgpvpn_port_association.BgpVpnPortAssociation(_synchronized=False,
connection=None, **attrs)
The base resource ๐ง
- Parameters:
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
connectionโ a reference to theConnectionthat's being used. It defaults toNoneso you can still useResourceobjects when there's no live connection (unit tests, bestie, we've all been there). Real talk: any use ofself._connectioninsideResourcecode has to guard itself with aNonecheck. ๐resource_key = 'port_association'โ the singular key for this resource.resources_key = 'port_associations'โ the plural key for this resource.base_path = '/bgpvpn/bgpvpns/%(bgpvpn_id)s/port_associations'โ the base chunk of the URI for this resource.allow_create = Trueโ yes, you can create with this one.allow_fetch = Trueโ yes, you can get it.allow_commit = Trueโ yes, updates are allowed.allow_delete = Trueโ yes, deletion's on the menu.allow_list = Trueโ and yes, you can list them too. full package, no notes โจidโ the Id of the BGPVPN.bgpvpn_idโ the ID of the BGPVPN that owns the Network Association.project_idโ the ID of the project that owns the BGPVPN.tenant_idโtenant_id, which is a deprecated attribute, jsyk.port_idโ the ID of a Neutron Port you're associating the BGP VPN with.advertise_fixed_ipsโ a boolean flag that controls whether the fixed IPs of a port get advertised to the BGPVPN (default:true).routesโ a list of routes, where each route is a dict with at least atypekey, and that key can beprefixorbgpvpn. For theprefixtype, the IP prefix (v4 or v6) you want to advertise goes in theprefixkey. For thebgpvpntype, thebgpvpn_idkey says which BGPVPN to readvertise routes from.
๐ openstack.network.v2.bgpvpn_router_association
The BgpVpnRouterAssociation Class ๐
Okay so the BgpVpnRouterAssociation class inherits from Resource <#openstack.resource.Resource>. iconic behaviour, honestly.
class openstack.network.v2.bgpvpn_router_association.BgpVpnRouterAssociation(_synchronized=False, connection=None, **attrs)
This is the base resource, bestie.
Parameters ๐ซถ
_synchronizedโ not meant for direct use, okay? Go look atnew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> instead.connectionโ a reference to theConnectionthat's being used. Defaults toNonesoResourceobjects work without an active connection, like in unit tests. And fr, anyself._connectionusage inResourcecode should protect itself with aNonecheck.resource_key = 'router_association'โ the singular key for this resource.resources_key = 'router_associations'โ the plural key for this resource.base_path = '/bgpvpn/bgpvpns/%(bgpvpn_id)s/router_associations'โ the base part of the URI for this resource.allow_create = Trueโ creation? allowed.allow_fetch = Trueโ fetching? allowed.allow_commit = Trueโ committing updates? allowed.allow_delete = Trueโ deleting? allowed.allow_list = Trueโ listing? allowed. we love a resource that does it all ๐idโ the Id of the BGPVPN.bgpvpn_idโ the ID of the BGPVPN that owns the Network Association.project_idโ the ID of the project that owns the BGPVPN.tenant_idโtenant_id, a deprecated attribute.router_idโ the ID of a Neutron router you're associating the BGP VPN with.advertise_extra_routesโ a boolean flag controlling whether the routes listed in theroutesattribute of the router get advertised to the BGPVPN (default:true).
๐ฆ openstack.network.v2.extension
The Extension Class โจ
The Extension class inherits from Resource <#openstack.resource.Resource>. slay.
class openstack.network.v2.extension.Extension(_synchronized=False, connection=None, **attrs)
The base resource, obviously.
Parameters ๐
_synchronizedโ nope, not for direct use. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionin use. Defaults toNonesoResourceobjects can exist without an active connection, like in unit tests. Anyself._connectionusage inResourcecode must protect itself with aNonecheck.resource_key = 'extension'โ singular key for the resource.resources_key = 'extensions'โ plural key for the resource.base_path = '/extensions'โ the base part of the URI for this resource.allow_fetch = Trueโ get operation allowed. (No create/commit/delete here, just so we're clear ๐)allow_list = Trueโ list operation allowed.aliasโ an alias the extension is known under.descriptionโ text describing what the extension actually does.linksโ links pertaining to this extension.nameโ the name of this extension.updated_atโ timestamp of when the extension was last updated.
๐ openstack.network.v2.flavor
The Flavor Class ๐ธ
The Flavor class inherits from Resource <#openstack.resource.Resource>.
class openstack.network.v2.flavor.Flavor(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters ๐
_synchronizedโ not intended for direct use, bestie. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an active connection, like in unit tests. Uses ofself._connectioninResourcecode should protect themselves with aNonecheck.resource_key = 'flavor'โ singular key for this resource.resources_key = 'flavors'โ plural key for this resource.base_path = '/flavors'โ the base part of the URI for this resource.allow_create = Trueโ creation allowed.allow_fetch = Trueโ get allowed.allow_commit = Trueโ update allowed.allow_delete = Trueโ delete allowed.allow_list = Trueโ list allowed. all the green checks, we stan ๐descriptionโ the description for the flavor.is_enabledโ sets the enabled flag.nameโ the name of the flavor.service_typeโ the service type this flavor applies to.service_profile_idsโ IDs of the service profiles associated with this flavor.
๐ openstack.network.v2.floating_ip
The FloatingIP Class ๐ง
The FloatingIP class inherits from Resource <#openstack.resource.Resource>.
class openstack.network.v2.floating_ip.FloatingIP(_synchronized=False, connection=None, **attrs)
The base resource, as ever.
Parameters ๐ฅ
_synchronizedโ please don't use this directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an active connection, like in unit tests. Anyself._connectionuse inResourcecode should guard itself with aNonecheck.resource_key = 'floatingip'โ singular key for this resource.resources_key = 'floatingips'โ plural key for this resource.base_path = '/floatingips'โ the base part of the URI for this resource.allow_create = Trueโ create: allowed.allow_fetch = Trueโ fetch: allowed.allow_commit = Trueโ commit: allowed.allow_delete = Trueโ delete: allowed.allow_list = Trueโ list: allowed.created_atโ timestamp of when the floating IP was created.descriptionโ the floating IP's description.dns_domainโ the DNS domain.dns_nameโ the DNS name.fixed_ip_addressโ the fixed IP address associated with the floating IP. Heads up: if you're planning to associate the floating IP with a fixed IP at creation time, you must indicate the identifier of the internal port. And if that internal port has multiple associated IP addresses, the service just picks the first one โ unless you explicitly pass thefixed_ip_addressparameter to choose a specific IP. so specific, love that for you ๐floating_ip_addressโ the floating IP address.nameโ plot twist: the Floating IP object doesn't have a name attribute, so the IP address gets set as the name, letting a user find a floating IP by UUID or IP address usingfind_ip. workaround queen ๐floating_network_idโ the ID of the network associated with the floating IP.port_detailsโ read-only. The details of the port this floating IP associates with. Only present if thefip-port-detailsextension is loaded. Type: adictwith keysname,network_id,mac_address,admin_state_up,status,device_id,device_owner.port_idโ the port ID.qos_policy_idโ the ID of the QoS policy that's attached to the floating IP ๐project_idโ the ID of the project this floating IP is associated withtenant_idโ Tenant_id (deprecated attribute) โ ๏ธ like, it's still there, but it's giving legacy vibesrouter_idโ the ID of an associated routerstatusโ the floating IP status. Value isACTIVEorDOWNupdated_atโ timestamp at which the floating IP was last updatedsubnet_idโ the Subnet ID associated with the floating IP
๐ซถ openstack.network.v2.health_monitor
The HealthMonitor Class โจ
Okay so the HealthMonitor class inherits from Resource <#openstack.resource.Resource> ๐ง
class openstack.network.v2.health_monitor.HealthMonitor(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'healthmonitor'โ singular form of key for resourceresources_key = 'healthmonitors'โ plural form of key for resourcebase_path = '/lbaas/healthmonitors'โ the base part of the URI for this resourceallow_create = Trueโ allow create operation for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Trueโ allow delete operation for this resourceallow_list = Trueโ allow list operation for this resourcedelayโ the time, in seconds, between sending probes to members โฑ๏ธexpected_codesโ expected HTTP codes for a passing HTTP(S) monitorhttp_methodโ the HTTP method that the monitor uses for requestsis_admin_state_upโ the administrative state of the health monitor, which is upTrueor downFalse. Type:boolmax_retriesโ maximum consecutive health probe triesnameโ name of the health monitorpool_idsโ list of pools associated with this health monitor. Type: list of dicts which contain the pool IDspool_idโ the ID of the pool associated with this health monitorproject_idโ the ID of the project this health monitor is associated withtenant_idโ Tenant_id (deprecated attribute) โ ๏ธtimeoutโ the maximum number of seconds for a monitor to wait for a connection to be established before it times out. This value must be less than thedelayvalue ๐จtypeโ the type of probe sent by the load balancer to verify the member state, which isPING,TCP,HTTP, orHTTPSurl_pathโ path portion of URI that will be probed iftypeis HTTP(S)
๐ฆ openstack.network.v2.listener
The Listener Class โจ
The Listener class inherits from Resource <#openstack.resource.Resource> ๐ง
class openstack.network.v2.listener.Listener(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'listener'โ singular form of key for resourceresources_key = 'listeners'โ plural form of key for resourcebase_path = '/lbaas/listeners'โ the base part of the URI for this resourceallow_create = Trueโ allow create operation for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Trueโ allow delete operation for this resourceallow_list = Trueโ allow list operation for this resourceconnection_limitโ the maximum number of connections permitted for this load balancer. Default is infinite โพ๏ธdefault_pool_idโ ID of default pool. Must have compatible protocol with listener ๐ฅdefault_tls_container_refโ a reference to a container of TLS secrets ๐descriptionโ description for the listeneris_admin_state_upโ the administrative state of the listener, which is upTrueor downFalse. Type:boolload_balancer_idsโ list of load balancers associated with this listener. Type: list of dicts which contain the load balancer IDsload_balancer_idโ the ID of the load balancer associated with this listenernameโ name of the listenerproject_idโ the ID of the project this listener is associated withprotocolโ the protocol of the listener, which isTCP,HTTP,HTTPSorTERMINATED_HTTPSprotocol_portโ port the listener will listen to, e.g.80sni_container_refsโ a list of references to TLS secrets. Type:list
๐ openstack.network.v2.load_balancer
The LoadBalancer Class โจ
The LoadBalancer class inherits from Resource <#openstack.resource.Resource> ๐ง
class openstack.network.v2.load_balancer.LoadBalancer(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'loadbalancer'โ singular form of key for resourceresources_key = 'loadbalancers'โ plural form of key for resourcebase_path = '/lbaas/loadbalancers'โ the base part of the URI for this resourceallow_create = Trueโ allow create operation for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Trueโ allow delete operation for this resourceallow_list = Trueโ allow list operation for this resourcedescriptionโ description for the load balanceris_admin_state_upโ the administrative state of the load balancer, which is upTrueor downFalse. Type:boollistener_idsโ list of listeners associated with this load balancer. Type: list of dicts which contain the listener IDsnameโ name of the load balancer ๐operating_statusโ status of load_balancer operating, e.g.ONLINE,OFFLINEpool_idsโ list of pools associated with this load balancer. Type: list of dicts which contain the pool IDsproject_idโ the ID of the project this load balancer is associated withtenant_idโ Tenant_id (deprecated attribute) โ ๏ธproviderโ the name of the providerprovisioning_statusโ status of load balancer provisioning, e.g.ACTIVE,INACTIVEvip_addressโ the IP address of the VIP ๐vip_port_idโ the ID of the port for the VIPvip_subnet_idโ the ID of the subnet on which to allocate the VIP address
โญ openstack.network.v2.local_ip
The LocalIP Class โจ
The LocalIP class inherits from Resource <#openstack.resource.Resource> ๐ง
class openstack.network.v2.local_ip.LocalIP(_synchronized=False, connection=None, **attrs)
Local IP extension. ๐
The base resource ๐ซถ
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'local_ip'โ singular form of key for resourceresources_key = 'local_ips'โ plural form of key for resourcebase_path = '/local_ips'โ the base part of the URI for this resourceallow_create = Trueโ allow create operation for this resourceallow_fetch = Trueโ allow get operation for this resourceallow_commit = Trueโ allow update operation for this resourceallow_delete = Trueโ allow delete operation for this resourceallow_list = Trueโ allow list operation for this resource ๐ธcreated_atโ the timestamp of when this floating IP got made โจdescriptionโ the local ip's lil description ๐idโ the ID of the local ip, bestieip_modeโ the local ip's ip-mode ๐local_ip_addressโ the Local IP address, literallylocal_port_idโ the ID of the port that owns the local ip ๐ซถnameโ the local ip name, iconicnetwork_idโ the ID of the network that owns the local ip ๐ธproject_idโ the ID of the project that owns the local ip ๐revision_numberโ the local ip revision number, no capupdated_atโ the timestamp of when this floating IP was last updated โญ
openstack.network.v2.local_ip_association
The LocalIPAssociation Class
Okay so the LocalIPAssociation class inherits from Resource <#openstack.resource.Resource> โ yes, that's the base resource vibe ๐ซ.
class openstack.network.v2.local_ip_association.LocalIPAssociation(_synchronized=False, connection=None, **attrs)
It's the Local IP extension, periodt.
The base resource
Parameters
_synchronizedโ bestie, this is not meant to be used directly ๐. Go look atnew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>instead.connectionโ a reference to the Connection that's being used. It defaults toNoneso Resource objects can be used without an active Connection (like in unit tests, yk). Any use ofself._connectionin Resource code should protect itself with aNonecheck. ๐resource_key='port_association'โ the singular form of the key for this resource ๐resources_key='port_associations'โ the plural form of the key for this resource โจbase_path='/local_ips/%(local_ip_id)s/port_associations'โ the base part of the URI for this resource ๐ฅallow_create=Trueโ green light for the create operation on this resourceallow_fetch=Trueโ green light for the get operation on this resourceallow_commit=Trueโ green light for the update operation on this resourceallow_delete=Trueโ green light for the delete operation on this resourceallow_list=Trueโ green light for the list operation on this resource ๐fixed_port_idโ the fixed port ID ๐ฆfixed_ipโ the fixed IP, simple as thathostโ the Host ๐local_ip_addressโ the local ip address ๐local_ip_idโ the ID of the Local IP address, slay
openstack.network.v2.metering_label
The MeteringLabel Class
And the MeteringLabel class inherits from Resource <#openstack.resource.Resource> too, obvi ๐.
class openstack.network.v2.metering_label.MeteringLabel(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ nope, not for direct use ๐. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection in use. Defaults toNoneso Resource objects work without an active Connection (unit tests, yk). Code usingself._connectionshould guard againstNone. ๐resource_key='metering_label'โ the singular form of the key for this resource ๐ธresources_key='metering_labels'โ the plural form of the key for this resource โญbase_path='/metering/metering-labels'โ the base part of the URI for this resource ๐allow_create=Trueโ create operation allowed, go offallow_fetch=Trueโ get operation allowedallow_commit=Trueโ update operation allowedallow_delete=Trueโ delete operation allowedallow_list=Trueโ list operation allowed, periodtdescriptionโ the description of the metering label โจnameโ the name of the metering label ๐ซproject_idโ the ID of the project this metering label is associated with ๐ซถtenant_idโ Tenant_id (heads up: this is a deprecated attribute ๐)is_sharedโ tells you whether this label is shared across all projects. Type:bool๐
openstack.network.v2.metering_label_rule
The MeteringLabelRule Class
MeteringLabelRule also inherits from Resource <#openstack.resource.Resource>, as one does ๐.
class openstack.network.v2.metering_label_rule.MeteringLabelRule(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ do not use this directly, bestie ๐. Checknew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can exist without an active Connection (unit tests vibe).self._connectionusers should protect againstNone. ๐resource_key='metering_label_rule'โ the singular form of the key for this resource ๐resources_key='metering_label_rules'โ the plural form of the key for this resource ๐ฆbase_path='/metering/metering-label-rules'โ the base part of the URI for this resource ๐ธallow_create=Trueโ create operation allowedallow_fetch=Trueโ get operation allowedallow_commit=Trueโ update operation allowedallow_delete=Trueโ delete operation allowedallow_list=Trueโ list operation allowed ๐directionโingressoregress: the direction in which the metering label rule is applied. Default:"ingress"๐งis_excludedโ specifies whether theremote_ip_prefixwill be excluded from the traffic counters of the metering label, ie: so you don't count the traffic of a specific IP address of a range. Default:False, Type:bool๐ฅmetering_label_idโ the metering label ID to associate with this metering label rule ๐project_idโ the ID of the project this metering label rule is associated with ๐tenant_idโ Tenant_id (heads up: deprecated attribute ๐)remote_ip_prefixโ the remote IP prefix to be associated with this metering label rule โญsource_ip_prefixโ the source IP prefix to be associated with this metering label rule ๐destination_ip_prefixโ the destination IP prefix to be associated with this metering label rule ๐
openstack.network.v2.ndp_proxy
The NDPProxy Class
The NDPProxy class inherits from Resource <#openstack.resource.Resource> because that's the family tree ๐ซ.
class openstack.network.v2.ndp_proxy.NDPProxy(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ not intended for direct use ๐. Peepnew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. Anyself._connectionusage in Resource code should check forNone. ๐resource_key='ndp_proxy'โ the singular form of the key for this resource โจresources_key='ndp_proxies'โ the plural form of the key for this resource ๐ธbase_path='/ndp_proxies'โ the base part of the URI for this resource ๐allow_create=Trueโ create operation allowedallow_fetch=Trueโ get operation allowedallow_commit=Trueโ update operation allowedallow_delete=Trueโ delete operation allowedallow_list=Trueโ list operation allowed, iykykcreated_atโ the timestamp of when the NDP proxy was created ๐descriptionโ the description ๐idโ the ID of the NDP proxyip_addressโ the internal IP address ๐ฆnameโ the name of this resource ๐port_idโ the ID of internal port ๐project_idโ the ID of the project that owns the NDP proxy ๐revision_numberโ the NDP proxy revision numberrouter_idโ the ID of Router ๐updated_atโ the timestamp of when the NDP proxy was last updated โญ
openstack.network.v2.network
The Network Class
And here's the big one: the Network class inherits from Resource <#openstack.resource.Resource> ๐.
class openstack.network.v2.network.Network(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ again, not for direct use, bestie ๐. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, e.g. in unit tests. Use ofself._connectionin Resource code should protect itself with aNonecheck. ๐resource_key='network'โ the singular form of the key for this resource โจresources_key='networks'โ the plural form of the key for this resource ๐ธbase_path='/networks'โ the base part of the URI for this resource ๐allow_create=Trueโ create operation allowed for this resourceallow_fetch = Trueโ green light for the get operation on this resource ๐ซถallow_commit = Trueโ green light for the update operation on this resource โจallow_delete = Trueโ green light for the delete operation on this resource ๐allow_list = Trueโ green light for the list operation on this resource ๐availability_zone_hintsโ the availability zone hints used when scheduling the network. Type: list of availability zone names ๐ธavailability_zonesโ the availability zones for the network. Type: list of availability zone names โญcreated_atโ timestamp of when the network was created โฐdescriptionโ the network description ๐dns_domainโ the DNS domain that's associated ๐ฆipv4_address_scope_idโ the ID of the IPv4 address scope for the network ๐ขipv6_address_scope_idโ the ID of the IPv6 address scope for the network ๐ขis_admin_state_upโ the administrative state of the network: up isTrue, down isFalse. Type: bool ๐is_defaultโ whether this is the default external network or not. Type: bool ๐is_port_security_enabledโ the port security status: enabled isTrue, disabled isFalse. Type: bool. Default:False. Available for multiple provider extensions ๐is_router_externalโ whether the router is external or not. Type: bool. Default:False๐ชis_sharedโ says whether this network is shared across all projects. By default, only administrative users can change this value. Type: bool ๐คmtuโ read-only. The maximum transmission unit (MTU) of the network resource ๐nameโ the network name ๐ท๏ธproject_idโ the ID of the project this network is associated with ๐๏ธprovider_network_typeโ the type of physical network that maps to this network resource. Like, for example,flat,vlan,vxlan, orgre. Available for multiple provider extensions ๐ฐ๏ธprovider_physical_networkโ the physical network where this network object is actually implemented. Available for multiple provider extensions ๐provider_segmentation_idโ an isolated segment ID on the physical network. The provider network type defines the segmentation model. Available for multiple provider extensions ๐งฉpvlanโ indicates if PVLAN is enabled for the network ๐qos_policy_idโ the ID of the QoS policy attached to the port ๐๏ธsegmentsโ a list of provider segment objects. Available for multiple provider extensions ๐statusโ the network status ๐ซsubnet_idsโ the associated subnet IDs. Type: list of strs of the subnet IDs ๐งตupdated_atโ timestamp of when the network was last updated ๐is_vlan_transparentโ indicates the VLAN transparency mode of the network ๐ซงis_vlan_qinqโ indicates the VLAN QinQ mode of the network ๐ซง
๐ openstack.network.v2.network_ip_availability
๐ The NetworkIPAvailability Class
The NetworkIPAvailability class inherits from Resource. No cap, it's literally just a Resource with a glow-up โจ
class openstack.network.v2.network_ip_availability.NetworkIPAvailability(_synchronized=False, connection=None, **attrs)
The base resource ๐ฎ
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting(). iykyk ๐connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests. Any use ofself._connectioninResourcecode should protect itself with a check forNone. Very "protect your peace" of it ๐resource_key = 'network_ip_availability'โ the singular form of the key for the resource ๐resources_key = 'network_ip_availabilities'โ the plural form of the key for the resource ๐โจbase_path = '/network-ip-availabilities'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Falseโ create operation? Not on this resource, bestie ๐ซallow_fetch = Trueโ get operation? Yep, allowed ๐ซถallow_commit = Falseโ update operation? Nope ๐ซallow_delete = Falseโ delete operation? Also nope ๐ซallow_list = Trueโ list operation? Absolutely yes ๐network_idโ network ID to use when listing network IP availability ๐network_nameโ the network name for that particular network IP availability ๐ท๏ธsubnet_ip_availabilityโ the Subnet IP Availability of all subnets of a network. Type: list ๐project_idโ the ID of the project this network IP availability is associated with ๐๏ธtenant_idโtenant_id(deprecated attribute ๐ญ yes, deprecated, keep that in mind)total_ipsโ the total IPs of a network. Type: int ๐ขused_ipsโ the used or consumed IPs of a network. Type: int ๐ขip_availability_detailsโ the detailed IP availability of a network, holding thetotal_ips_in_subnet,total_ips_in_allocation_pool,used_ips_in_subnetandused_ips_in_allocation_poolkeys. Requires thenetwork-ip-availability-detailsextension. Type: dict ๐งฌ
๐ฆ openstack.network.v2.network_segment_range
๐ธ The NetworkSegmentRange Class
The NetworkSegmentRange class inherits from Resource.
class openstack.network.v2.network_segment_range.NetworkSegmentRange(_synchronized=False, connection=None, **attrs)
The base resource ๐ฎ
Parameters
_synchronizedโ not intended to be used directly, fr. Seenew()andexisting()๐connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an activeConnection, like in unit tests. Any use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'network_segment_range'โ singular form of the key for the resource ๐resources_key = 'network_segment_ranges'โ plural form of the key for the resource ๐โจbase_path = '/network_segment_ranges'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ create? yes ๐ซถallow_fetch = Trueโ get? yes โจallow_commit = Trueโ update? yes ๐allow_delete = Trueโ delete? yes ๐allow_list = Trueโ list? yes โญnameโ the network segment range name ๐ท๏ธdefaultโ the network segment range is loaded from the host configuration file. Type: bool ๐sharedโ the network segment range is shared with other projects. Type: bool ๐คproject_idโ the ID of the project associated with this network segment range ๐๏ธnetwork_typeโ the type of network associated with this network segment range, such asgeneve,gre,vlanorvxlan๐ฐ๏ธphysical_networkโ the name of the physical network associated with this network segment range ๐minimumโ the minimum segmentation ID for this network segment range. The network type defines the segmentation model: VLAN ID forvlannetwork type, and tunnel ID forgeneve,greandvxlannetwork types. Type: int โฌ๏ธmaximumโ the maximum segmentation ID for this network segment range. The network type defines the segmentation model: VLAN ID forvlannetwork type, and tunnel ID forgeneve,greandvxlannetwork types. Type: int โฌ๏ธusedโ mapping of which segmentation ID in the range is used by which project. Type: dict ๐บ๏ธavailableโ list of available segmentation IDs in this network segment range. Type: list โ
๐ openstack.network.v2.pool
๐ The Pool Class
The Pool class inherits from Resource.
class openstack.network.v2.pool.Pool(_synchronized=False, connection=None, **attrs)
The base resource ๐ฎ
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting()๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone๐resource_key = 'pool'โ singular form of the key for the resource ๐resources_key = 'pools'โ plural form of the key for the resource ๐โจbase_path = '/lbaas/pools'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ create operation? allowed ๐ซถallow_fetch = Trueโ get operation? allowed โจallow_commit = Trueโ update operation? allowed ๐allow_delete = Trueโ delete operation? allowed ๐allow_list = Trueโ list operation? allowed โญdescriptionโ description for the pool ๐health_monitor_idโ the ID of the associated health monitors ๐ฉบhealth_monitor_idsโ the IDs of the health monitors that are, like, attached to this pool (that's the LBaaS v1 ones, bestie, vintage ๐ ).health_monitor_statusโ the statuses of those associated health monitors. vibes check on the monitors โจis_admin_state_upโ the admin state of the pool: up =True, down =False. Type:boolload_balancer_idโ ID of the load balancer that's associated with this pool.member_idsโ list of members that belong to the pool. Type: list of dicts which contain the member IDsnameโ pool name. and no, it does NOT have to be unique, so go off I guess ๐project_idโ the ID of the project this pool is associated with.tenant_idโTenant_id(deprecated attribute). it's giving legacy, don't use it.protocolโ the protocol of the pool, which isTCP,HTTP, orHTTPS.providerโ the provider name of the load balancer service.statusโ human readable description of the status.status_descriptionโ the status of the network.subnet_idโ the subnet on which the members of the pool will be located.session_persistenceโ the session persistence algorithm that should be used (if any). Type: dict with keystypeandcookie_namevirtual_ip_idโ the ID of the virtual IP (VIP) address. very VIP of it ๐
openstack.network.v2.pool_member
The PoolMember Class
the PoolMember class inherits from Resource <#openstack.resource.Resource>. family tree slay ๐
class openstack.network.v2.pool_member.PoolMember(_synchronized=False, connection=None, **attrs)
the base resource
Parameters
_synchronizedโ not intended to be used directly, bestie. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>. please don't touch this one ๐connectionโ reference to theConnectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, like in unit tests ngl. any use ofself._connectionin Resource code should protect itself with a check forNone. periodt ๐
class attributes:
resource_key = 'member'โ singular form of key for resource.resources_key = 'members'โ plural form of key for resource.base_path = '/lbaas/pools/%(pool_id)s/members'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
attributes, the main characters:
pool_idโ the ID of the owning pool.addressโ the IP address of the pool member.is_admin_state_upโ the admin state of the pool member: up =True, down =False. Type:boolnameโ name of the pool member.project_idโ the ID of the project this pool member is associated with.tenant_idโTenant_id(deprecated attribute). yeah. that one. ๐protocol_portโ the port on which the application is hosted.subnet_idโ subnet ID in which to access this pool member.weightโ a positive integer value that indicates the relative portion of traffic that this member should receive from the pool. for example, a member with a weight of10receives five times as much traffic as a member with weight of2. math is mathing, bestie ๐
openstack.network.v2.port
The Port Class
the Port class inherits from Resource <#openstack.resource.Resource>. ๐ฆ
class openstack.network.v2.port.Port(_synchronized=False, connection=None, **attrs)
the base resource
Parameters
_synchronizedโ not intended to be used directly! seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. defaults toNonesoResourceobjects can be used without an activeConnection, such as in unit tests. use ofself._connectionin Resource code should protect itself with a check forNone. same deal as always ๐ซถ
class attributes:
resource_key = 'port'โ singular form of key for resource.resources_key = 'ports'โ plural form of key for resource.base_path = '/ports'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.
attributes, and there areโฆ a lot of them ๐ญ:
allowed_address_pairsโ allowed address pairs list. dictionary keyip_addressis required and keymac_addressis optional. don't forget the required one!!binding_host_idโ the ID of the host where the port is allocated. in some cases, different implementations can run on different hosts.binding_profileโ a dictionary that enables the application running on the specified host to pass and receive vif port-specific information to the plug-in. Type:dictbinding_vif_detailsโ read-only. a dictionary that enables the application to pass information about functions that the Networking API provides. to enable or disable port filtering features such as security group and anti-MAC/IP spoofing, specifyport_filter: Trueorport_filter: False. Type:dictbinding_vif_typeโ read-only. the vif type for the specified port.binding_vnic_typeโ the vnic type that is bound to the neutron port.
in POST and PUT operations, specify a value of normal (virtual nic), direct (pci passthrough), or macvtap (virtual interface with a tap-like software interface). these values support SR-IOV PCI passthrough networking. the ML2 plug-in supports the vnic_type.
in GET operations, the binding:vnic_type extended attribute is visible to only port owners and administrative users. so if you can't see it, that's why, bestie ๐
created_atโ timestamp when the port was created.data_plane_statusโ underlying data plane status of this port.descriptionโ the port description.device_idโ device ID of this port.device_ownerโ device owner of this port (e.g.network:dhcp).dns_assignmentโ DNS assignment for the port.dns_domainโ DNS domain assigned to the port.dns_nameโ DNS name for the port.extra_dhcp_optsโ extra DHCP options.fixed_ipsโ IP addresses for the port. includes the IP address and subnet ID.is_admin_state_upโ the admin state of the port: up =True, down =False. Type:boolis_port_security_enabledโ the port security status: enabled =True, disabled =False. Type:boolDefault:Falsemac_addressโ the MAC address of an allowed address pair.nameโ the port name.network_idโ the ID of the attached network.numa_affinity_policyโ the NUMA affinity policy defined for this port.project_idโ the ID of the project who owns the network. only administrative users can specify a project ID other than their own. so don't try it if that's not you ๐ฅtenant_idโTenant_id(deprecated attribute). the sequel nobody asked for ๐propagate_uplink_statusโ whether to propagate uplink status of the port. Type:boolpvlan_typeโ the PVLAN type of the port. can bePromiscuous,IsolatedorCommunity.pvlan_communityโ the PVLAN community name. only needed ifpvlan_typeisCommunity. conditional queen ๐qos_policy_idโ the ID of the QoS policy attached to the port.security_group_idsโ the IDs of any attached security groups. Type: list of strs of the security group IDsstatusโ the port status. value isACTIVEorDOWN.trunk_detailsโ read-only. the trunk referring to this parent port and its subports. present for trunk parent ports if the trunk-details extension is loaded. Type:dictwith keys:trunk_id,sub_ports.sub_portsis a list of dicts with keys:port_id,segmentation_type,segmentation_id,mac_addressnested dicts go brrr โจtrustedโ status of the trusted VIF setting. this value is added to thebinding:profilefield and passed to services which needs, it, like Nova.updated_atโ timestamp when the port was last updated.
openstack.network.v2.qos_bandwidth_limit_rule
The QoSBandwidthLimitRule Class
the QoSBandwidthLimitRule class inherits from Resource <#openstack.resource.Resource>. and that's where this part leaves you, bestie โ more incoming ๐
class openstack.network.v2.qos_bandwidth_limit_rule.QoSBandwidthLimitRule(_synchronized=False, connection=None, **attrs)
Bestie it's the base resource โ that's genuinely the whole description, no cap. ๐
Parameters ๐ซถ
_synchronizedโ okay so do not use this one directly, fr. Peepnew()andexisting()instead (the page keeps pointing atopenstack.resource.Resource.newandopenstack.resource.Resource.existing).connectionโ the reference to theConnectionbeing used. Defaults toNoneso you can haveResourceobjects with no live connection at all (unit tests love this, lowkey iconic). And if you're writingResourcecode withself._connection, protect yourself with a check forNonefirst. ๐resource_key = 'bandwidth_limit_rule'โ singular form of the key for the resource.resources_key = 'bandwidth_limit_rules'โ plural form of the key for the resource.base_path = '/qos/policies/%(qos_policy_id)s/bandwidth_limit_rules'โ the base part of the URI for this resource.allow_create = Trueโ create operation? allowed, slay.allow_fetch = Trueโ get operation? allowed ๐allow_commit = Trueโ update operation? allowed โจallow_delete = Trueโ delete operation? allowed ๐๏ธallow_list = Trueโ list operation? allowed ๐
Attributes, because yes there are more:
qos_policy_idโ the ID of the QoS policy who owns the rule.max_kbpsโ maximum bandwidth, in kbps.max_burst_kbpsโ maximum burst bandwidth, in kbps.directionโ traffic direction from the project point of view:'egress'or'ingress'.
๐ฆ openstack.network.v2.qos_dscp_marking_rule
The QoSDSCPMarkingRule Class
The QoSDSCPMarkingRule class inherits from Resource (that's openstack.resource.Resource in the link, iykyk).
class openstack.network.v2.qos_dscp_marking_rule.QoSDSCPMarkingRule(_synchronized=False, connection=None, **attrs)
Again: the base resource. Iconic of it honestly.
Parameters ๐ธ
_synchronizedโ not for direct use, bestie, I'm begging. Go throughnew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing) instead.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an active connection (unit tests, we love you). Anyself._connectionuse inResourcecode should guard itself with aNonecheck. ๐resource_key = 'dscp_marking_rule'โ singular form of the key for the resource.resources_key = 'dscp_marking_rules'โ plural form of the key for the resource.base_path = '/qos/policies/%(qos_policy_id)s/dscp_marking_rules'โ the base part of the URI for this resource.allow_create = Trueโ create: allowed โญallow_fetch = Trueโ get: allowed โญallow_commit = Trueโ update: allowed โญallow_delete = Trueโ delete: allowed โญallow_list = Trueโ list: allowed โญqos_policy_idโ the ID of the QoS policy who owns the rule.dscp_markโ the DSCP mark field. That's it, that's the field. ๐
๐ openstack.network.v2.qos_minimum_bandwidth_rule
The QoSMinimumBandwidthRule Class
The QoSMinimumBandwidthRule class inherits from Resource (openstack.resource.Resource).
class openstack.network.v2.qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule(_synchronized=False, connection=None, **attrs)
Say it with me: the base resource.
Parameters ๐
_synchronizedโ nope, don't touch it directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an active connection (hello, unit tests). Any use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'minimum_bandwidth_rule'โ singular form of the key for the resource.resources_key = 'minimum_bandwidth_rules'โ plural form of the key for the resource.base_path = '/qos/policies/%(qos_policy_id)s/minimum_bandwidth_rules'โ the base part of the URI for this resource.allow_create = Trueโ create operation allowed.allow_fetch = Trueโ get operation allowed.allow_commit = Trueโ update operation allowed.allow_delete = Trueโ delete operation allowed.allow_list = Trueโ list operation allowed.qos_policy_idโ the ID of the QoS policy who owns the rule.min_kbpsโ minimum bandwidth, in kbps.directionโ traffic direction from the project point of view. Valid values:'egress'. Just the one, she's exclusive. ๐
๐ง openstack.network.v2.qos_minimum_packet_rate_rule
The QoSMinimumPacketRateRule Class
The QoSMinimumPacketRateRule class inherits from Resource (openstack.resource.Resource).
class openstack.network.v2.qos_minimum_packet_rate_rule.QoSMinimumPacketRateRule(_synchronized=False, connection=None, **attrs)
The base resource. Periodt.
Parameters ๐
_synchronizedโ not intended for direct use, bestie. Checknew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNone, which is what letsResourceobjects exist without an active connection โ like in unit tests. IfResourcecode usesself._connection, it should protect itself with a check forNone.resource_key = 'minimum_packet_rate_rule'โ singular form of the key for the resource.resources_key = 'minimum_packet_rate_rules'โ plural form of the key for the resource.base_path = '/qos/policies/%(qos_policy_id)s/minimum_packet_rate_rules'โ the base part of the URI for this resource.allow_create = Trueโ create operation allowed.allow_fetch = Trueโ get operation allowed.allow_commit = Trueโ update operation allowed.allow_delete = Trueโ delete operation allowed.allow_list = Trueโ list operation allowed.directionโ traffic direction from the project point of view. Valid values:('any', 'egress', 'ingress')โ she's got options, main character energy.min_kppsโ minimum packet rate, in kpps.qos_policy_idโ the ID of the QoS policy who owns the rule.
๐ฅ openstack.network.v2.qos_packet_rate_limit_rule
The QoSPacketRateLimitRule Class
The QoSPacketRateLimitRule class inherits from Resource (openstack.resource.Resource).
class openstack.network.v2.qos_packet_rate_limit_rule.QoSPacketRateLimitRule(_synchronized=False, connection=None, **attrs)
Base resource, we been knew. ๐
Parameters ๐
_synchronizedโ yeah no, not directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can be used without an active connection, e.g. in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'packet_rate_limit_rule'โ singular form of the key for the resource.resources_key = 'packet_rate_limit_rules'โ plural form of the key for the resource.base_path = '/qos/policies/%(qos_policy_id)s/packet_rate_limit_rules'โ the base part of the URI for this resource.allow_create = Trueโ create operation allowed.allow_fetch = Trueโ get operation allowed.allow_commit = Trueโ update operation allowed.allow_delete = Trueโ delete operation allowed.allow_list = Trueโ list operation allowed.qos_policy_idโ the ID of the QoS policy who owns the rule.max_kppsโ maximum packet rate, in kpps.max_burst_kppsโ maximum burst packet rate, in kpps.
๐ openstack.network.v2.qos_policy
The QoSPolicy Class
The QoSPolicy class inherits from Resource (openstack.resource.Resource). Yes queen, the big one.
class openstack.network.v2.qos_policy.QoSPolicy(_synchronized=False, connection=None, **attrs)
And once more with feeling: the base resource.
Parameters ๐ซถ
_synchronizedโ this is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an active connection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'policy'โ singular form of the key for the resource.resources_key = 'policies'โ plural form of the key for the resource.base_path = '/qos/policies'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ green light for the delete operation on this resource. ๐๏ธallow_list = Trueโ and yep, you can list it too. We stay permissive.nameโ the QoS policy name. ๐project_idโ the ID of the project who owns the network. Heads up though: only administrative users can specify a project ID that isn't their own. ๐tenant_idโTenant_id(deprecated attribute). She's old, she's deprecated, she's still in the docs, so here she stays. ๐descriptionโ the QoS policy description. ๐is_defaultโ indicates whether this QoS policy is the default policy for this project.Type: bool๐is_sharedโ indicates whether this QoS policy is shared across all projects.Type: bool๐rulesโ list of QoS rules applied to this QoS policy. ๐
set_tags(session, tags)
Sets/replaces all tags on the resource. Not "adds" โ replaces. Like, the whole tag list, gone, swapped. So maybe don't do that to your fave resource unless you mean it, bestie. ๐ญ
Parameters:
- session โ the session to use for making this request.
- tags (
list) โ list with tags to be set on the resource.
๐ฆ openstack.network.v2.qos_rule_type
The QoSRuleType Class
The QoSRuleType class inherits from Resource <#openstack.resource.Resource>.
class openstack.network.v2.qos_rule_type.QoSRuleType(_synchronized=False,
connection=None, **attrs)
The base resource. Parameters:
- _synchronized โ this is not intended to be used directly. See
new() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ก๏ธ resource_key = 'rule_type'โ singular form of the key for this resource.resources_key = 'rule_types'โ plural form of the key for this resource.base_path = '/qos/rule-types'โ the base part of the URI for this resource.allow_create = Falseโ nope, no creating these.allow_fetch = Trueโ fetching? absolutely, go off. โจallow_commit = Falseโ no updating either.allow_delete = Falseโ and no deleting. Read-only energy, honestly iconic.allow_list = Trueโ but listing is fully allowed. ๐typeโ QoS rule type name.driversโ list of QoS backend drivers supporting this QoS rule type. ๐
๐ openstack.network.v2.quota
The Quota Class
The Quota class inherits from Resource <#openstack.resource.Resource>.
class openstack.network.v2.quota.Quota(_synchronized=False,
connection=None, **attrs)
The base resource. Parameters:
- _synchronized โ this is not intended to be used directly. See
new() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ resource_key = 'quota'โ singular form of the key for this resource.resources_key = 'quotas'โ plural form of the key for this resource.base_path = '/quotas'โ the base part of the URI for this resource.allow_fetch = Trueโ get operation? allowed. ๐allow_commit = Trueโ update operation? allowed.allow_delete = Trueโ delete operation? allowed, queen. ๐allow_list = Trueโ list operation? allowed.check_limitโ flag to check the quota usage before setting the new limit.Type: bool๐ฆfloating_ipsโ the maximum amount of floating IPs you can have.Type: inthealth_monitorsโ the maximum amount of health monitors you can create.Type: intlistenersโ the maximum amount of listeners you can create.Type: intload_balancersโ the maximum amount of load balancers you can create.Type: intl7_policiesโ the maximum amount of L7 policies you can create.Type: intnetworksโ the maximum amount of networks you can create.Type: intpoolsโ the maximum amount of pools you can create.Type: intportsโ the maximum amount of ports you can create.Type: intproject_idโ the ID of the project these quota values are for.tenant_idโTenant_id(deprecated attribute). Still deprecated, still here. ๐rbac_policiesโ the maximum amount of RBAC policies you can create.Type: introuter_routesโ the maximum amount of router routes you can create.Type: introutersโ the maximum amount of routers you can create.Type: intsubnetsโ the maximum amount of subnets you can create.Type: intsubnet_poolsโ the maximum amount of subnet pools you can create.Type: intsecurity_group_rulesโ the maximum amount of security group rules you can create.Type: intsecurity_groupsโ the maximum amount of security groups you can create.Type: int
๐ openstack.network.v2.rbac_policy
The RBACPolicy Class
The RBACPolicy class inherits from Resource <#openstack.resource.Resource>.
class openstack.network.v2.rbac_policy.RBACPolicy(_synchronized=False,
connection=None, **attrs)
The base resource. Parameters:
- _synchronized โ this is not intended to be used directly. See
new() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ซถ resource_key = 'rbac_policy'โ singular form of the key for this resource.resources_key = 'rbac_policies'โ plural form of the key for this resource.base_path = '/rbac-policies'โ the base part of the URI for this resource.allow_create = Trueโ create operation? allowed. โจallow_fetch = Trueโ get operation? allowed.allow_commit = Trueโ update operation? allowed.allow_delete = Trueโ delete operation? allowed.allow_list = Trueโ list operation? allowed. Full send, all five. ๐ฅobject_idโ ID of the object that this RBAC policy affects.target_project_idโ the ID of the project this RBAC will be enforced.project_idโ the owner project ID.tenant_idโTenant_id(deprecated attribute). ๐object_typeโ type of the object that this RBAC policy affects.actionโ action for the RBAC policy.
๐ธ openstack.network.v2.router
The Router Class
The Router class inherits from Resource <#openstack.resource.Resource>.
class openstack.network.v2.router.Router(_synchronized=False,
connection=None, **attrs)
The base resource. Parameters:
- _synchronized โ this is not intended to be used directly. See
new() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. - connection โ reference to the
Connectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone. ๐ง resource_key = 'router'โ singular form of the key for this resource.resources_key = 'routers'โ plural form of the key for this resource.base_path = '/routers'โ the base part of the URI for this resource.allow_create = Trueโ create operation? allowed. ๐allow_fetch = Trueโ get operation? allowed.allow_commit = Trueโ update operation? allowed.allow_delete = Trueโ delete operation? allowed.allow_list = Trueโ list operation? allowed. The full set, no notes. ๐availability_zone_hintsโ availability zone hints to use when scheduling the router.Type: list of availability zone names๐บ๏ธavailability_zonesโ availability zones for the router.Type: list of availability zone namescreated_atโ timestamp when the router was created.descriptionโ the router description. ๐enable_ndp_proxyโ the ndp proxy state of the router.evpn_vniโ the EVPN VNI associated with the router, orNoneif EVPN is not configured.Type: intexternal_gateway_infoโ thenetwork_id, for the external gateway.Type: dictflavor_idโ the ID of the flavor.is_admin_state_upโ the administrative state of the router, which is upTrueor downFalse.Type: boolโฌ๏ธโฌ๏ธis_distributedโ the distributed state of the router, which is distributedTrueor notFalse.Type: boolis_haโ the highly-available state of the router: highly availableTrueor notFalse. Type: bool ๐ธnameโ the router's name, bestie.project_idโ the ID of the project this router is associated with.tenant_idโ Tenant_id (deprecated attribute). ๐ yeah she's old, noted.revision_numberโ revision number of the router. Type: introutesโ the extra routes configuration for the router.statusโ the router status.updated_atโ timestamp when the router was created.add_interface(session, **body)โ add an internal interface to a logical router. ๐ซถ
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the body requested to be updated on the router.
Returns the body of the response as a dictionary.
Raises SDKException <#openstack.exceptions.SDKException> on error.
remove_interface(session, **body)โ remove an internal interface from a logical router.
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the body requested to be updated on the router.
Returns the body of the response as a dictionary.
Raises SDKException <#openstack.exceptions.SDKException> on error.
add_extra_routes(session, body)โ add extra routes to a logical router. โจ
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the request body as documented in the api-ref.
Returns the response as a Router object with the added extra routes.
Raises SDKException <#openstack.exceptions.SDKException> on error.
remove_extra_routes(session, body)โ remove extra routes from a logical router.
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the request body as documented in the api-ref.
Returns the response as a Router object with the extra routes left.
Raises SDKException <#openstack.exceptions.SDKException> on error.
add_gateway(session, **body)โ add an external gateway to a logical router.
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the body requested to be updated on the router.
Returns the body of the response as a dictionary.
remove_gateway(session, **body)โ remove an external gateway from a logical router.
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the body requested to be updated on the router.
Returns the body of the response as a dictionary.
add_external_gateways(session, body)โ add external gateways to a router. ๐ฆ
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the body requested to be updated on the router.
Returns the body of the response as a dictionary.
update_external_gateways(session, body)โ update external gateways of a router.
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the body requested to be updated on the router.
Returns the body of the response as a dictionary.
remove_external_gateways(session, body)โ remove external gateways from a router.
Parameters
session(Adapter) โ the session to communicate through.body(dict) โ the body requested to be updated on the router.
Returns the body of the response as a dictionary.
๐ openstack.network.v2.security_group
๐ The SecurityGroup Class
okay so the SecurityGroup class inherits from Resource <#openstack.resource.Resource> โ classic inheritance moment, we love to see it ๐
class openstack.network.v2.security_group.SecurityGroup(_synchronized=False, connection=None, **attrs)
The base resource. ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone. ๐ซถresource_key = 'security_group'โ singular form of key for resource.resources_key = 'security_groups'โ plural form of key for resource.base_path = '/security-groups'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.created_atโ timestamp when the security group was created.descriptionโ the security group description.nameโ the security group name.statefulโ whether the security group is stateful or not.project_idโ the ID of the project this security group is associated with.security_group_rulesโ a list ofSecurityGroupRule <#openstack.network.v2.security_group_rule.SecurityGroupRule>objects. Type: list ๐ธtenant_idโ the ID of the project this security group is associated with.updated_atโ timestamp when the security group was last updated.is_sharedโ indicates whether this Security Group is shared across all projects. Type: bool
๐ openstack.network.v2.security_group_rule
๐ The SecurityGroupRule Class
and the SecurityGroupRule class also inherits from Resource <#openstack.resource.Resource> โ family business fr fr ๐
class openstack.network.v2.security_group_rule.SecurityGroupRule(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = 'security_group_rule'โ singular form of key for resource.resources_key = 'security_group_rules'โ plural form of key for resource.base_path = '/security-group-rules'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Falseโ allow update operation for this resource. nope, no updating this one ๐allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.created_atโ timestamp when the security group rule was created.descriptionโ the security group rule description.directionโingressoregress: the direction in which the security group rule is applied. For a compute instance, an ingress security group rule is applied to incoming ingress traffic for that instance. An egress rule is applied to traffic leaving the instance. ๐ชโจether_typeโ must beIPv4orIPv6, and addresses represented in CIDR must match the ingress or egress rules.port_range_maxโ the maximum port number in the range that is matched by the security group rule. Theport_range_minattribute constrains theport_range_maxattribute. If the protocol is ICMP, this value must be an ICMP type.port_range_minโ the minimum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of theport_range_maxattribute. If the protocol is ICMP, this value must be an ICMP type.project_idโ the ID of the project this security group rule is associated with.protocolโ the protocol that is matched by the security group rule. Valid values arenull,tcp,udp, andicmp. ๐ฅremote_group_idโ The remote security group ID to be associated with this security group rule. You can specify eitherremote_group_idorremote_address_group_idorremote_ip_prefix.remote_address_group_idโ The remote address group ID to be associated with this security group rule. You can specify eitherremote_group_idorremote_address_group_idorremote_ip_prefix.remote_ip_prefixโ The remote IP prefix to be associated with this security group rule. You can specify eitherremote_group_idorremote_address_group_idorremote_ip_prefix. This attribute matches the specified IP prefix as the source or destination IP address of the IP packet depending ondirection.security_group_idโ The security group ID to associate with this security group rule.tenant_idโ The ID of the project this security group rule is associated with.updated_atโ Timestamp when the security group rule was last updated.
๐ธ openstack.network.v2.segment
The Segment Class
The Segment class inherits from Resource.
class openstack.network.v2.segment.Segment(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'segment'โ Singular form of key for resource.resources_key = 'segments'โ Plural form of key for resource.base_path = '/segments'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.descriptionโ The segment description.nameโ The segment name.network_idโ The ID of the network associated with this segment.network_typeโ The type of network associated with this segment, such asflat,geneve,gre,local,vlanorvxlan.physical_networkโ The name of the physical network associated with this segment.segmentation_idโ The segmentation ID for this segment. The network type defines the segmentation model, VLAN ID forvlannetwork type and tunnel ID forgeneve,greandvxlannetwork types. Type:int.
๐ openstack.network.v2.service_profile
The ServiceProfile Class
The ServiceProfile class inherits from Resource.
class openstack.network.v2.service_profile.ServiceProfile(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'service_profile'โ Singular form of key for resource.resources_key = 'service_profiles'โ Plural form of key for resource.base_path = '/service_profiles'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.descriptionโ Description of the service flavor profile.driverโ Provider driver for the service flavor profile.is_enabledโ Sets enabled flag.meta_infoโ Metainformation of the service flavor profile.project_idโ The owner project ID.tenant_idโTenant_id(deprecated attribute).
๐ฆ openstack.network.v2.service_provider
The Service Provider Class
The ServiceProvider class inherits from Resource.
class openstack.network.v2.service_provider.ServiceProvider(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resources_key = 'service_providers'โ Plural form of key for resource.base_path = '/service-providers'โ The base part of the URI for this resource.allow_create = Falseโ Allow create operation for this resource.allow_fetch = Falseโ Allow get operation for this resource.allow_commit = Falseโ Allow update operation for this resource.allow_delete = Falseโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.service_typeโ Service type (FIREWALL,FLAVORS,METERING,QOS, etc..).nameโ Name of the service type.is_defaultโ The default value of service type.
๐ openstack.network.v2.sfc_flow_classifier
The SfcFlowClassifier Class
The SfcFlowClassifier class inherits from Resource.
class openstack.network.v2.sfc_flow_classifier.SfcFlowClassifier(_synchronized=False,
connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()andexisting().connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'flow_classifier'โ Singular form of key for resource.resources_key = 'flow_classifiers'โ Plural form of key for resource.base_path = '/sfc/flow_classifiers'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.descriptionโ Human-readable description for the resource.nameโ Human-readable name of the resource. Default is an empty string.protocolโ The IP protocol can be represented by a string, an integer, ornull. Valid values:any(0),ah(51),dccp(33),egp(8),esp(50),gre(47),icmp(1),icmpv6(58),igmp(2),ipip(4),ipv6-encap(41),ipv6-frag(44),ipv6-icmp(58),ipv6-nonxt(59),ipv6-opts(60),ipv6-route(43),ospf(89),pgm(113),rsvp(46),sctp(132),tcp(6),udp(17),udplite(136),vrrp(112).source_port_range_minโ Minimum source protocol port.source_port_range_maxโ Maximum source protocol port.destination_port_range_minโ Minimum destination protocol port.destination_port_range_maxโ Maximum destination protocol port.source_ip_prefixโ The source IP prefix.destination_ip_prefixโ The destination IP prefix.logical_source_portโ The UUID of the source logical port.logical_destination_portโ The UUID of the destination logical port.l7_parametersโ A dictionary of L7 parameters, in the form oflogical_source_network: uuid,logical_destination_network: uuid.summaryโ Summary field of a Flow Classifier, composed of the protocol, source protocol port, destination protocol port,logical_source_port,logical_destination_portandl7_parameters.tenant_idโTenant_id(deprecated attribute).
๐ openstack.network.v2.sfc_port_chain
The SfcPortChain Class
The SfcPortChain class inherits from Resource.
openstack.network.v2.sfc_port_chain โ the SfcPortChain Class ๐
Lowkey obsessed with this one. It inherits from Resource (iykyk).
class openstack.network.v2.sfc_port_chain.SfcPortChain(_synchronized=False, connection=None, **attrs)
โจ The base resource
Parameters โ yes bestie, same two as always:
_synchronizedโ do not use this directly, fr fr. Peepnew()andexisting()instead.connectionโ a reference to theConnectionbeing used. Defaults toNoneso Resource objects can exist without an active Connection (think unit tests ๐งช). Any use ofself._connectioninside Resource code should protect itself with aNonecheck.
The class attributes, no cap:
resource_key='port_chain'โ the singular form of the key for this resource.resources_key='port_chains'โ the plural form, periodt.base_path='/sfc/port_chains'โ the base part of the URI for this resource.allow_create=Trueโ create is allowed.allow_fetch=Trueโ get is allowed.allow_commit=Trueโ update is allowed.allow_delete=Trueโ delete is allowed.allow_list=Trueโ list is allowed. all five? she ate.
And the actual data fields:
descriptionโ human-readable description for the resource.nameโ human-readable name of the resource. Default is an empty string.port_pair_groupsโ list of port-pair-group UUIDs.flow_classifiersโ list of flow-classifier UUIDs.chain_parametersโ a dictionary of chain parameters;correlationvalues can bemplsandnsh,symmetriccan beTrueorFalse.tenant_idโ Tenant_id (deprecated attribute โ ๏ธ she's old, we still list her).
openstack.network.v2.sfc_port_pair โ the SfcPortPair Class ๐ฆ
Inherits from Resource, obviously.
class openstack.network.v2.sfc_port_pair.SfcPortPair(_synchronized=False, connection=None, **attrs)
โจ The base resource
Parameters:
_synchronizedโ not for direct use, bestie. Seenew()andexisting().connectionโ reference to theConnectionin play. Defaults toNoneso Resource objects can chill without an active Connection, like in unit tests. Guard anyself._connectionusage in Resource code with aNonecheck.
Class attributes:
resource_key='port_pair'โ singular key form.resources_key='port_pairs'โ plural key form.base_path='/sfc/port_pairs'โ base part of the URI.allow_create=Trueallow_fetch=Trueallow_commit=Trueallow_delete=Trueallow_list=Trueโ every operation green-lit, we love a flexible queen ๐
Fields:
descriptionโ human-readable description for the resource.nameโ human-readable name. Default is an empty string.ingressโ the UUID of the ingress Neutron port.egressโ the UUID of the egress Neutron port.service_function_parametersโ a dictionary of service function parameters.correlationvalues can bemplsandnsh;weightcan be an int.tenant_idโ Tenant_id (deprecated attribute).
openstack.network.v2.sfc_port_pair_group โ the SfcPortPairGroup Class ๐
Inherits from Resource.
class openstack.network.v2.sfc_port_pair_group.SfcPortPairGroup(_synchronized=False, connection=None, **attrs)
โจ The base resource
Parameters:
_synchronizedโ seriously, don't touch it directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNone, so Resource objects work without an active Connection (unit tests, hii ๐).self._connectionin Resource code should check forNonefirst.
Class attributes:
resource_key='port_pair_group'โ singular key form.resources_key='port_pair_groups'โ plural key form.base_path='/sfc/port_pair_groups'โ base part of the URI.allow_create=Trueallow_fetch=Trueallow_commit=Trueallow_delete=Trueallow_list=True
Fields:
descriptionโ human-readable description for the resource.nameโ human-readable name. Default is an empty string.port_pairsโ list of port-pair UUIDs.port_pair_group_parametersโ dictionary of port pair group parameters, shaped likelb_fields: list of regex(eth|ip|tcp|udp)_(src|dst), andppg_n_tuple_mapping:ingress_n_tupleoregress_n_tuple. The ingress or egress tuple is a dict with these keys:source_ip_prefix,destination_ip_prefix,source_port_range_min,source_port_range_max,destination_port_range_min,destination_port_range_max. (Yeah it's a lot โ copy them exact, bestie.)is_tap_enabledโTrueif passive Tap service functions support is enabled; default isFalse.tenant_idโ Tenant_id (deprecated attribute).
openstack.network.v2.sfc_service_graph โ the SfcServiceGraph Class ๐
Inherits from Resource. Main character energy, honestly.
class openstack.network.v2.sfc_service_graph.SfcServiceGraph(_synchronized=False, connection=None, **attrs)
โจ The base resource
Parameters:
_synchronizedโ not intended for direct use. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an active Connection, e.g. in unit tests. Use ofself._connectionin Resource code should protect itself with aNonecheck.
Class attributes:
resource_key='service_graph'โ singular key form.resources_key='service_graphs'โ plural key form.base_path='/sfc/service_graphs'โ base part of the URI.allow_create=Trueallow_fetch=Trueallow_commit=Trueallow_delete=Trueallow_list=True
Fields:
descriptionโ human-readable description for the resource.nameโ human-readable name. Default is an empty string.port_chainsโ a dictionary where the key is the source port chain and the value is a list of destination port chains.tenant_idโ Tenant_id (deprecated attribute).
openstack.network.v2.subnet โ the Subnet Class ๐ซถ
The icon herself. Inherits from Resource.
class openstack.network.v2.subnet.Subnet(_synchronized=False, connection=None, **attrs)
โจ The base resource
Parameters:
_synchronizedโ do not use directly, please and thank you. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
Class attributes:
resource_key='subnet'โ singular key form for the resource.resources_key='subnets'โ plural key form for the resource.base_path='/subnets'โ the base part of the URI for this resource.allow_create=Trueโ allow create for this resource.allow_fetch=Trueโ allow get for this resource.allow_commit=Trueโ allow update for this resource.allow_delete=Trueโ allow delete for this resource.allow_list=Trueโ allow list for this resource.
Fields (get comfy, there's a bunch):
allocation_poolsโ list of allocation pools, each of which has a start and an end address for this subnet.cidrโ the CIDR.created_atโ timestamp when the subnet was created.descriptionโ the subnet description.dns_nameserversโ a list of DNS nameservers.dns_publish_fixed_ipโ whether to publish DNS records for fixed IPs.gateway_ipโ the gateway IP address.host_routesโ a list of host routes.
okay so the subnet attributes finish out like this:
ip_versionโ the IP version, which is4or6. Type:intipv6_address_modeโ the IPv6 address modes which are'dhcpv6-stateful','dhcpv6-stateless'or'slaac'.ipv6_ra_modeโ the IPv6 router advertisements modes which can be'slaac','dhcpv6-stateful','dhcpv6-stateless'.is_dhcp_enabledโ set toTrueif DHCP is enabled andFalseif DHCP is disabled. Type:boolnameโ the subnet name.network_idโ the ID of the attached network.prefix_lengthโ the prefix length to use for subnet allocation from a subnet poolproject_idโ the ID of the project this subnet is associated with.tenant_idโTenant_id(deprecated attribute). โ ๏ธsegment_idโ the ID of the segment this subnet is associated with.service_typesโ service types for this subnetsubnet_pool_idโ the subnet pool ID from which to obtain a CIDR.updated_atโ timestamp when the subnet was last updated.use_default_subnet_poolโ whether to use the default subnet pool to obtain a CIDR.
๐ธ openstack.network.v2.subnet_pool ๐ธ
๐ The SubnetPool Class
the SubnetPool class inherits from Resource. periodt.
class openstack.network.v2.subnet_pool.SubnetPool(_synchronized=False,
connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'subnetpool'โ singular form of key for resource. โจresources_key = 'subnetpools'โ plural form of key for resource.base_path = '/subnetpools'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.address_scope_idโ the ID of the address scope associated with the subnet pool.created_atโ timestamp when the subnet pool was created.default_prefix_lengthโ the length of the prefix to allocate when thecidrorprefixlenattributes are omitted when creating a subnet. Type:intdefault_quotaโ a per-project quota on the prefix space that can be allocated from the subnet pool for project subnets. For IPv4 subnet pools,default_quotais measured in units of/32. For IPv6 subnet pools,default_quotais measured units of/64. All projects that use the subnet pool have the same prefix quota applied. Type:intdescriptionโ the subnet pool description.ip_versionโ Read-only. the IP address family of the list of prefixes. Type:intis_defaultโ whether or not this is the default subnet pool. Type:boolis_sharedโ indicates whether this subnet pool is shared across all projects. Type:boolmaximum_prefix_lengthโ the maximum prefix length that can be allocated from the subnet pool. Type:intminimum_prefix_lengthโ the minimum prefix length that can be allocated from the subnet pool. Type:intnameโ the subnet pool name.project_idโ the ID of the project that owns the subnet pool.tenant_idโTenant_id(deprecated attribute). โ ๏ธprefixesโ a list of subnet prefixes that are assigned to the subnet pool. The adjacent prefixes are merged and treated as a single prefix. Type:listrevision_numberโ revision number of the subnet pool. Type:intupdated_atโ timestamp when the subnet pool was last updated.
๐ง subnet_onboard(session, **body)
onboard network subnets into a subnet pool. it's giving admin magic โจ
Parameters
session(Adapter) โ the session to communicate through.bodyโ the request body (network_id).
Returns โ the response body as a dictionary.
Raises โ SDKException on error.
๐ฆ openstack.network.v2.tap_flow ๐ฆ
๐ The TapFlow Class
the TapFlow class inherits from Resource.
class openstack.network.v2.tap_flow.TapFlow(_synchronized=False,
connection=None, **attrs)
Tap Flow
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'tap_flow'โ singular form of key for resource.resources_key = 'tap_flows'โ plural form of key for resource.base_path = '/taas/tap_flows'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.idโ the ID of the tap flow.nameโ the tap flow's name.descriptionโ the tap flow's description.project_idโ the ID of the project that owns the tap flow.tenant_idโTenant_id(deprecated attribute). โ ๏ธtap_service_idโ the id of thetap_servicewith which the tap flow is associateddirectionโ the direction of the tap flow.statusโ the status for the tap flow.source_portโ the id of the port the tap flow is associated with
๐ openstack.network.v2.tap_mirror ๐
๐ The TapMirror Class
the TapMirror class inherits from Resource.
class openstack.network.v2.tap_mirror.TapMirror(_synchronized=False,
connection=None, **attrs)
Tap Mirror
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'tap_mirror'โ singular form of key for resource.resources_key = 'tap_mirrors'โ plural form of key for resource.base_path = '/taas/tap_mirrors'โ the base part of the URI for this resource.allow_create = Trueโ allow create operation for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allow_list = Trueโ allow list operation for this resource.idโ the ID of the Tap Mirror.nameโ the Tap Mirror name.descriptionโ the Tap Mirror description.project_idโ the ID of the project that owns the Tap Mirror.tenant_idโTenant_id(deprecated attribute). โ ๏ธport_idโ the id of the port the Tap Mirror is associated withdirectionsโ the status for the tap service.remote_ipโ the destination IP address of the Tap Mirrormirror_typeโ the type of the Tap Mirror, it can begreorerspanv1
๐ openstack.network.v2.tap_service ๐
๐ซถ The TapService Class
the TapService class inherits from Resource.
class openstack.network.v2.tap_service.TapService(_synchronized=False,
connection=None, **attrs)
Tap Service
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'tap_service'โ the singular form of the key for this resource, iykyk โจresources_key = 'tap_services'โ and the plural form of the key for the resource ๐base_path = '/taas/tap_services'โ the base part of the URI for this resource, literally just that ๐allow_create = Trueโ yep, create operations are allowed on this one ๐ซถallow_fetch = Trueโ and get operations too, no capallow_commit = Trueโ update operations? allowed. slay โจallow_delete = Trueโ delete operations also on the menu ๐allow_list = Trueโ and listing, obviously, it's giving full permissions ๐idโ the ID of the tap service ๐ฅnameโ the tap service name ๐ธdescriptionโ the tap service description ๐project_idโ the ID of the project that owns the tap service ๐tenant_idโ Tenant_id, and bestie it's a deprecated attribute, so likeโฆ noted ๐port_idโ the id of the port the tap service is associated with ๐ฆstatusโ the status for the tap service โญ
๐ฆ VPNaaS Resources ๐ฆ
๐ธ openstack.network.v2.vpn_endpoint_group ๐ธ
The VpnEndpointGroup Class โจ
The VpnEndpointGroup class inherits from Resource <#openstack.resource.Resource>. Inheritance, we love to see it ๐
class openstack.network.v2.vpn_endpoint_group.VpnEndpointGroup(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly, fr fr. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. It defaults toNoneso that Resource objects can be used without an active Connection, like in unit tests ๐ง. Any use ofself._connectionin Resource code should protect itself with a check forNone๐resource_key = 'endpoint_group'โ singular form of key for resource โจresources_key = 'endpoint_groups'โ plural form of key for resource ๐base_path = '/vpn/endpoint-groups'โ the base part of the URI for this resource ๐allow_create = Trueโ allow create operation for this resource ๐ซถallow_fetch = Trueโ allow get operation for this resource ๐ธallow_commit = Trueโ allow update operation for this resource โจallow_delete = Trueโ allow delete operation for this resource ๐allow_list = Trueโ allow list operation for this resource โญdescriptionโ human-readable description for the resource ๐endpointsโ list of endpoints of the same type, for the endpoint group. The values will depend ontype๐ฆnameโ human-readable name of the resource. Default is an empty string ๐tenant_idโ Tenant_id, and yes it's a deprecated attribute ๐typeโ the type of the endpoints in the group. A valid value issubnet,cidr,network,router, orvlan. Onlysubnetandcidrare supported at this moment, so don't get cute with the others ๐
๐ openstack.network.v2.vpn_ike_policy ๐
The VpnIkePolicy Class โจ
The VpnIkePolicy class inherits from Resource <#openstack.resource.Resource>. iconic behavior ๐
class openstack.network.v2.vpn_ike_policy.VpnIkePolicy(_synchronized=False, connection=None, **attrs)
VPN IKE policy extension. ๐ฅ
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests ๐ง. Use ofself._connectionin Resource code should protect itself with a check forNone๐resource_key = 'ikepolicy'โ singular form of key for resource โจresources_key = 'ikepolicies'โ plural form of key for resource ๐base_path = '/vpn/ikepolicies'โ the base part of the URI for this resource ๐allow_create = Trueโ allow create operation for this resource ๐ซถallow_fetch = Trueโ allow get operation for this resource ๐ธallow_commit = Trueโ allow update operation for this resource โจallow_delete = Trueโ allow delete operation for this resource ๐allow_list = Trueโ allow list operation for this resource โญike_versionโ the IKE version. A valid value isv1orv2. Default isv1๐ฆnameโ human-readable name of the resource. Default is an empty string ๐project_idโ the ID of the project ๐phase1_negotiation_modeโ the IKE mode. A valid value ismain, which is the default ๐
๐ openstack.network.v2.vpn_ipsec_policy ๐
The VpnIpsecPolicy Class โจ
The VpnIpsecPolicy class inherits from Resource <#openstack.resource.Resource>. we stan a class hierarchy ๐
class openstack.network.v2.vpn_ipsec_policy.VpnIpsecPolicy(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, fr fr. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests ๐ง. Use ofself._connectionin Resource code should protect itself with a check forNone๐resource_key = 'ipsecpolicy'โ singular form of key for resource โจresources_key = 'ipsecpolicies'โ plural form of key for resource ๐base_path = '/vpn/ipsecpolicies'โ the base part of the URI for this resource ๐allow_create = Trueโ allow create operation for this resource ๐ซถallow_fetch = Trueโ allow get operation for this resource ๐ธallow_commit = Trueโ allow update operation for this resource โจallow_delete = Trueโ allow delete operation for this resource ๐allow_list = Trueโ allow list operation for this resource โญencapsulation_modeโ the encapsulation mode. A valid value istunnelortransport๐ฆnameโ human-readable name of the resource. Default is an empty string ๐project_idโ the ID of the project ๐phase1_negotiation_modeโ the IKE mode. A valid value ismain, which is the default ๐transform_protocolโ the transform protocol. A valid value isESP,AH, orAH-ESP๐ฅ
๐ openstack.network.v2.vpn_ipsec_site_connection ๐
The VpnIPSecSiteConnection Class โจ
The VpnIPSecSiteConnection class inherits from Resource <#openstack.resource.Resource>. long name but she's valid ๐
class openstack.network.v2.vpn_ipsec_site_connection.VpnIPSecSiteConnection(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, bestie. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests ๐ง. Use ofself._connectionin Resource code should protect itself with a check forNone๐resource_key = 'ipsec_site_connection'โ singular form of key for resource โจresources_key = 'ipsec_site_connections'โ plural form of key for resource ๐base_path = '/vpn/ipsec-site-connections'โ the base part of the URI for this resource ๐allow_create = Trueโ allow create operation for this resource ๐ซถallow_fetch = Trueโ allow get operation for this resource ๐ธallow_commit = Trueโ allow update operation for this resource โจallow_delete = Trueโ allow delete operation for this resource ๐allow_list = Trueโ allow list operation for this resource โญdpdโ a dictionary with dead peer detection (DPD) protocol controls ๐ (the acronym really said ๐)ikepolicy_idโ the ID of the IKE policy ๐ฆipsecpolicy_idโ the ID of the IPsec policy ๐ฆpeer_addressโ the peer gateway public IPv4 or IPv6 address or FQDN ๐ธnameโ human-readable name of the resource. Default is an empty string ๐project_idโ the ID of the project ๐pskโ the pre-shared key. A valid value is any string ๐ฅroute_modeโ the route mode. A valid value isstatic, which is the default ๐statusโ the site connection status โญvpnservice_idโ the ID of the VPN service ๐ซถ
๐ openstack.network.v2.vpn_service ๐
The VpnService Class โจ
The VpnService class inherits from Resource <#openstack.resource.Resource>. main character energy, honestly ๐
class openstack.network.v2.vpn_service.VpnService(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, fr. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests ๐ง. Use ofself._connectionin Resource code should protect itself with a check forNone๐resource_key = 'vpnservice'โ singular form of key for resource โจresources_key = 'vpnservices'โ the plural form of the key for this resource, bestie โจbase_path = '/vpn/vpnservices'โ the base part of the URI for this resource, slay ๐allow_create = Trueโ create operation? allowed, periodt ๐allow_fetch = Trueโ get operation? also allowed, we love to see it ๐allow_commit = Trueโ update operation? green light, no cap ๐ขallow_delete = Trueโ delete operation? yes babes, go off ๐ฅallow_list = Trueโ list operation? obviously, she contains multitudes โญdescriptionโ a human-readable description for the vpnservice, literally just words for humans ๐ซถexternal_v4_ipโ the external IPv4 address that's used for the VPN service ๐external_v6_ipโ the external IPv6 address that's used for the VPN service, her sibling ๐ฆis_admin_state_upโ the administrative state of the vpnservice, which is upTrueor downFalse. Type:bool๐nameโ the vpnservice name, iconic as always ๐router_idโ ID of the router into which the VPN service is inserted ๐project_idโ the ID of the project this vpnservice is associated with ๐ท๏ธtenant_idโ Tenant_id (deprecated attribute). It's giving vintage, but deprecated is deprecated, so note it and move on ๐statusโ the vpnservice status, her current mood basically ๐subnet_idโ the ID of the subnet on which the tenant wants the vpnservice ๐ธ
๐ง Orchestration Resources ๐ง
๐ openstack.orchestration.v1.resource
The Resource Class
The Resource class inherits from Resource <#openstack.resource.Resource>. Family tree: noted ๐
class openstack.orchestration.v1.resource.Resource(_synchronized=False, connection=None, **attrs)
The base resource, aka the blueprint every other bb takes after ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>instead, bestie, don't touch it ๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNoneโ ๏ธresource_key = 'resource'โ singular form of key for resource โจresources_key = 'resources'โ plural form of key for resource, matching set ๐base_path = '/stacks/%(stack_name)s/%(stack_id)s/resources'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Falseโ create operation? not for this one, she said no ๐ซallow_list = Trueโ list operation? yes ma'am ๐allow_delete = Falseโ delete operation? nope ๐allow_commit = Falseโ update operation? also nope, we respect the boundaries ๐linksโ a list of dictionaries containing links relevant to the resource ๐logical_resource_idโ ID of the logical resource, usually the literal name of the resource as it appears in the stack template ๐nameโ name of the resource, short and sweet ๐physical_resource_idโ ID of the physical resource (if any) that backs up the resource. For example, it contains a nova server ID if the resource is a nova server ๐ฅ๏ธrequired_byโ a list of resource names that depend on this resource. This property facilitates the deduction of resource dependencies. Type:list๐งresource_typeโ a string representation of the resource type ๐คstatusโ a string representing the status the resource is currently in ๐status_reasonโ a string that explains why the resource is in its current status. The "why tho" field, honestly ๐ญupdated_atโ timestamp of the last update made to the resource ๐ฐ๏ธ
๐ฆ openstack.orchestration.v1.software_config
The SoftwareConfig Class
The SoftwareConfig class inherits from Resource <#openstack.resource.Resource>. Another nepo baby, but make it config ๐
class openstack.orchestration.v1.software_config.SoftwareConfig(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNoneโ ๏ธresource_key = 'software_config'โ singular form of key for resource โจresources_key = 'software_configs'โ plural form of key for resource ๐base_path = '/software_configs'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ create operation? absolutely, go off ๐ฅallow_list = Trueโ list operation? yes babes ๐allow_fetch = Trueโ get operation? mhm ๐ซถallow_delete = Trueโ delete operation? she can, and she will ๐allow_commit = Falseโ update operation? not here, no thank you ๐ซcreate_opts = CreateOpts(request_key=None, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate()โ๏ธconfigโ configuration script or manifest that defines which configuration is performed ๐created_atโ the date and time when the software config resource was created ๐ฐ๏ธgroupโ a string indicating the namespace used for grouping software configs ๐๏ธinputsโ a list of schemas each representing an input this software config expects ๐ฅnameโ name of the software config ๐optionsโ a string that contains options that are specific to the configuration management tool that this resource uses ๐งoutputsโ a list of schemas each representing an output this software config produces ๐ค
โญ openstack.orchestration.v1.software_deployment
The SoftwareDeployment Class
The SoftwareDeployment class inherits from Resource <#openstack.resource.Resource>. Okay deploy queen ๐
class openstack.orchestration.v1.software_deployment.SoftwareDeployment(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>๐connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNoneโ ๏ธresource_key = 'software_deployment'โ singular form of key for resource โจresources_key = 'software_deployments'โ plural form of key for resource ๐base_path = '/software_deployments'โ the base part of the URI for this resource ๐ฃ๏ธallow_create = Trueโ create operation? yup ๐allow_list = Trueโ list operation? yup ๐ซถallow_fetch = Trueโ get operation? yup ๐ธallow_delete = Trueโ delete operation? yup, she's thorough ๐allow_commit = Trueโ update operation? also yup, full send ๐ฅcreate_opts = CreateOpts(request_key=None, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate()โ๏ธactionโ the stack action that triggers this deployment resource ๐ฌconfig_idโ the UUID of the software config resource that runs when applying to the server ๐input_valuesโ a map containing the names and values of all inputs to the config ๐บ๏ธoutput_valuesโ a map containing the names and values from the deployment ๐คserver_idโ the UUID of the compute server to which the configuration applies ๐ฅ๏ธstack_user_project_idโ the ID of the authentication project which can also perform operations on this deployment ๐statusโ current status of the software deployment ๐status_reasonโ error description for the last status change. Like, what went wrong and why ๐ญcreated_atโ the date and time when the software deployment resource was created ๐ฐ๏ธupdated_atโ the date and time when the software deployment resource was created (yes, that's literally what the original says, we're not editing it, fr fr) ๐
commit(session, prepend_key=False, *args, **kwargs)
Commit the state of the instance to the remote resource. Sending her off into the world ๐๏ธ
Parameters
sessionโ the session to use for making this request ๐prepend_keyโ whether theresource_key <#openstack.resource.Resource.resource_key>should be prepended in a resource creation request. Default toTrue๐๏ธretry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). Value ofNoneleaves the Adapter defaults ๐base_pathโ base part of the URI for modifying resources, if it's different frombase_path<#openstack.resource.Resource.base_path>.microversionโ the API version to override the negotiated one.attrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns โ this Resource instance. ๐ซถ
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True.
๐ openstack.orchestration.v1.stack
๐ The Stack Class
okay so the Stack class lowkey inherits from Resource <#openstack.resource.Resource>, which is giving "child of a legend" energy fr fr.
class openstack.orchestration.v1.stack.Stack(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters:
_synchronizedโ this is not intended to be used directly, bestie. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. It defaults toNoneso that Resource objects can be used without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key='stack'โ singular form of key for resource.resources_key='stacks'โ plural form of key for resource.base_path='/stacks'โ the base part of the URI for this resource.allow_create=Trueโ allow create operation for this resource.allow_list=Trueโ allow list operation for this resource.allow_fetch=Trueโ allow get operation for this resource.allow_commit=Trueโ allow update operation for this resource.allow_delete=Trueโ allow delete operation for this resource.create_opts=CreateOpts(request_key=None, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)โ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate(). very much "configure, don't rewrite" energy โจcapabilitiesโ placeholder for AWS compatible template listing capabilities required by the stack.created_atโ timestamp of the stack creation.descriptionโ a text description of the stack.deletedโ a list of resource objects that will be deleted if a stack update is performed.deleted_atโ timestamp of the stack deletion.environmentโ a JSON environment for the stack.environment_filesโ an ordered list of names for environment files found in thefilesdict.filesโ additional files referenced in the template or the environment.files_containerโ name of the container in swift that has child templates and environment files.is_rollback_disabledโ whether the stack will support a rollback operation on stack create/update failures. Type:boollinksโ a list of dictionaries containing links relevant to the stack.nameโ name of the stack.notification_topicsโ placeholder for future extensions where stack related events can be published.outputsโ a list containing output keys and values from the stack, if any.owner_idโ the ID of the owner stack if any.parametersโ a dictionary containing the parameter names and values for the stack.parent_idโ the ID of the parent stack if any.replacedโ a list of resource objects that will be replaced if a stack update is performed.statusโ a string representation of the stack status, e.g.CREATE_COMPLETE.status_reasonโ a text explaining how the stack transits to its current status.tagsโ a list of strings used as tags on the stack.templateโ a dict containing the template use for stack creation.template_descriptionโ stack template description text. Currently contains the same text as that of thedescriptionproperty.template_urlโ a string containing the URL where a stack template can be found.timeout_minsโ stack operation timeout in minutes.unchangedโ a list of resource objects that will remain unchanged if a stack update is performed.updatedโ a list of resource objects that will have their properties updated in place if a stack update is performed.updated_atโ timestamp of last update on the stack.user_project_idโ the ID of the user project created for this stack.
commit(session, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None, preview=False, **kwargs)
Commit the state of the instance to the remote resource. like, actually push it up there ๐
Parameters:
sessionโ the session to use for making this request.prepend_keyโ whether theresource_key<#openstack.resource.Resource.resource_key> should be prepended in a resource creation request. Defaults toTrue.retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults.base_pathโ base part of the URI for modifying resources, if it's different frombase_path<#openstack.resource.Resource.base_path>.microversionโ the API version to override the negotiated one.attrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns โ this Resource instance.
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True.
export(session)
Export a stack data ๐
Parameters:
sessionโ the session to use for making this request.
Returns โ a dictionary containing the stack data.
suspend(session)
Suspend a stack ๐ด
Parameters:
sessionโ the session to use for making this request
Returns โ None
resume(session)
Resume a stack โญ (wake up bestie, we're going back in)
Parameters:
sessionโ the session to use for making this request
Returns โ None
fetch(session, requires_id=True, base_path=None, error_message=None, skip_cache=False, *, resolve_outputs=True, **params)
Get a remote resource based on this instance. ๐ฅ
Parameters:
sessionโ the session to use for making this request.requires_idโ whether resource ID should be part of the requested URI.base_pathโ base part of the URI for fetching resources, if it's different frombase_path<#openstack.resource.Resource.base_path>.error_messageโ an error message to be returned if requested object does not exist.skip_cacheโ a boolean indicating whether optional API cache should be skipped for this invocation.resource_response_keyโ overrides the usage ofself.resource_keywhen processing the response body.microversionโ the API version to override the negotiated one.paramsโ additional parameters that can be consumed.
Returns โ this Resource instance.
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_fetch is not set to True.
Raises NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found.
classmethod find(session, name_or_id, ignore_missing=True, list_base_path=None, *, microversion=None, all_projects=None, **params)
Find a resource by its name or id. ๐ต๏ธโโ๏ธ the scavenger hunt but make it API
Parameters:
session(Adapter) โ the session to use for making this request.name_or_idโ this resource's identifier, if needed by the request. The default isNone.ignore_missing(bool) โ when set toFalse,NotFoundException<#openstack.exceptions.NotFoundException> will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource.params(dict) โ literally any extra params you want passed down into the underlying methods, like intoexisting()when you're trying to hand off URI parameters. ๐ซถ
Returns โ the Resource object that matches the name or id you gave it, or None if nothing matches. Ngl, None is a real possibility here. ๐ญ
Raises openstack.exceptions.DuplicateResource โ if more than one resource comes back for this request. Like, bestie, pick one. ๐
Raises openstack.exceptions.NotFoundException โ if nothing is found and ignore_missing is False.
๐ openstack.orchestration.v1.stack_environment
๐ The StackEnvironment Class
The StackEnvironment class inherits from Resource. Iconic inheritance moment, we love to see it. ๐
class openstack.orchestration.v1.stack_environment.StackEnvironment(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ okay so this one is not meant to be used directly, fr fr. Seenew()andexisting()instead.connectionโ a reference to theConnectionbeing used. Defaults toNonesoResourceobjects can vibe without an activeConnection, like in unit tests. And any use ofself._connectioninResourcecode should protect itself with a check forNone. Lowkey important. ๐ซถ
base_path = '/stacks/%(stack_name)s/%(stack_id)s/environment' โ the base part of the URI for this resource.
allow_create = False โ allow create operation for this resource.
allow_list = False โ allow list operation for this resource.
allow_fetch = True โ allow get operation for this resource. โ
allow_delete = False โ allow delete operation for this resource.
allow_commit = False โ allow update operation for this resource.
name โ name of the stack where the template is referenced.
id โ ID of the stack where the template is referenced.
encrypted_param_names โ a list of parameter names whose values are encrypted. ๐คซ
event_sinks โ a list of event sinks.
parameter_defaults โ a map of parameters and their default values defined for the stack.
parameters โ a map of parametes defined in the stack template. (Yes, "parametes" โ that's the original spelling, I'm not touching it, I'm just the messenger ๐
)
resource_registry โ a map containing customized resource definitions.
๐ฆ openstack.orchestration.v1.stack_event
๐ธ The StackEvent Class
The StackEvent class inherits from Resource.
class openstack.orchestration.v1.stack_event.StackEvent(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not intended to be used directly, bestie. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
base_path = '/stacks/%(stack_name)s/%(stack_id)s/events' โ the base part of the URI for this resource.
resources_key = 'events' โ plural form of key for resource.
allow_create = False โ allow create operation for this resource.
allow_list = True โ allow list operation for this resource. ๐๏ธ
allow_fetch = True โ allow get operation for this resource.
allow_delete = False โ allow delete operation for this resource.
allow_commit = False โ allow update operation for this resource.
event_time โ the date and time when the event was created. โฐ
id โ the ID of the event object.
links โ a list of dictionaries containing links relevant to the stack. ๐
logical_resource_id โ the ID of the logical stack resource.
physical_resource_id โ the ID of the stack physical resource.
resource_name โ the name of the resource.
resource_status โ the status of the resource.
resource_status_reason โ the reason for the current stack resource state.
๐ง openstack.orchestration.v1.stack_files
๐ The StackFiles Class
The StackFiles class inherits from Resource.
class openstack.orchestration.v1.stack_files.StackFiles(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not for direct use, babes. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
base_path = '/stacks/%(stack_name)s/%(stack_id)s/files' โ the base part of the URI for this resource.
allow_create = False โ allow create operation for this resource.
allow_list = False โ allow list operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_delete = False โ allow delete operation for this resource.
allow_commit = False โ allow update operation for this resource.
name โ name of the stack where the template is referenced.
id โ ID of the stack where the template is referenced.
๐
fetch(session, requires_id=False, base_path=None, *args, **kwargs)
Get a remote resource based on this instance. Go get it, girl. ๐ฅ
Parameters
sessionโ the session to use for making this request.requires_idโ whether resource ID should be part of the requested URI.base_pathโ base part of the URI for fetching resources, if different frombase_path.error_messageโ an error message to be returned if the requested object does not exist.skip_cacheโ a boolean indicating whether the optional API cache should be skipped for this invocation.resource_response_keyโ overrides the usage ofself.resource_keywhen processing the response body.microversionโ API version to override the negotiated one.paramsโ additional parameters that can be consumed.
Returns โ this Resource instance. ๐ซถ
Raises MethodNotSupported โ if Resource.allow_fetch is not set to True.
Raises NotFoundException โ if the resource was not found. ๐ญ
โญ openstack.orchestration.v1.stack_template
๐ The StackTemplate Class
The StackTemplate class inherits from Resource.
class openstack.orchestration.v1.stack_template.StackTemplate(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ genuinely not meant to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
base_path = '/stacks/%(stack_name)s/%(stack_id)s/template' โ the base part of the URI for this resource.
allow_create = False โ allow create operation for this resource.
allow_list = False โ allow list operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_delete = False โ allow delete operation for this resource.
allow_commit = False โ allow update operation for this resource.
name โ name of the stack where the template is referenced.
stack_id โ ID of the stack where the template is referenced.
description โ the description specified in the template.
heat_template_version โ the version of the orchestration HOT template.
outputs โ key and value that contain output data.
parameters โ key and value pairs that contain template parameters.
resources โ key and value pairs that contain definition of resources in the template.
๐ openstack.orchestration.v1.template
๐ The Template Class
The Template class inherits from Resource.
class openstack.orchestration.v1.template.Template(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ this is not intended to be used directly, okay? Seenew()andexisting().connectionโ the hookup to theConnectionbeing used. Defaults toNoneso you can totally use Resource objects with no live Connection hanging around (unit tests, we're looking at you ๐). If you're poking atself._connectioninside Resource code, guard it with aNonecheck, bestie โ non-negotiable ๐ซถallow_create = Falseโ nope, no creating with this resource.allow_list = Falseโ no listing either.allow_fetch = Falseโ fetch? blocked, sorry babe.allow_delete = Falseโ deleting is a no.allow_commit = Falseโ and no updating. Very "look don't touch" of it ๐descriptionโ the description that was specified in the template.parametersโ key and value pairs holding the template parameters.parameter_groupsโ a list of parameter groups, and each one contains a list of parameter names.
๐๏ธ Object Store Resources ๐๏ธ
๐พ openstack.object_store.v1.account
โจ The Account Class โจ โ it inherits from Resource (peep <#openstack.resource.Resource>).
class openstack.object_store.v1.account.Account(metadata=None, **attrs)
Processes and saves the metadata we already know at creation time, periodt.
base_path = '/'โ the base part of the URI for this resource.allow_fetch = Trueโ get operation? allowed, slay.allow_commit = Trueโ update operation? also allowed.allow_head = Trueโ head operation? you bet.account_bytes_usedโ the total number of bytes stored in Object Storage for this account.account_container_countโ how many containers there are.account_object_countโ how many objects live in the account.meta_temp_url_keyโ the secret key value for temporary URLs. If it's not set, this header just isn't returned by the operation. ๐meta_temp_url_key_2โ a second secret key value for temporary URLs. Same deal: not set = header not returned.timestampโ the timestamp of the transaction. โฐrequires_id = Falseโ does this resource need an ID for its calls? No ma'am.
set_temp_url_key(session, key, secondary=False)
Sets the temporary url key for the account. ๐
Parameters
- session โ the adapter to use for making this request.
- key โ the text of the key to use.
- secondary โ whether this should set the secondary key (defaults to
False).
๐งบ openstack.object_store.v1.container
โจ The Container Class โจ โ inherits from Resource (see <#openstack.resource.Resource>).
class openstack.object_store.v1.container.Container(metadata=None, **attrs)
Processes and saves the metadata known at creation stage.
base_path = '/'โ the base part of the URI for this resource.pagination_key = 'X-Account-Container-Count'โ the key used for pagination links.allow_create = Trueโ creating? green light.allow_fetch = Trueโ fetching? green light.allow_commit = Trueโ updating? green light.allow_delete = Trueโ deleting? green light.allow_list = Trueโ listing? green light.allow_head = Trueโ heading? green light. The whole traffic system said yes ๐ฆnameโ the name of the container.countโ how many objects are in the container.bytesโ the total number of bytes stored in Object Storage for the container.object_countโ the number of objects.bytes_usedโ the count of bytes used in total.timestampโ the timestamp of the transaction.is_newestโ if set toTrue, Object Storage queries all replicas to return the most recent one. If you omit this header, Object Storage responds faster once it finds one valid replica. Because setting this toTrueis more expensive for the back end, use it only when it is absolutely needed. Type:bool.read_ACLโ the ACL that grants read access. If it's not set, this header isn't returned by the operation.write_ACLโ the ACL that grants write access. Same thing: not set, not returned.sync_toโ the destination for container synchronization. Not set? Not returned, bestie.sync_keyโ the secret key for container synchronization. Also not returned when unset.versions_locationโ enables versioning on this container. The value is the name of another container. You must UTF-8-encode and then URL-encode the name before you include it in the header. To disable versioning, set the header to an empty string. โ ๏ธ Do the encoding, fr fr.history_locationโ enables versioning on the container.content_typeโ the MIME type of the list of names.is_content_type_detectedโ if set totrue, Object Storage guesses the content type based on the file extension and ignores whatever was sent in theContent-Typeheader, if present. Type:bool.storage_policyโ the storage policy used by the container. Heads up: it is not possible to change the policy of an existing container. Choose once, choose well ๐if_none_matchโ in combination withExpect: 100-Continue, specify an"If-None-Match: *"header to query whether the server already has a copy of the object before any data is sent.meta_temp_url_keyโ the secret key value for temporary URLs. If not set, this header isn't returned by the operation.meta_temp_url_key_2โ a second secret key value for temporary URLs. Also not returned when unset.
classmethod new(**kwargs)
Creates a new instance of this resource. ๐
When creating the instance, set the _synchronized parameter of Resource to False to say "hey, this resource does not exist on the server side yet." That marks every attribute passed in **attrs as "dirty" on the resource, and thereforely tracks them as necessary in subsequent calls like update(). Lowkey important.
Parameters
- attrs โ each of the named arguments will be set as attributes on the resulting Resource object. These should correspond to either Body or Header values on this resource.
set_temp_url_key(session, key, secondary=False)
Sets the temporary url key for a container. ๐
Parameters
- session โ the session to use for making this request.
- container โ the value can be the name of a container or a
Containerinstance. - key โ the text of the key to use.
- secondary โ whether this should set the second key (defaults to
False).
๐ฆ openstack.object_store.v1.obj
โจ The Object Class โจ โ inherits from Resource (check <#openstack.resource.Resource>).
class openstack.object_store.v1.obj.Object(data=None, **attrs)
Processes and saves the metadata known at creation stage.
base_path = '/%(container)s'โ the base part of the URI for this resource.pagination_key = 'X-Container-Object-Count'โ the key used for pagination links.allow_create = Trueโ creation: allowed.allow_fetch = Trueโ fetching: allowed.allow_commit = Trueโ updating: allowed.allow_delete = Trueโ deletion: allowed.allow_list = Trueโ listing: allowed.allow_head = Trueโ heading: allowed. Iconic behaviour only. ๐containerโ the unique name for the container.nameโ the unique name for the object.is_newestโ if set toTrue, Object Storage queries all replicas to return the most recent one. If you omit this header, Object Storage responds faster after it finds one valid replica. Because setting this header toTrueis more expensive for the back end, use it only when it's absolutely needed. Type:bool.rangeโTODO(briancurtin)there's a lot of content here... ๐ญ (yes that's literally the note, we don't make the rules)if_matchโ see <http://www.ietf.org/rfc/rfc2616.txt>.if_none_matchโ in combination withExpect: 100-Continue, specify an"If-None-Match: *"header to query whether the server already has a copy of the object before any data is sent.if_modified_sinceโ see <http://www.ietf.org/rfc/rfc2616.txt>.if_unmodified_sinceโ see <http://www.ietf.org/rfc/rfc2616.txt>.signatureโ used with temporary URLs to sign the request. For more info about temporary URLs, see OpenStack Object Storage API v1 Reference.expires_atโ used with temporary URLs to specify the expiry time of the signature. For more info about temporary URLs, see OpenStack Object Storage API v1 Reference.manifestโ if present, this is a dynamic large object manifest object. The value is the container and object name prefix of the segment objects, in the formcontainer/prefix. ๐ฆmultipart_manifestโ okay so if you include themultipart-manifest=getquery parameter and the object is a large object, you do not get the object contents back. Instead, the manifest is returned in theX-Object-Manifestresponse header for dynamic large objects, or in the response body for static large objects. โจcontent_lengthโ lowkey important:HEADoperations do not return content. However, in this operation the value in theContent-Lengthheader is not the size of the response body. Instead it contains the size of the object, in bytes.content_typeโ the MIME type of the object. ๐accept_rangesโ the type of ranges that the object accepts.etagโ bestie, listen. For objects smaller than5 GB, this value is the MD5 checksum of the object content. The value is not quoted. For manifest objects, this value is the MD5 checksum of the concatenated string of MD5 checksums and ETags for each of the segments in the manifest, and not the MD5 checksum of the content that was downloaded. Also the value is enclosed in double-quote characters. You are strongly recommended to compute the MD5 checksum of the response body as it is received and compare this value with the one in theETagheader. If they differ, the content was corrupted, so retry the operation. ๐ญis_static_large_objectโ set toTrueif this object is a static large object manifest object. Type:bool. ๐ซถcontent_encodingโ if set, the value of theContent-Encodingmetadata. If not set, this header is not returned by this operation.content_dispositionโ if set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default. If not set, this header is not returned by this operation.delete_afterโ specifies the number of seconds after which the object is removed. Internally, the Object Storage system stores this value in theX-Delete-Atmetadata item. โณdelete_atโ if set, the time when the object will be deleted by the system in the format of a UNIX Epoch timestamp. If not set, this header is not returned by this operation.object_manifestโ if set, this is a dynamic large object manifest object. The value is the container and object name prefix of the segment objects in the formcontainer/prefix.timestampโ the timestamp of the transaction.last_modified_atโ the date and time that the object was created or the last time that the metadata was changed.transfer_encodingโ set tochunkedto enable chunked transfer encoding. If used, do not set theContent-Lengthheader to a non-zero value.is_content_type_detectedโ if set totrue, Object Storage guesses the content type based on the file extension and ignores the value sent in theContent-Typeheader, if present. Type:bool.copy_fromโ if set, this is the name of an object used to create the new object by copying theX-Copy-Fromobject. The value is in form{container}/{object}. You must UTF-8-encode and then URL-encode the names of the container and object before you include them in the header. UsingPUTwithX-Copy-Fromhas the same effect as using theCOPYoperation to copy an object. ๐ฅsymlink_targetโ if present, this is a symlink object. The value is the relative path of the target object in the format<container>/<object>.symlink_target_accountโ if present, andX-Symlink-Targetis present, then this is a cross-account symlink to an object in the account specified in the value.access_control_allow_originโ CORS for RAX (deviating from standard). Thatโs the whole note, no cap. ๐
๐ ๏ธ create(session, prepend_key=True, base_path=None, **params)
Create a remote resource based on this instance. ๐
Parameters
sessionโ the session to use for making this request.prepend_keyโ DEPRECATED Configurecreate_optsinstead. Whether theresource_keyshould be prepended in a resource creation request. Default toTrue.base_pathโ base part of the URI for creating resources, if different frombase_path <#openstack.resource.Resource.base_path>.resource_request_keyโ DEPRECATED Configurecreate_optsinstead. Overrides the usage ofresource_key <#openstack.resource.Resource.resource_key>when prepending a key to the request body. Ignored ifprepend_keyis false.resource_response_keyโ DEPRECATED Configurecreate_optsinstead. Overrides the usage ofresource_key <#openstack.resource.Resource.resource_key>when processing response bodies. Ignored ifprepend_keyis false.microversionโ API version to override the negotiated one.paramsโ additional params to pass.
Returns
This Resource instance. ๐
Raises
MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_create is not set to True.
๐ธ Placement v1 Resources
๐ง openstack.placement.v1.allocation
The Allocation Class
The Allocation class inherits from Resource <#openstack.resource.Resource>. ๐ซถ
class openstack.placement.v1.allocation.Allocation(_synchronized=False, connection=None, **attrs)
Allocations for a single consumer.
Allocations are records representing resources that have been assigned and used by a consumer of those resources. The consumer is identified by its UUID, which serves as the resource ID in the URL (/allocations/{consumer_uuid}).
An allocation maps resource providers to the resources consumed from them. Each entry in the allocations dict is keyed by resource provider UUID and contains a resources sub-dict mapping resource class names to quantities.
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = Noneโ singular form of key for resource.resources_key = Noneโ plural form of key for resource.base_path = '/allocations'โ the base part of the URI for this resource.allow_fetch = Trueโ allow get operation for this resource.allow_commit = Trueโ allow update operation for this resource.allow_delete = Trueโ allow delete operation for this resource.allocationsโ a dictionary of resource allocations keyed by resource provider UUID. Each value is a dict with aresourceskey mapping resource class names to quantities, e.g.{"DISK_GB": 4, "VCPU": 2}. Setting this to an empty dict removes all allocations for the consumer. ๐consumer_generationโ the generation of the consumer. Should be set toNonewhen indicating that the caller expects the consumer does not yet exist.consumer_typeโ a string that consists of numbers,A-Z, and_describing what kind of consumer is creating, or has created, allocations using a quantity of inventory. The string is determined by the client when writing allocations and it is up to the client to ensure correct choices amongst collaborating services. For example, the compute service may choose to type some consumers'INSTANCE'and others'MIGRATION'.project_idโ the UUID of a project.user_idโ the UUID of a user.
๐ classmethod set(session, allocations)
Set allocations for multiple consumers in a single atomic request. โจ
Parameters
sessionโ the session to use for making this request.allocationsโ a dict keyed by consumer UUID; seeset_allocations()for the expected structure of each value.
Raises
ConflictException <#openstack.exceptions.ConflictException> if any resource provider or consumer generation does not match, or if there is insufficient inventory. ๐ญ
๐ฆ openstack.placement.v1.allocation_candidate
The AllocationCandidate Class
The AllocationCandidate class inherits from Resource <#openstack.resource.Resource>. ๐
class openstack.placement.v1.allocation_candidate.AllocationCandidate(_synchronized=False, connection=None, **attrs)
A single candidate set of allocations.
Represents one entry from allocation_requests in the placement allocation candidates response, with the corresponding provider_summaries data filtered to only the resource providers referenced by this candidate. ๐
An AllocationCandidate contains enough info to fire off an update_allocation() call: the allocations dict maps resource provider UUIDs โ the resources you're requesting from each one, and provider_summaries hands you the capacity + trait deets for those providers so you can actually pick between candidates. ๐
The base resource โจ
Parameters
_synchronizedโ bestie do NOT use this directly, fr. Seenew()andexisting().connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can exist without a live Connection (think unit tests). Any use ofself._connectionin Resource code should guard itself with aNonecheck. ๐ซถ
resource_key = None โ singular form of the key for this resource.
resources_key = None โ plural form of the key for this resource.
base_path = '/allocation_candidates' โ the base part of the URI for this resource.
requires_id = False โ do calls for this resource require an ID? (Nope, not this one.)
allow_list = True โ list operation is allowed for this resource. ๐
mappings โ a dict mapping request-group suffixes โ the list of resource provider UUIDs that satisfy that group. Available from microversion 1.34.
provider_summaries โ a dict keyed by resource provider UUID, holding capacity + trait info for each provider referenced in allocations. This is derived from the top-level provider_summaries field in the API response, filtered down to only the providers relevant to this candidate. ๐
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, **params)
This method is a generator which yields resource objects. โจ
It's a re-implementation of list() that handles the allocation candidates response format. The API returns a single dict with allocation_requests (a list) and provider_summaries (a shared dict keyed by resource provider UUID). This method yields one AllocationCandidate per entry in allocation_requests, with provider_summaries filtered to only the resource providers referenced by that candidate.
Head over to list() for the full docs โ parameters, exceptions, return types, the whole thing. ๐
๐ธ openstack.placement.v1.resource_class ๐ธ
The ResourceClass Class
The ResourceClass class inherits from Resource.
class openstack.placement.v1.resource_class.ResourceClass(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not meant for direct use, bestie. Seenew()andexisting().connectionโ reference to the Connection being used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with aNonecheck.
resource_key = None โ singular form of key for resource.
resources_key = 'resource_classes' โ plural form of key for resource.
base_path = '/resource_classes' โ the base part of the URI for this resource.
allow_create = True โ create operation allowed.
allow_fetch = True โ get operation allowed.
allow_commit = True โ update operation allowed.
allow_delete = True โ delete operation allowed.
allow_list = True โ list operation allowed. ๐ฆ
allow_empty_commit = True โ commits happen even without header or body being dirty.
name โ the name of this resource. ๐ซ
๐ openstack.placement.v1.resource_provider ๐
The ResourceProvider Class
The ResourceProvider class inherits from Resource.
class openstack.placement.v1.resource_provider.ResourceProvider(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not for direct use, seenew()andexisting().connectionโ reference to the Connection being used. Defaults toNoneso Resource objects work without an active Connection, e.g. in unit tests. Use ofself._connectionin Resource code should protect itself with aNonecheck.
resource_key = None โ singular form of key for resource.
resources_key = 'resource_providers' โ plural form of key for resource.
base_path = '/resource_providers' โ the base part of the URI for this resource.
allow_create = True โ create operation allowed.
allow_fetch = True โ get operation allowed.
allow_commit = True โ update operation allowed.
allow_delete = True โ delete operation allowed.
allow_list = True โ list operation allowed. ๐
aggregates โ Aggregates.
id โ the UUID of a resource provider.
generation โ a consistent view marker that assists with managing concurrent resource provider updates. ๐
links โ links pertaining to this flavor. It's a list of dictionaries, each including the keys href and rel.
name โ the name of this resource provider.
parent_provider_id โ the UUID of the immediate parent of the resource provider.
root_provider_id โ read-only UUID of the top-most provider in this provider tree.
usages โ Resource class usage counts for this resource provider. ๐
commit(session, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None, **kwargs)
Commit the state of the instance to the remote resource.
Parameters
sessionโ the session to use for making this request.prepend_keyโ whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue.retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults.base_pathโ base part of the URI for modifying resources, if different frombase_path.microversionโ API version to override the negotiated one.attrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns โ this Resource instance.
Raises MethodNotSupported if Resource.allow_commit is not set to True. ๐ญ
set_inventories(session, inventories, resource_provider_generation)
Replace ALL the inventory records for the resource provider. Like, all of them. ๐ซถ
Parameters
sessionโ the session to use for making this request.inventoriesโ a dict mapping resource class names โ inventory configuration dicts. Pass an empty dict to remove all inventories.resource_provider_generationโ the generation of the resource provider; used to detect concurrent updates.
Returns โ the resource provider with the updated generation.
Raises ConflictException if the generation doesn't match, or if there are active allocations against an inventory being removed. โ ๏ธ
delete_inventories(session)
Delete all inventory records for the resource provider.
Parameters
sessionโ the session to use for making this request.
Raises ConflictException if there are active allocations against the resource provider. ๐
fetch_usages(session)
Fetch resource usage counts for the resource provider.
Parameters
sessionโ the session to use for making this request.
Returns โ the resource provider with usages populated. โจ
fetch_aggregates(session)
List aggregates set on the resource provider.
Parameters
sessionโ the session to use for making this request.
Returns โ the resource provider with aggregates populated. ๐ธ
set_aggregates(session, aggregates=None)
Replaces aggregates on the resource provider.
Parameters
sessionโ the session to use for making this request.
aggregates(list) โ List of aggregates.
Returns: The resource provider with updated aggregates populated.
๐ฆ openstack.placement.v1.resource_provider_allocation
The ResourceProviderAllocation Class
The ResourceProviderAllocation class inherits from Resource (the openstack.resource.Resource one, iykyk).
class openstack.placement.v1.resource_provider_allocation.ResourceProviderAllocation(_synchronized=False, connection=None, **attrs)
The base resource โ thatโs literally what it is, bestie.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ Reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = Noneโ Singular form of key for resource.resources_key = Noneโ Plural form of key for resource.base_path = '/resource_providers/%(resource_provider_id)s/allocations'โ The base part of the URI for this resource.allow_list = Trueโ Allow list operation for this resource.resource_provider_idโ The UUID of a resource provider.consumer_idโ The UUID of the consumer.resource_provider_generationโ A consistent view marker that assists with the management of concurrent resource provider updates.consumer_generationโ The generation of the consumer. Available from microversion1.28.resourcesโ A dictionary of resource class names to the amount allocated to this consumer from this resource provider.
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, **params)
This method is a generator which yields resource objects.
A re-implementation of list() (the openstack.resource.Resource.list one) that handles placement's single, unpaginated list implementation.
Refer to list() (openstack.resource.Resource.list) for full documentation including parameter, exception and return type documentation.
๐ openstack.placement.v1.resource_provider_inventory
The ResourceProviderInventory Class
The ResourceProviderInventory class inherits from Resource (the openstack.resource.Resource one).
class openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory(_synchronized=False, connection=None, **attrs)
The base resource โ yes, base resource energy.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ Reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = Noneโ Singular form of key for resource.resources_key = Noneโ Plural form of key for resource.base_path = '/resource_providers/%(resource_provider_id)s/inventories'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.resource_provider_idโ The UUID of a resource provider.resource_classโ The name of the resource class.resource_provider_generationโ A consistent view marker that assists with the management of concurrent resource provider updates.allocation_ratioโ It is used in determining whether consumption of the resource of the provider can exceed physical constraints.max_unitโ A maximum amount any single allocation against an inventory can have.min_unitโ A minimum amount any single allocation against an inventory can have.reservedโ The amount of the resource a provider has reserved for its own use.step_sizeโ A representation of the divisible amount of the resource that may be requested. For example,step_size = 5means that only values divisible by 5 (5,10,15, etc.) can be requested.totalโ The actual amount of the resource that the provider can accommodate.
commit(session, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None, **kwargs)
Commit the state of the instance to the remote resource.
Parameters
sessionโ The session to use for making this request.prepend_keyโ Whether theresource_key(openstack.resource.Resource.resource_key) should be prepended in a resource creation request. Default toTrue.retry_on_conflictโ Whether to enable retries on HTTP CONFLICT (409). Value ofNoneleaves the Adapter defaults.base_pathโ Base part of the URI for modifying resources, if different frombase_path(openstack.resource.Resource.base_path).microversionโ API version to override the negotiated one.attrsโ Attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns: This Resource instance.
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_commit is not set to True.
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, **params)
This method is a generator which yields resource objects.
A re-implementation of list() (the openstack.resource.Resource.list one) that handles placement's single, unpaginated list implementation.
Refer to list() (openstack.resource.Resource.list) for full documentation including parameter, exception and return type documentation.
๐ openstack.placement.v1.resource_provider_trait
The ResourceProviderTrait Class
The ResourceProviderTrait class inherits from Resource (the openstack.resource.Resource one).
class openstack.placement.v1.resource_provider_trait.ResourceProviderTrait(_synchronized=False, connection=None, **attrs)
The base resource โ base resource, no cap.
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()(openstack.resource.Resource.new) andexisting()(openstack.resource.Resource.existing).connectionโ Reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.resource_key = Noneโ Singular form of key for resource.resources_key = Noneโ Plural form of key for resource.base_path = '/resource_providers/%(resource_provider_id)s/traits'โ The base part of the URI for this resource.requires_id = Falseโ Do calls for this resource require an ID.commit_method = 'PUT'โ Method for committing a resource. This must bePATCHifallow_patchisTrue.allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.resource_provider_idโ The UUID of a resource provider.resource_provider_generationโ A consistent view marker that assists with the management of concurrent resource provider updates.traitsโ Traits.
commit(session, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None, **kwargs)
Commit the state of the instance to the remote resource.
Parameters
sessionโ The session to use for making this request.prepend_keyโ Whether theresource_key(openstack.resource.Resource.resource_key) should be prepended in a resource creation request. Default toTrue.retry_on_conflictโ Whether to enable retries on HTTP CONFLICT (409). Value ofNoneleaves the Adapter defaults.base_pathโ Base part of the URI for modifying resources, if different frombase_path(openstack.resource.Resource.base_path).microversionโ API version to override the negotiated one.attrsโ the attributes you're passing when you update the resource. These bad boys should line up with either Body or Header values on the resource. no random extras, bestie ๐
Returns
This Resource instance. same one, freshly updated ๐
Raises MethodNotSupported if Resource.allow_commit is not set to True. so if that flag's off, it's giving forbidden energy and nothing happens ๐ญ
fetch(session, requires_id=False, base_path=None, error_message=None, skip_cache=False, *, resource_response_key=None, microversion=None, **params)
Grab a remote resource based on this instance. like, go get it โจ
Parameters
sessionโ the session you're using to make this request.requires_idโ whether the resource ID should be part of the requested URI.base_pathโ the base part of the URI for fetching resources, in case it's different frombase_pathonResource.error_messageโ an error message that gets returned if the object you asked for doesn't exist.skip_cacheโ a boolean, and it says whether the optional API cache should be skipped for this particular invocation.resource_response_keyโ overrides howself.resource_keyis used when processing the response body.microversionโ the API version to override the negotiated one with.paramsโ extra parameters that can be consumed.
Returns
This Resource instance. ๐
Raises MethodNotSupported if Resource.allow_fetch is not set to True.
Raises NotFoundException if the resource was literally not found. gone, missing, not in the building ๐
openstack.placement.v1.trait
The Trait Class
The Trait class inherits from Resource. family tree moment ๐ธ
class openstack.placement.v1.trait.Trait(_synchronized=False, connection=None, **attrs)
The base resource. yes, that's the whole description, and honestly? iconic ๐
Parameters
_synchronizedโ not intended to be used directly. go look atnew()andexisting()instead, bestie.connectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can exist without an active Connection โ like in unit tests. any use ofself._connectioninside Resource code should protect itself with a check forNone. protective energy fr fr ๐ซถ
resource_key = None โ singular form of key for resource.
resources_key = None โ plural form of key for resource.
base_path = '/traits' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
create_opts
CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='PUT', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
Class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create(). slay, no code duplication ๐ฅ
name โ the name of this resource.
create(session, prepend_key=True, base_path=None, *, microversion=None, **kwargs)
Create a remote resource based on this instance. make it exist โจ
Parameters
sessionโ the session to use for making this request.prepend_keyโ DEPRECATED, configurecreate_optsinstead. whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue.base_pathโ base part of the URI for creating resources, if different frombase_pathonResource.resource_request_keyโ DEPRECATED, configurecreate_optsinstead. overrides the usage ofresource_keywhen prepending a key to the request body. ignored ifprepend_keyis false.resource_response_keyโ DEPRECATED, configurecreate_optsinstead. overrides the usage ofresource_keywhen processing response bodies. ignored ifprepend_keyis false.microversionโ the API version to override the negotiated one with.paramsโ additional params to pass.
Returns
This Resource instance. ๐
Raises MethodNotSupported if Resource.allow_create is not set to True.
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, **params)
Okay so this method is a generator that yields resource objects. ๐ฆ
It's a re-implementation of list() that handles the list of strings (as opposed to a list of objects) that this call returns. different shape, same vibe.
Refer to list() for the full documentation, including parameter, exception and return type docs. iykyk ๐
openstack.placement.v1.usage
The Usage Class
The Usage class inherits from Resource. ๐ง
class openstack.placement.v1.usage.Usage(_synchronized=False, connection=None, **attrs)
Resource usage for one consumer type within a project. it's giving receipts, but make them structured ๐
Represents one entry from the usages dict returned by GET /usages. Every entry is keyed by consumer type (e.g. INSTANCE, MIGRATION) and contains:
consumer_countโ the number of consumers of that type with active allocations in the project.resourcesโ a dict of resource class name to total amount consumed across all consumers of that type.
Available from placement microversion 1.38. Call usages() to retrieve instances. note that, bestie, it's a real requirement โญ
The base resource.
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. any use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = None โ singular form of key for resource.
resources_key = None โ plural form of key for resource.
base_path = '/usages' โ the base part of the URI for this resource.
requires_id = False โ do calls for this resource require an ID. nope!
allow_list = True โ allow list operation for this resource.
consumer_type โ the consumer type string, e.g. INSTANCE or MIGRATION.
consumer_count โ the number of consumers of this type with active allocations.
resources โ a dict of resource class name to total amount consumed across all consumers of this type, e.g. {"VCPU": 2, "DISK_GB": 5}. ๐
classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, *, microversion=None, **params)
This method is a generator which yields resource objects. ๐
It's a re-implementation of list() that handles the GET /usages response format. The API returns a single usages dict keyed by consumer type, and this method yields one Usage per entry, with the per-resource-class amounts packed into the resources field. unpacking the vibes, one entry at a time ๐
Refer to list() for the full documentation, including parameter, exception and return type documentation.
Shared File System service resources
openstack.shared_file_system.v2.availability_zone
The AvailabilityZone Class
The AvailabilityZone class inherits from Resource. ๐
class openstack.shared_file_system.v2.availability_zone.AvailabilityZone(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ not intended to be used directly. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an active Connection, such as in unit tests. any use ofself._connectionin Resource code should protect itself with a check forNone. ๐ซถ
resource_key = 'availability_zone' โ singular form of key for resource.
resources_key = 'availability_zones' โ plural form of key for resource.
base_path = '/availability-zones' โ the base part of the URI for this resource.
allow_create = False โ allow create operation for this resource. nope, can't make these ๐
allow_fetch = False โ allow get operation for this resource.
allow_commit = Falseโ nope, this resource does not do updates. not today ๐allow_delete = Falseโ and no deletes either, sorry bestie ๐allow_list = Trueโ listing though? yes bestie, list away โจidโ Properties. The ID of the availability zone ๐nameโ the name of the availability zone ๐ท๏ธcreated_atโ date and time the availability zone was created at โฐupdated_atโ date and time the availability zone was last updated at ๐
openstack.shared_file_system.v2.limit
The Limit Class ๐
The Limit class inherits from Resource <#openstack.resource.Resource>.
class openstack.shared_file_system.v2.limit.Limit(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ this is not intended to be used directly, okay? seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> ๐ซถconnectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an activeConnection, like in unit tests, fr. Any use ofself._connectionin Resource code should protect itself with a check forNone๐ฅ
resources_key = 'limits' โ plural form of key for resource ๐
base_path = '/limits' โ the base part of the URI for this resource ๐ฃ๏ธ
allow_create = Falseโ no creating this one ๐ โโ๏ธallow_fetch = Falseโ no fetching either ๐ญallow_commit = Falseโ no updating, not today ๐allow_delete = Falseโ no deleting, periodt โallow_list = Trueโ listing? absolutely, go off ๐allow_head = Falseโ head is a no ๐ซ
Then the properties, and there are so many of them:
maxTotalReplicaGigabytesโ Properties. The maximum number of replica gigabytes that are allowed in a project ๐พmaxTotalSharesโ the total maximum number of shares that are allowed in a project ๐ฆmaxTotalShareGigabytesโ the total maximum number of share gigabytes that are allowed in a project ๐ฝmaxTotalShareNetworksโ the total maximum number of share-networks that are allowed in a project ๐maxTotalShareSnapshotsโ the total maximum number of share snapshots that are allowed in a project ๐ธmaxTotalShareReplicasโ the maximum number of share replicas that is allowed ๐ชmaxTotalSnapshotGigabytesโ the total maximum number of snapshot gigabytes that are allowed in a project ๐๏ธtotalReplicaGigabytesUsedโ the total number of replica gigabytes used in a project by share replicas ๐totalShareGigabytesUsedโ the total number of gigabytes used in a project by shares ๐ฟtotalSharesUsedโ the total number of created shares in a project ๐งฎtotalShareNetworksUsedโ the total number of created share-networks in a project ๐ธ๏ธtotalShareSnapshotsUsedโ the total number of created share snapshots in a project ๐ผ๏ธtotalSnapshotGigabytesUsedโ the total number of gigabytes used in a project by snapshots ๐พtotalShareReplicasUsedโ the total number of created share replicas in a project ๐
openstack.shared_file_system.v2.quota_class_set
The QuotaClassSet Class ๐
The QuotaClassSet class inherits from Resource <#openstack.resource.Resource> and can be used to query quota class ๐
class openstack.shared_file_system.v2.quota_class_set.QuotaClassSet(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly, bestie. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> ๐ธconnectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an activeConnection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
base_path = '/quota-class-sets' โ the base part of the URI for this resource ๐ฃ๏ธ
resource_key = 'quota_class_set' โ singular form of key for resource 1๏ธโฃ
allow_create = Falseโ no create ๐ โโ๏ธallow_fetch = Trueโ fetch? yes please โจallow_commit = Trueโ commit/update, absolutely ๐allow_delete = Falseโ delete? nope ๐allow_list = Falseโ no listing ๐ญallow_head = Falseโ and no head ๐ซ
Properties time โจ
idโ Properties. Aquota_class_setid ๐share_groupsโ the maximum number of share groups ๐ฏshare_group_snapshotsโ the maximum number of share group snapshots ๐ธsnapshotsโ the total maximum number of shares that are allowed in a project (yes, that's exactly what it says ๐ญ)snapshot_gigabytesโ the maximum number of snapshot gigabytes that are allowed in a project ๐พsharesโ the total maximum number of snapshot gigabytes that are allowed in a project (again โ that's literally what the original says, i'm just the messenger ๐)share_networksโ the maximum number of share-networks that are allowed in a project ๐share_replicasโ the maximum number of share replicas that is allowed ๐ชgigabytesโ the total maximum number of share gigabytes that are allowed in a project. You cannot request a share that exceeds the allowed gigabytes quota โ ๏ธreplica_gigabytesโ the maximum number of replica gigabytes that are allowed in a project. You cannot create a share, share replica, manage a share or extend a share if it is going to exceed the allowed replica gigabytes quota ๐จper_share_gigabytesโ the number of gigabytes per share allowed in a project ๐backupsโ the total maximum number of share backups that are allowed in a project ๐๏ธbackup_gigabytesโ the total maximum number of backup gigabytes that are allowed in a project ๐ฝ
openstack.shared_file_system.v2.quota__set
The QuotaSet Class ๐
The QuotaSet class inherits from Resource <#openstack.resource.Resource> and can be used to query quotas ๐
class openstack.shared_file_system.v2.quota_set.QuotaSet(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> ๐ฆconnectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an activeConnection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
resource_key = 'quota_set' โ singular form of key for resource 1๏ธโฃ
resources_key = 'quota_sets' โ plural form of key for resource ๐
base_path = '/quota-sets/%(project_id)s' โ the base part of the URI for this resource ๐ฃ๏ธ
allow_create = Falseโ no create ๐ โโ๏ธallow_list = Falseโ no list ๐ญ
Properties, get comfy ๐
gigabytesโ Properties. The number of gigabytes allowed for each project ๐พsnapshotsโ the number of snapshots allowed for each project ๐ธsharesโ the number of shares allowed for each project ๐ฆsnapshot_gigabytesโ the number of gigabytes for the snapshots allowed for each project ๐ฝshare_groupsโ the number of share groups allowed for each project or user ๐ฏshare_group_snapshotsโ the number of share group snapshots allowed for each project or user ๐ผ๏ธshare_networksโ the number of share networks allowed for each project ๐share_replicasโ the number of share replicas allowed for each project ๐ชreplica_gigabytesโ the number of gigabytes for the share replicas allowed for each project ๐ฟper_share_gigabytesโ the number of gigabytes per share allowed for each project ๐backupsโ the number of backups allowed for each project ๐๏ธbackup_gigabytesโ the number of gigabytes for the backups allowed for each project ๐งฎ
openstack.shared_file_system.v2.resource_locks
The Resource Locks Class ๐
The ResourceLock class inherits from Resource <#openstack.resource.Resource>.
class openstack.shared_file_system.v2.resource_locks.ResourceLock(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not intended to be used directly. seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing> ๐งconnectionโ reference to theConnectionbeing used. Defaults toNoneto allow Resource objects to be used without an activeConnection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone๐ซถ
resource_key = 'resource_lock' โ singular form of key for resource 1๏ธโฃ
resources_key = 'resource_locks' โ plural form of key for resource ๐
base_path = '/resource-locks'โ the base part of the URI for this resource, periodt.allow_create = Trueโ create is allowed for this resource, slay.allow_fetch = Trueโ fetching (get) is allowed ๐allow_commit = Trueโ update/commit is allowed โจallow_delete = Trueโ delete is allowed, bye bestie ๐allow_list = Trueโ listing is allowed ๐ธallow_head = Falseโ head is not allowed, nope ๐created_atโ Properties field: the date and time stamp of when the resource got created inside the services's database ๐updated_atโ the date and time stamp of when the resource was last modified inside the services's database ๐user_idโ the ID of the user that owns the lock ๐project_idโ the ID of the project that owns the lock ๐resource_typeโ the type of the resource that is locked, i.e.:share,access rule.resource_idโ the UUID of the resource that's locked ๐resource_actionโ what action is currently locked, i.e.:deletion,visibility of fields.lock_reasonโ the reason that was specified while the lock was being placed ๐lock_contextโ the context that placed the lock (user,adminorservice).
๐ง openstack.shared_file_system.v2.service
The Service Class โจ
Okay so the Service class inherits from Resource.
class openstack.shared_file_system.v2.service.Service(_synchronized=False,
connection=None, **attrs)
The literal base resource, no cap.
Parameters ๐ซถ
_synchronizedโ not intended to be used directly, bestie. Seenew()andexisting()instead. Skip it, iykyk.connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can still be used without an active Connection, like in unit tests. Any use ofself._connectioninResourcecode should protect itself with a check forNone. Cute and defensive, we love to see it ๐resource_key = 'service'โ singular form of the key for the resource.resources_key = 'services'โ plural form of the key for the resource.base_path = '/services'โ the base part of the URI for this resource.allow_create = Falseโ no creating here ๐ โโ๏ธallow_fetch = Falseโ no fetching either ๐ซallow_commit = Trueโ but update? oh she's allowed โจallow_delete = Falseโ delete is a no-go.allow_list = Trueโ listing is very much allowed ๐allow_head = Falseโ head is not allowed, nope.availability_zoneโ Properties field: the availability zone of the service ๐binaryโ the service binary name.hostโ the service host name ๐ฅ๏ธnameโ the service name ๐ท๏ธstateโ the current state of the service.statusโ the service status, which isenabledordisabled.updated_atโ the date and time stamp of when the resource was last updated within the service's database โฐdisabled_reasonโ the reason for disabling the service ๐ญensuringโ whether the service is currently ensuring shares.enable(session)โ enable the service ๐ she's back on.disable(session, disable_reason=None)โ disable the service ๐ mind the optionaldisable_reason.ensure_shares(session)โ ensure shares on a back end.
๐ฆ openstack.shared_file_system.v2.share
The Share Class ๐
The Share class inherits from Resource.
class openstack.shared_file_system.v2.share.Share(_synchronized=False,
connection=None, **attrs)
Again, the base resource. Hi bestie.
Parameters
_synchronizedโ don't use this directly, literally. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an active Connection, e.g. in unit tests. Anyself._connectionuse inResourcecode should guard with aNonecheck โจresource_key = 'share'โ singular form of the key for the resource.resources_key = 'shares'โ plural form of the key for the resource.base_path = '/shares'โ the base part of the URI for this resource.allow_create = Trueโ yes create ๐allow_fetch = Trueโ yes fetch ๐ธallow_commit = Trueโ yes update โจallow_list = Trueโ yes list ๐allow_head = Falseโ no head ๐allow_delete = Trueโ yes delete ๐ฅaccess_rules_statusโ Properties field: the share instance access rules status. A valid value isactive,error, orsyncing.availability_zoneโ the availability zone ๐created_atโ the date and time stamp of when the resource was created within the services's database ๐descriptionโ the user defined description of the resource ๐hostโ the share host name ๐ฅ๏ธis_publicโ the level of visibility for the share ๐is_creating_new_share_from_snapshot_supportedโ whether or not this share supports snapshots that can be cloned into new shares ๐งฌis_mounting_snapshot_supportedโ whether the share's snapshots can be mounted directly and access controlled independently or not ๐is_reverting_to_snapshot_supportedโ whether the share can be reverted to its latest snapshot or not โชis_snapshot_supportedโ an extra specification that filters back ends by whether the share supports snapshots or not.is_replicatedโ indicates whether the share has replicas or not ๐ฏโโ๏ธmetadataโ one or more metadata key and value pairs, as a dictionary of strings.progressโ the progress of the share creation ๐project_idโ the ID of the project that owns the resource ๐replication_typeโ the share replication type. Valid values arenone,readable,writableanddr.share_group_idโ the UUID of the share group that this share belongs to.share_network_idโ the share network ID.share_protocolโ the Shared File Systems protocol. A valid value isNFS,CIFS,GlusterFS,HDFS,CephFS,MAPRFSshare_server_idโ the UUID of the share server.share_typeโ the UUID of the share type. In minor versions, this parameter is a share type name, as a string. Chaotic but iconic.share_type_nameโ name of the share type.sizeโ the share size, in GiBs ๐snapshot_idโ the UUID of the snapshot that was used to create the share.source_share_group_snapshot_member_idโ the ID of the group snapshot instance that was used to create this share.statusโ the share status ๐ฆtask_stateโ for the share migration, the migration task state.user_idโ ID of the user that the share was created by ๐display_nameโ display name for updating name.display_descriptionโ display description for updating description.extend_share(session, new_size, force=False)โ extend the share size, she's growing ๐
Parameters
sessionโ a session object used for sending the request.new_sizeโ the new size of the share in GiB.forceโ whether or not to use force, bypassing the scheduler. Requires admin privileges. Defaults toFalse. โ ๏ธ admin vibes only.
Returns The result of the action.
shrink_share(session, new_size)โ shrink the share size, she's on a diet ๐
Parameters
sessionโ a session object used for sending the request.new_sizeโ the new size of the share in GiB.
Returns None
revert_to_snapshot(session, snapshot_id)โ revert the share to the given snapshot โชโจ
Parameters
sessionโ a session object used for sending the request.snapshot_idโ the id of the snapshot to revert to.
Returns None
manage(session, protocol, export_path, service_host, **params)โ manage a share ๐๏ธ
Parameters
sessionโ a session object used for sending the request.protocolโ the shared file systems protocol of this share.export_pathโ the export path, formatted according to the protocol.service_hostโ the manage-share service host.paramsโ
Optional parameters to be sent. Available parameters include:
name: the user defined name of the resource.
share_typeโ the name or ID of the share type you want to use to create the resource โจdriver_optionsโ a set of one or more key and value pairs, as a dictionary of strings, that describe driver options. lowkey just a dict of strings, bestie ๐ซถis_publicโ the level of visibility for the share ๐descriptionโ the user defined description of the resource โ๏ธshare_server_idโ the UUID of the share server ๐
Returns
The share that was managed. that's it, that's the return ๐
unmanage(session)
Unmanage a share. letting it go, free-range share era ๐ฆ
Parameters
sessionโ a session object used for sending request.
Returns
None
force_delete(session)
Force delete the share. no soft launch, we're going straight through the wall ๐
Returns
None
soft_delete(session)
Soft delete a share. gentle deletion, we love a respectful breakup ๐ธ
Parameters
sessionโ a session object used for sending request.
Returns
None
restore(session)
Restore a share. bringing it back like nothing happened ๐ญ
Parameters
sessionโ a session object used for sending request.
Returns
None
reset_status(session, status)
Reset the share to the given status. factory reset but for a status field ๐
Parameters
statusโ the status of the share to reset to.
Returns
None
๐ openstack.shared_file_system.v2.share_access_rule
The ShareAccessRule Class
The ShareAccessRule class inherits from Resource <#openstack.resource.Resource>. family tree moment ๐ง
class openstack.shared_file_system.v2.share_access_rule.ShareAccessRule(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>. don't touch it, i'm serious ๐connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'access' โ singular form of key for resource.
resources_key = 'access_list' โ plural form of key for resource.
base_path = '/share-access-rules' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = False โ allow update operation for this resource. nope, not allowed, read the room ๐
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
allow_head = False โ allow head operation for this resource.
create_opts = CreateOpts(request_key='allow_access', response_key='access', method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
Class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overriding create(). iconic inheritance behavior honestly ๐
access_key โ Properties The access credential of the entity granted share access.
access_level โ the access level to the share.
access_list โ the object of the access rule.
access_to โ the value that defines the access.
access_type โ the access rule type.
created_at โ the date and time stamp when the resource was created within the services's database. timestamp bestie โญ
metadata โ one or more access rule metadata key and value pairs as a dictionary of strings.
share_id โ the UUID of the share to which you are granted or denied access. granted OR denied, both on the table ๐ค
state โ the state of the access rule.
updated_at โ the date and time stamp when the resource was last updated within the services's database.
lock_visibility โ whether the visibility of some sensitive fields is restricted or not ๐
lock_deletion โ whether the deletion of the access rule should be restricted or not ๐
lock_reason โ reason for placing the loc.
delete(session, error_message=None, *, microversion=None, unrestrict=False, **kwargs)
Delete the remote resource based on this instance. bye bye bestie ๐
Parameters
sessionโ the session to use for making this request.microversionโ API version to override the negotiated one.base_pathโ base part of the URI for modifying resources, if different frombase_path <#openstack.resource.Resource.base_path>.paramsโ query string parameters to include in the request URL.
Returns
This Resource instance. it hands itself back to you, main character energy โจ
Raises MethodNotSupported <#openstack.exceptions.MethodNotSupported> if Resource.allow_commit is not set to True.
Raises NotFoundException <#openstack.exceptions.NotFoundException> if the resource was not found.
๐ openstack.shared_file_system.v2.share_group
The ShareGroup Class
The ShareGroup class inherits from Resource <#openstack.resource.Resource>. squad goals ๐ซถ
class openstack.shared_file_system.v2.share_group.ShareGroup(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'share_group' โ singular form of key for resource.
resources_key = 'share_groups' โ plural form of key for resource.
base_path = '/share-groups' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource. we CAN commit here, unlike the last one ๐
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
allow_head = False โ allow head operation for this resource.
availability_zone โ Properties The availability zone ID that the share group exists within.
consistent_snapshot_support โ the consistency snapshot support.
created_at โ the date and time stamp when the resource was created within the services's database.
description โ the user defined description of the resource.
project_id โ the ID of the project that owns the resource.
share_group_snapshot_id โ the share group snapshot ID.
share_group_type_id โ the share group type ID.
share_network_id โ the share network ID where the resource is exported to.
share_types โ a list of share type IDs.
status โ the share status.
๐ฆ openstack.shared_file_system.v2.share_group_snapshot
The ShareGroupSnapshot Class
The ShareGroupSnapshot class inherits from Resource <#openstack.resource.Resource>. snapshot of the whole group, obsessed ๐ธ
class openstack.shared_file_system.v2.share_group_snapshot.ShareGroupSnapshot(_synchronized=False, connection=None, **attrs)
The base resource.
Parameters
_synchronizedโ this is not intended to be used directly. Seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. Defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
resource_key = 'share_group_snapshot' โ singular form of key for resource.
resources_key = 'share_group_snapshots' โ plural form of key for resource.
base_path = '/share-group-snapshots' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
allow_head = False โ allow head operation for this resource.
project_id โ Properties The ID of the project that owns the resource.
status โ filters by a share group snapshot status. a valid value is creating, error, available, deleting, error_deleting. those are the only options, don't freestyle it ๐ญ
share_group_idโ the UUID of the share group. like, the actual ID of the group it belongs to ๐ซถdescriptionโ the user-defined description of the resource. you write it, you own it ๐created_atโ the date + time stamp of when the resource was created โจmembersโ the share group snapshot members. the whole squad ๐sizeโ the snapshot size, in GiBs.share_protocolโNFS,CIFS,GlusterFS,HDFS,CephFSorMAPRFS.
openstack.shared_file_system.v2.share_instance
The ShareInstance Class โ ok so this one inherits from Resource <#openstack.resource.Resource> ๐
class openstack.shared_file_system.v2.share_instance.ShareInstance(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ not meant to be used directly, bestie. seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ a reference to the Connection being used. defaults toNoneso Resource objects can exist without an active Connection, like in unit tests. any use ofself._connectionin Resource code should protect itself with a check forNone๐
resource_key = 'share_instance' โ singular form of the key for the resource.
resources_key = 'share_instances' โ plural form of the key for the resource.
base_path = '/share_instances' โ the base part of the URI for this resource.
allow_create = False โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = False โ allow update operation for this resource.
allow_delete = False โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
allow_head = False โ allow head operation for this resource.
access_rules_status โ properties the share instance access rules status. a valid value is active, error, or syncing โญ
availability_zone โ the name of the availability zone the share exists within.
cast_rules_to_readonly โ if the share instance has its cast_rules_to_readonly attribute set to True, all existing access rules get cast to read-only. no take-backsies ๐ฅ
created_at โ the date and time stamp when the resource was created within the service's database.
host โ the host name of the service back end that the resource is contained within.
progress โ the progress of the share creation. the way it's just a number that ticks up ๐ญ
replica_state โ the share replica state. only set to a value when replication is used. list of possible values: active, in_sync, out_of_sync, error.
share_id โ the UUID of the share that the share instance belongs to.
share_network_id โ the share network ID where the resource is exported to.
share_server_id โ the UUID of the share server.
status โ the share or share instance status.
reset_status(session, reset_status) โ reset share instance to the given status.
force_delete(session) โ force delete share instance. aggressive but iconic ๐
openstack.shared_file_system.v2.share_network
The ShareNetwork Class โ inherits from Resource <#openstack.resource.Resource> ๐ฆ
class openstack.shared_file_system.v2.share_network.ShareNetwork(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ not intended to be used directly. seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. use ofself._connectionin Resource code should protect itself with a check forNone๐ธ
resource_key = 'share_network' โ singular form of key for resource.
resources_key = 'share_networks' โ plural form of key for resource.
base_path = '/share-networks' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = True โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
allow_head = False โ allow head operation for this resource.
created_at โ properties the date and time stamp when the resource was created within the service's database.
description โ the user-defined description of the resource.
project_id โ the ID of the project that owns the resource. yours truly ๐
share_network_subnets โ a list of share network subnets that pertain to the related share network.
neutron_net_id โ the UUID of a neutron network when setting up or updating a share network subnet with neutron.
neutron_subnet_id โ the UUID of the neutron subnet when setting up or updating a share network subnet with neutron.
updated_at โ the date and time stamp when the resource was last updated within the service's database.
openstack.shared_file_system.v2.share_network_subnet
The ShareNetworkSubnet Class โ inherits from Resource <#openstack.resource.Resource> ๐ง
class openstack.shared_file_system.v2.share_network_subnet.ShareNetworkSubnet(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. use ofself._connectionin Resource code should protect itself with a check forNone๐
resource_key = 'share_network_subnet' โ singular form of key for resource.
resources_key = 'share_network_subnets' โ plural form of key for resource.
base_path = '/share-networks/%(share_network_id)s/subnets' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = False โ allow update operation for this resource.
allow_delete = True โ allow delete operation for this resource.
allow_list = True โ allow list operation for this resource.
create_opts = CreateOpts(request_key='share-network-subnet', response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True) โ class-level configuration for the create operation. subclasses can override this to set per-resource defaults without overriding create() โจ
share_network_id โ properties the share network ID, part of the URI for share network subnets.
availability_zone โ the name of the availability zone that the share network subnet belongs to.
cidr โ the IP block from which to allocate the network, in CIDR notation.
created_at โ date and time the share network subnet was created at.
gateway โ the gateway of a share network subnet.
ip_version โ the IP version of the network.
mtu โ the MTU of a share network subnet.
network_type โ the network type. a valid value is VLAN, VXLAN, GRE, or flat โญ
neutron_net_id โ the name of the neutron network.
neutron_subnet_id โ the ID of the neutron subnet.
segmentation_id โ the segmentation ID.
share_network_name โ the name of the share network that the share network subnet belongs to.
updated_at โ date and time the share network subnet was last updated at.
openstack.shared_file_system.v2.share_replica
The ShareReplica Class โ inherits from Resource <#openstack.resource.Resource> ๐
class openstack.shared_file_system.v2.share_replica.ShareReplica(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ this is not intended to be used directly. seenew() <#openstack.resource.Resource.new>andexisting() <#openstack.resource.Resource.existing>.connectionโ reference to the Connection being used. defaults toNoneto allow Resource objects to be used without an active Connection, such as in unit tests. use ofself._connectionin Resource code should protect itself with a check forNone๐
resource_key = 'share_replica' โ singular form of key for resource.
resources_key = 'share_replicas' โ plural form of key for resource.
base_path = 'share-replicas' โ the base part of the URI for this resource.
allow_create = True โ allow create operation for this resource.
allow_fetch = True โ allow get operation for this resource.
allow_commit = Falseโ nope, you can't update this one. Read-only vibes.allow_delete = Trueโ delete? absolutely, go off ๐allow_list = Trueโ you can list these, slayallow_head = Falseโ no head requests, sorry bestieshare_idโ properties The UUID of the share from which to create a share replica. literally the origin story.statusโ The status of a share replica. List of possible values:<rainbow>available, error, creating, deleting, or error_deleting</rainbow>.cast_rules_to_readonlyโ If the share replica has itscast_rules_to_readonlyattribute set toTrue, all existing access rules will be cast to read/only. ๐ซถupdated_atโ The date and time stamp when the resource was last updated within the service's database. If a resource was never updated after it was created, the value of this parameter is set tonull. as it should be โจshare_network_idโ The share network ID where the resource is exported to.share_server_idโ The UUID of the share server.hostโ The host name of the share replica.replica_stateโ The replica state of a share replica.created_atโ The date and time stamp when the resource was created within the service's database.reset_status(session, status)โ Reset the status of the share replica. fresh start energy ๐ฆreset_replica_state(session, replica_state)โ Resetreplica_stateof the share replica.force_delete(session, *, ignore_missing=False)โ Force-delete share replica. no cap, it's gone ๐promote(session)โ Promote share replica. main character promotion arc ๐resync(session)โ Resync share replica.
๐ธ openstack.shared_file_system.v2.share_snapshot
The ShareSnapshot Class
The ShareSnapshot class inherits from Resource <#openstack.resource.Resource>.
class openstack.shared_file_system.v2.share_snapshot.ShareSnapshot(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Then the class attributes:
resource_key = 'snapshot'โ Singular form of key for resource.resources_key = 'snapshots'โ Plural form of key for resource.base_path = '/snapshots'โ The base part of the URI for this resource.allow_create = Trueโ Allow create operation for this resource. โจallow_fetch = Trueโ Allow get operation for this resource.allow_commit = Trueโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.allow_head = Falseโ Allow head operation for this resource.created_atโ Properties The date and time stamp when the resource was created within the services's database.descriptionโ The user defined description of the resource.display_nameโ The user defined name of the resource.display_descriptionโ The user defined description of the resourceproject_idโ ID of the project that the snapshot belongs to.share_idโ The UUID of the source share that was used to create the snapshot.share_protoโ The file system protocol of a share snapshotshare_sizeโ The snapshot's source share's size, in GiBs.sizeโ The snapshot size, in GiBs.statusโ The snapshot statususer_idโ ID of the user that the snapshot was created by.reset_status(session, status)โ Reset the snapshot to the given status.
Parameters
statusโ The status of the share to reset to.
Returns None
force_delete(session)โ Force delete the snapshot. ๐ค
Returns None
manage(session, share_id, provider_location, **params)โ Manage a share snapshot.
Parameters
sessionโ A session object used for sending request.share_idโ The UUID of the share that has snapshot which should be managed.provider_locationโ Provider location of the snapshot on the backend.paramsโ
Optional parameters to be sent. Available parameters include:
name: The user defined name of the resource.display_name: The user defined name of the resource. This field sets thenameparameter.description: The user defined description of the resource.display_description: The user defined description of the resource. This field sets thedescriptionparameter.driver_options: A set of one or more key and value pairs, as a dictionary of strings, that describe driver options.
Returns The share snapshot that was managed. ๐
unmanage(session)โ Unmanage a share snapshot.
Parameters session โ A session object used for sending request.
Returns None
๐ง openstack.shared_file_system.v2.share_snapshot_instance
The ShareSnapshotInstance Class
The ShareSnapshotInstance class inherits from Resource <#openstack.resource.Resource>.
class openstack.shared_file_system.v2.share_snapshot_instance.ShareSnapshotInstance(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.
Attributes, coming right up:
resource_key = 'snapshot_instance'โ Singular form of key for resource.resources_key = 'snapshot_instances'โ Plural form of key for resource.base_path = '/snapshot-instances'โ The base part of the URI for this resource.allow_create = Falseโ Allow create operation for this resource. not happening ๐allow_fetch = Trueโ Allow get operation for this resource.allow_commit = Falseโ Allow update operation for this resource.allow_delete = Falseโ Allow delete operation for this resource.allow_list = Trueโ Allow list operation for this resource.allow_head = Falseโ Allow head operation for this resource.created_atโ Properties The date and time stamp when the resource was created within the services's database.progressโ The progress of the snapshot creation. we're getting there bestie ๐ซถprovider_locationโ Provider location of the snapshot on the backend.share_idโ The UUID of the share.share_instance_idโ The UUID of the share instance.snapshot_idโ The UUID of the snapshot.statusโ The snapshot instance status.updated_atโ The date and time stamp when the resource was updated within the services's database.
๐ openstack.shared_file_system.v2.share_transfer
The ShareTransfer Class
The ShareTransfer class inherits from Resource <#openstack.resource.Resource> and can be used to query quota class
class openstack.shared_file_system.v2.share_transfer.ShareTransfer(_synchronized=False, connection=None, **attrs)
The base resource
Parameters
_synchronizedโ This is not intended to be used directly. Seenew()<#openstack.resource.Resource.new> andexisting()<#openstack.resource.Resource.existing>.connectionโ Reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'transfer'โ Singular form of key for resource.base_path = '/share-transfers'โ The base part of the URI for this resource.allow_list = Trueโ Allow list operation for this resource.allow_create = Trueโ Allow create operation for this resource. โญallow_fetch = Trueโ Allow get operation for this resource.allow_commit = Falseโ Allow update operation for this resource.allow_delete = Trueโ Allow delete operation for this resource.allow_head = Falseโ Allow head operation for this resource.idโ The transfer UUID.share_idโ The share UUID.created_atโ the date + time stamp of when this resource got created in the service's database ๐nameโ the display name of the transfer, bestie ๐resource_typeโ what type of resource we're transferring.resource_idโ the UUID of the resource being transferred ๐auth_keyโ the authentication key for the transfer (the magic password, basically ๐ฎ)source_project_idโ the ID of the project that owns the resource.destination_project_idโ UUID of the destination project that accepts the transfer resource ๐ฏacceptedโ whether the transfer has been accepted or not (true/false vibes โจ)expires_atโ the date and time stamp of when the resource transfer expires. After the transfer expires, it gets automatically deleted ๐ญlinksโ pagination + bookmark links for the resource ๐accept(session, *, auth_key, clear_access_rules=False)โ accepts a share transfer using theauth_key. Slay ๐ซถ
openstack.shared_file_system.v2.share_type</p>
The ShareType Class
Okay so ShareType inherits from Resource (that's <#openstack.resource.Resource> in the docs, iykyk).
class openstack.shared_file_system.v2.share_type.ShareType(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not meant to be used directly, no cap. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ a reference to theConnectionbeing used. Defaults toNoneso thatResourceobjects can be used without an activeConnection, like in unit tests ๐งช. Any use ofself._connectioninsideResourcecode should protect itself with a check forNone.resource_key = 'share_type'โ the singular form of the key for the resource.resources_key = 'share_types'โ the plural form of the key for the resource.base_path = '/types'โ the base part of the URI for this resource ๐allow_create = Trueโ allow the create operation for this resource.allow_fetch = Trueโ allow the get operation for this resource.allow_commit = Trueโ allow the update operation for this resource.allow_delete = Trueโ allow the delete operation for this resource.allow_list = Trueโ allow the list operation for this resource.allow_head = Falseโ allow the head operation for this resource (nope, not this one ๐).descriptionโ Properties: the description of the share type โ๏ธextra_specsโ list of extra specs for share types โจis_defaultโ indicates if the share type is the default one ๐is_publicโ indicates if the share type is public ๐required_extra_specsโ list of required extra specs for share types ๐ฅset_extra_specs(session, **specs)โ updatesextra_specs๐
Heads up: this call replaces only the extra_specs with the same keys you give here. Other keys stay untouched, fr fr.
Parameters
sessionโ the session to use for this request.extra_specsโ key/valueextra_specspairs to set or update.
Returns โ the updated self ๐ซถ
delete_extra_specs_property(session, prop)โ deletes extra specs ๐๏ธ
Parameters
sessionโ the session to use for this request.propโ the property to delete.
Returns โ None.
openstack.shared_file_system.v2.storage_pool</p>
The StoragePool Class
StoragePool also inherits from Resource (<#openstack.resource.Resource>), periodt.
class openstack.shared_file_system.v2.storage_pool.StoragePool(_synchronized=False, connection=None, **attrs)
The base resource ๐ธ
Parameters
_synchronizedโ not meant for direct use, seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects work without an activeConnection(unit tests, bestie ๐งช). Use ofself._connectioninResourcecode should guard with aNonecheck.resources_key = 'pools'โ the plural form of the key for the resource.base_path = '/scheduler-stats/pools'โ the base part of the URI for this resource ๐allow_create = Falseโ allow the create operation for this resource (no ๐ )allow_fetch = Falseโ allow the get operation for this resource (also no)allow_commit = Falseโ allow the update operation for this resource (still no)allow_delete = Falseโ allow the delete operation for this resource (nope)allow_list = Trueโ allow the list operation for this resource (this one's a yes โจ)allow_head = Falseโ allow the head operation for this resource.backendโ Properties: the name of the back end ๐งฑhostโ the host of the back end.poolโ the pool for the back end ๐capabilitiesโ the back end capabilities ๐ช
openstack.shared_file_system.v2.user_message</p>
The UserMessage Class
Yep, UserMessage inherits from Resource too (<#openstack.resource.Resource>), it's giving family reunion ๐ซถ
class openstack.shared_file_system.v2.user_message.UserMessage(_synchronized=False, connection=None, **attrs)
The base resource ๐
Parameters
_synchronizedโ not for direct use, seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNonesoResourceobjects can exist without an activeConnection, like in unit tests. Any use ofself._connectioninResourcecode should protect itself with aNonecheck.resource_key = 'message'โ the singular form of the key for the resource.resources_key = 'messages'โ the plural form of the key for the resource.base_path = '/messages'โ the base part of the URI for this resource ๐จallow_fetch = Trueโ allow the get operation for this resource.allow_commit = Falseโ allow the update operation for this resource (nope โ).allow_delete = Trueโ allow the delete operation for this resource.allow_list = Trueโ allow the list operation for this resource.allow_head = Falseโ allow the head operation for this resource.action_idโ Properties: the action ID of the user message ๐ฌcreated_atโ indicates when the user message was created ๐detail_idโ the detail ID of the user message.expires_atโ indicates when the share message expires โmessage_levelโ the message level of the user message.project_idโ the project ID of the user message.request_idโ the request ID of the user message.resource_idโ the resource ID of the user message.resource_typeโ the resource type of the user message.user_messageโ the message for the user message ๐ฌ
Workflow Resources ๐ฆ
openstack.workflow.v2.cron_trigger</p>
The CronTrigger Class
CronTrigger inherits from Resource (<#openstack.resource.Resource>), obviously ๐
class openstack.workflow.v2.cron_trigger.CronTrigger(_synchronized=False, connection=None, **attrs)
The base resource โจ
Parameters
_synchronizedโ not intended to be used directly. Seenew()(<#openstack.resource.Resource.new>) andexisting()(<#openstack.resource.Resource.existing>).connectionโ reference to theConnectionbeing used. Defaults toNoneto allowResourceobjects to be used without an activeConnection, such as in unit tests ๐งช. Use ofself._connectioninResourcecode should protect itself with a check forNone.resource_key = 'cron_trigger'โ the singular form of the key for the resource.resources_key = 'cron_triggers'โ the plural form of the key for the resource.base_path = '/cron_triggers'โ the base part of the URI for this resource โฐallow_create = Trueโ allow the create operation for this resource.allow_list = Trueโ allow the list operation for this resource.allow_fetch = Trueโ allow the get operation for this resource.allow_delete = Trueโ allow the delete operation for this resource.create_optsโ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate()๐
CreateOpts(request_key=None, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
nameโ the name of this Cron Trigger ๐ท๏ธpatternโ the pattern for this Cron Trigger.remaining_executionsโ count of remaining exectuions (yes, that's how it's spelled in the docs, we don't gatekeep typos ๐ญ)first_execution_timeโ time of the first execution โฑ๏ธnext_execution_timeโ time of the next execution โญ๏ธworkflow_nameโ workflow name.workflow_idโ workflow ID.workflow_inputโ the inputs for the workflow ๐ฅworkflow_paramsโ workflow params.project_idโ the ID of the associated project.created_atโ the time at which the cron trigger was created ๐updated_atโ the time at which the cron trigger was created (yep, the docs say "created" again โ iconic copy-paste moment, we keep it exactly as-is ๐)
๐งฉ openstack.workflow.v2.execution
๐ซ The Execution Class
So the Execution class is a whole vibe and it inherits straight from Resource (iykyk, that's the base everything rides on). Here's the whole thing:
class openstack.workflow.v2.execution.Execution(_synchronized=False, connection=None, **attrs)
Yeah, she's the base resource. Let's talk params:
_synchronizedโ okay so this is not meant to be used directly, bestie. Like, do not touch. Go look atnew()andexisting()instead, they're the ones you actually want. ๐connectionโ a reference to theConnectionbeing used. It defaults toNoneso you can build Resource objects with no active Connection at all, like in unit tests. And heads up: any code inside Resource that touchesself._connectionshould guard itself with a check forNone. Safety first, always. ๐ก๏ธ
Now the class attributes โ the icon lineup:
resource_key = 'execution'โ the singular form of the key for this resource.resources_key = 'executions'โ the plural form of the key for this resource. Plural slay. โจbase_path = '/executions'โ the base part of the URI for this resource.allow_create = Trueโ allows the create operation for this resource.allow_list = Trueโ allows the list operation for this resource.allow_fetch = Trueโ allows the get operation for this resource.allow_delete = Trueโ allows the delete operation for this resource.create_optsโ class-level config for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate(). Iconic behavior honestly:
create_opts = CreateOpts(request_key=None,
response_key=<Unset.UNSET: 'UNSET'>, method='POST',
requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
And the actual data fields on an Execution:
workflow_nameโ the name of the workflow.workflow_idโ the ID of the workflow.descriptionโ a description of the workflow execution.task_execution_idโ a reference to the parent task execution.statusโ can be one of:IDLE,RUNNING,SUCCESS,ERROR, orPAUSED. That's the whole mood ring, no cap. ๐ขstatus_infoโ an optional info string about the status. The little love note attached to the status. ๐paramsโ an optional JSON structure holding workflow type specific parameters.outputโ the output of the workflow.created_atโ the time at which the Execution was created.updated_atโ the time at which the Execution was updated.
๐งฉ openstack.workflow.v2.workflow
๐ธ The Workflow Class
And Workflow also inherits from Resource โ same family, different flavor:
class openstack.workflow.v2.workflow.Workflow(_synchronized=False, connection=None, **attrs)
The base resource, again. Parameters, again:
_synchronizedโ not intended to be used directly, periodt. Seenew()andexisting().connectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects work without an active Connection, like in unit tests. Anything touchingself._connectionin Resource code should protect itself with aNonecheck.
The class attributes:
resource_key = 'workflow'โ singular form of the key for this resource.resources_key = 'workflows'โ plural form of the key for this resource.base_path = '/workflows'โ the base part of the URI for this resource.allow_create = Trueโ allows the create operation for this resource.allow_commit = Trueโ allows the update operation for this resource. (Yes, it's called commit here, stay with me. ๐ซถ)allow_list = Trueโ allows the list operation for this resource.allow_fetch = Trueโ allows the get operation for this resource.allow_delete = Trueโ allows the delete operation for this resource.
And the fields:
nameโ the name of this Workflow.inputโ the inputs for this Workflow.definitionโ a Workflow definition using the Mistral v2 DSL.scopeโ can be either"private"or"public".project_idโ the ID of the associated project.created_atโ the time at which the workflow was created.updated_atโ the time at which the workflow was created.
Okay yes, updated_at says "created" in the docs. That's just what the docs say, I'm not out here inventing lore. Not me being the messenger ๐ญ๐
๐ ๏ธ create(session, prepend_key=True, base_path=None, **params)
Creates a remote resource based on this instance. Like, makes it real. โจ
Parameters:
sessionโ the session to use for making this request.prepend_keyโ DEPRECATED, configurecreate_optsinstead. Whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue.base_pathโ base part of the URI for creating resources, if it's different frombase_path.resource_request_keyโ DEPRECATED, configurecreate_optsinstead. Overrides the usage ofresource_keywhen prepending a key to the request body. Ignored ifprepend_keyis false.resource_response_keyโ DEPRECATED, configurecreate_optsinstead. Overrides the usage ofresource_keywhen processing response bodies. Ignored ifprepend_keyis false.microversionโ API version to override the negotiated one.paramsโ additional params to pass.
Returns: this Resource instance. ๐
Raises: MethodNotSupported if Resource.allow_create is not set to True. So if you forgot to flip that flag, that's on you bestie.
๐ commit(session, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None, **kwargs)
Commits the state of the instance to the remote resource. Push it live, queen. ๐
Parameters:
sessionโ the session to use for making this request.prepend_keyโ whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue.retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults alone.base_pathโ base part of the URI for modifying resources, if it's different frombase_path.microversionโ API version to override the negotiated one.attrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.
Returns: this Resource instance. ๐
Raises: MethodNotSupported if Resource.allow_commit is not set to True. Same energy as before โ flip the flag or get the error.
๐ฎ Low-Level Classes
These next ones are not the ones app devs reach for every day, ngl โ but they're what you use to build applications that talk to OpenStack APIs. Most of the time the Connection Interface handles all this for you, but if you wanna customize, the door's open. ๐ชโจ
๐งฑ Resource
The base resource class, the blueprint, the main character of the whole hierarchy.
Resource is a base class representing a remote resource. The attributes that make up a request or response for this resource are specified as class members on the Resource subclass, where their values are of a component type โ that includes Body, Header, and URI. ๐
For update management, Resource employs a series of _ComponentManager instances to look after the attributes of that particular component type. That's especially useful for the Body and Header types, so only the values that are actually necessary get sent in requests to the server. Efficiency ate. ๐
When making requests, each of the managers gets looked at to gather the necessary URI, body, and header data to build a request that goes out via keystoneauth's sessions. Responses coming back from keystoneauth then get converted into this Resource class' appropriate components and types, and handed right back to the caller. Round trip complete, no notes. ๐
๐งฌ Components
class openstack.resource.Body(name, type=None, default=None, alias=None, aka=None, alternate_id=False, list_type=None, coerce_to_default=False, deprecated=False, deprecation_reason=None)
class openstack.resource.Header(name, type=None, default=None, alias=None, aka=None, alternate_id=False, list_type=None, coerce_to_default=False, deprecated=False, deprecation_reason=None)
class openstack.resource.URI(name, type=None, default=None, alias=None, aka=None, alternate_id=False, list_type=None, coerce_to_default=False, deprecated=False, deprecation_reason=None)
Three besties, same signature. Body, Header, URI. They come as a set. ๐ซถ
๐ The Resource class
class openstack.resource.Resource(_synchronized=False, connection=None, **attrs)
The base resource. Params:
_synchronizedโ not intended to be used directly. Seenew()andexisting(). (You've heard this before, and you'll hear it again. ๐)connectionโ reference to theConnectionbeing used. Defaults toNoneso Resource objects can be used without an active Connection, like in unit tests. Use ofself._connectionin Resource code should protect itself with a check forNone.
Class attributes:
resource_key = Noneโ singular form of the key for this resource.resources_key = Noneโ plural form of the key for this resource.pagination_key = Noneโ key used for pagination links.idโ the ID of this resource.nameโ the name of this resource.locationโ the OpenStack location of this resource.base_path = ''โ the base part of the URI for this resource. Empty string, humble but foundational. โญ
Okay so here are the class-level switches and the actual action buttons on this resource โ permission slips and methods, all the tea. ๐
allow_create = Falseโ the permission slip for the create operation on this resource.allow_fetch = Falseโ the permission slip for the get operation on this resource.allow_commit = Falseโ the permission slip for the update operation on this resource.allow_delete = Falseโ the permission slip for the delete operation on this resource.allow_list = Falseโ the permission slip for the list operation on this resource.allow_head = Falseโ the permission slip for the head operation on this resource.allow_patch = Falseโ the permission slip for the patch operation on this resource.requires_id = Trueโ do calls for this resource require an ID? Yep, default is yes.create_optsโ class-level configuration for the create operation. Subclasses can override this to set per-resource defaults without overridingcreate().
create_opts = CreateOpts(request_key=<Unset.UNSET: 'UNSET'>, response_key=<Unset.UNSET: 'UNSET'>, method='POST', requires_id=<Unset.UNSET: 'UNSET'>, response_has_body=True)
allow_empty_commit = Falseโ commits happen without header or body being dirty.commit_method = 'PUT'โ method for committing a resource. This must bePATCHifallow_patchisTrue.microversion = Noneโ API microversion (string orNone) thisResourcewas loaded with.
keys()โ return a set-like object providing a view on the dict's keys.items()โ return a set-like object providing a view on the dict's items.
classmethod new(**attrs)
Create a new instance of this resource. โจ
When creating the instance, set the _synchronized parameter of Resource to False to indicate that the resource does not yet exist on the server side. This marks all attributes passed in **attrs as "dirty" on the resource, and thusly tracked as necessary in subsequent calls such as update().
attrsโ each of the named arguments will be set as attributes on the resultingResourceobject. These should correspond to either Body or Header values on this resource.
classmethod existing(connection=None, **attrs)
Create an instance of an existing remote resource.
When creating the instance, set the _synchronized parameter of Resource to True to indicate that it represents the state of an existing server-side resource. As such, all attributes passed in **attrs are considered "clean", such that an immediate update() call would not generate a body of attributes to be modified on the server.
attrsโ each of the named arguments will be set as attributes on the resultingResourceobject.
Returns: an instance of self with the passed attributes set.
to_dict(body=True, headers=True, computed=True, ignore_none=False, original_names=False, _to_munch=False)
Return a dictionary of this resource's contents.
bodyโ include the Body attributes in the returned dictionary.headersโ include the Header attributes in the returned dictionary.computedโ include the Computed attributes in the returned dictionary.ignore_noneโ whenTrue, exclude key/value pairs where the value isNone. This will exclude attributes that the server hasn't returned.original_namesโ whenTrue, use attribute names as they were received from the server._to_munchโ for internal use only. Converts toutils.Munchinstead ofdict.
Returns: a dictionary of key/value pairs where keys are named as they exist as attributes of this class.
toDict(body=True, headers=True, computed=True, ignore_none=False, original_names=False, _to_munch=False)
Return a dictionary of this resource's contents. Same exact vibe as to_dict(), bestie โ every knob is still here:
bodyโ include the Body attributes in the returned dictionary.headersโ include the Header attributes in the returned dictionary.computedโ include the Computed attributes in the returned dictionary.ignore_noneโ whenTrue, exclude key/value pairs where the value isNone. This will exclude attributes that the server hasn't returned.original_namesโ whenTrue, use attribute names as they were received from the server._to_munchโ for internal use only. Converts toutils.Munchinstead ofdict.
Returns: a dictionary of key/value pairs where keys are named as they exist as attributes of this class.
copy(body=True, headers=True, computed=True, ignore_none=False, original_names=False, _to_munch=False)
Return a dictionary of this resource's contents. Yes, it's the same contract again โ here's every parameter so nothing gets lost:
bodyโ include the Body attributes in the returned dictionary.headersโ include the Header attributes in the returned dictionary.computedโ include the Computed attributes in the returned dictionary.ignore_noneโ whenTrue, exclude key/value pairs where the value isNone. This will exclude attributes that the server hasn't returned.original_namesโ whenTrue, use attribute names as they were received from the server._to_munchโ for internal use only. Converts toutils.Munchinstead ofdict.
Returns: a dictionary of key/value pairs where keys are named as they exist as attributes of this class.
create(session, prepend_key=True, base_path=None, *, resource_request_key=None, resource_response_key=None, microversion=None, **params)
Create a remote resource based on this instance. ๐
sessionโ the session to use for making this request.prepend_keyโ DEPRECATED โ configurecreate_optsinstead. Whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue.base_pathโ base part of the URI for creating resources, if different frombase_path.resource_request_keyโ DEPRECATED โ configurecreate_optsinstead. Overrides the usage ofresource_keywhen prepending a key to the request body. Ignored ifprepend_keyis false.resource_response_keyโ DEPRECATED โ configurecreate_optsinstead. Overrides the usage ofresource_keywhen processing response bodies. Ignored ifprepend_keyis false.microversionโ API version to override the negotiated one.paramsโ additional params to pass.
Returns: this Resource instance.
Raises: MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_create is not set to True.
classmethod bulk_create(session, data, prepend_key=True, base_path=None, *, microversion=None, **params)
Create multiple remote resources based on this class and data. Group project energy. ๐ฅ
sessionโ the session to use for making this request.dataโ list of dicts, which represent resources to create.prepend_keyโ whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue.base_pathโ base part of the URI for creating resources, if different frombase_path.microversionโ API version to override the negotiated one.paramsโ additional params to pass.
Returns: a generator of Resource objects.
Raises: MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_create is not set to True.
fetch(session, requires_id=True, base_path=None, error_message=None, skip_cache=False, *, resource_response_key=None, microversion=None, **params)
Get a remote resource based on this instance.
sessionโ the session to use for making this request.requires_idโ whether resource ID should be part of the requested URI.base_pathโ base part of the URI for fetching resources, if different frombase_path.error_messageโ an error message to be returned if requested object does not exist.skip_cacheโ a boolean indicating whether optional API cache should be skipped for this invocation.resource_response_keyโ overrides howself.resource_keygets used when the response body is processed. ๐microversionโ API version to override the negotiated one. โจparamsโ extra parameters that can be consumed. ๐
Returns โ this Resource instance. ๐
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_fetch is not set to True. ๐ค
Raises NotFoundException (openstack.exceptions.NotFoundException) if the resource was not found. ๐ญ
head
head(session, base_path=None, *, microversion=None)
Grabs the headers from a remote resource based on this instance. Like, you're not fetching the whole body, just the metadata โ very main character energy. ๐
Parameters
sessionโ the session to use for making this request. ๐ซถbase_pathโ base part of the URI for fetching resources, if it's different frombase_path. (Yes, same name, different job. iconic.) ๐microversionโ API version to override the negotiated one. โจ
Returns โ this Resource instance. ๐
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_head is not set to True. ๐ซ
Raises NotFoundException (openstack.exceptions.NotFoundException) if the resource was not found. ๐ญ
property requires_commit
Tells you whether the next commit() call will actually do anything. Lowkey a vibe check for your pending changes. ๐
commit
commit(session, prepend_key=True, has_body=True,
retry_on_conflict=None, base_path=None, *, microversion=None,
**attrs)
Commits the state of the instance to the remote resource. It's giving "make it official" energy. ๐
Parameters
sessionโ the session to use for making this request. ๐ซถprepend_keyโ whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue. ๐retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults. ๐base_pathโ base part of the URI for modifying resources, if it's different frombase_path. ๐microversionโ API version to override the negotiated one. โจattrsโ attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource. ๐ง
Returns โ this Resource instance. ๐
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_commit is not set to True. ๐ค
patch
patch(session, patch=None, prepend_key=True, has_body=True,
retry_on_conflict=None, base_path=None, *, microversion=None)
Patches the remote resource. ๐ฉน
Lets you modify the resource by providing a list of JSON patches to apply to it. The patches can use both the original (server-side) and SDK field names โ so you can speak either language, no cap. ๐ฅ
Parameters
sessionโ the session to use for making this request. ๐ซถpatchโ additional JSON patch as a list or one patch item. If provided, it's applied on top of any changes to the current resource. ๐prepend_keyโ whether theresource_keyshould be prepended in a resource creation request. Defaults toTrue. ๐retry_on_conflictโ whether to enable retries on HTTP CONFLICT (409). A value ofNoneleaves the Adapter defaults. ๐base_pathโ base part of the URI for modifying resources, if it's different frombase_path. โจmicroversionโ API version to override the negotiated one. โญ
Returns โ this Resource instance. ๐
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_patch is not set to True. ๐ค
delete
delete(session, error_message=None, *, microversion=None,
base_path=None, params=None)
Deletes the remote resource based on this instance. Bye bestie! ๐๐
Parameters
sessionโ the session to use for making this request. ๐ซถmicroversionโ API version to override the negotiated one. โจbase_pathโ base part of the URI for modifying resources, if it's different frombase_path. ๐paramsโ query string parameters to include in the request URL. ๐
Returns โ this Resource instance. ๐
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_commit is not set to True. (Yes, it says allow_commit here โ we're just the messenger. ๐)
Raises NotFoundException (openstack.exceptions.NotFoundException) if the resource was not found. ๐ญ
classmethod list
classmethod list(session, paginated=True, base_path=None,
allow_unknown_params=False, *, microversion=None, headers=None,
max_items=None, **params)
This method is a generator that yields resource objects. It handles pagination and takes query params for response filtering. It's giving "infinite scroll but make it API". ๐
Parameters
sessionโ the session to use for making this request. ๐ซถpaginatedโTrueif a GET to this resource returns a paginated series of responses, orFalseif a GET returns only one page of data. WhenpaginatedisFalse, only one page of data will be returned regardless of the API's support for pagination. ๐base_pathโ base part of the URI for listing resources, if it's different frombase_path. ๐allow_unknown_paramsโTrueto accept but discard unknown query parameters. This lets you get a list of 'filters' and pass everything known to the server.Falsewill result in a validation exception when unknown query parameters are passed. ๐ซmicroversionโ API version to override the negotiated one. โจheadersโ additional headers to inject into the HTTP request. ๐max_itemsโ the maximum number of items to return. Typically this must be used withpaginated=True. ๐ขparamsโ these keyword arguments are passed through the_transpose()method to find if any of them match expected query parameters to be sent in theparamsargument toget(). They're additionally checked against thebase_pathformat string to see if any path fragments need to be filled in by the contents of this argument. Parameters supported as filters by the server side are passed in the API call; remaining parameters are applied as filters to the retrieved results. ๐ง
Returns โ a generator of Resource objects. ๐
Raises MethodNotSupported (openstack.exceptions.MethodNotSupported) if Resource.allow_list is not set to True. ๐ค
Raises InvalidResourceQuery (openstack.exceptions.InvalidResourceQuery) if the query contains invalid params. ๐
classmethod find
classmethod find(session, name_or_id, ignore_missing=True,
list_base_path=None, *, microversion=None, all_projects=None,
**params)
Finds a resource by its name or id. It's giving detective energy. ๐
Parameters
sessionโ the session to use for making this request. ๐ซถname_or_idโ this resource's identifier, if needed by the request. The default isNone. ๐ignore_missingโ when set toFalse,NotFoundException(openstack.exceptions.NotFoundException) will be raised when the resource does not exist. When set toTrue,Nonewill be returned when attempting to find a nonexistent resource. ๐list_base_pathโbase_pathto be used when you need to list resources. ๐microversionโ API version to override the negotiated one. โจparamsโ any additional parameters to be passed into underlying methods, such as toexisting()in order to pass on URI parameters. ๐
Returns โ the Resource object matching the given name or id, or None if nothing matches. ๐
Raises openstack.exceptions.DuplicateResource if more than one resource is found for this request. ๐ญ
Raises openstack.exceptions.NotFoundException if nothing is found and ignore_missing is False. ๐
๐ ServiceDescription ๐
okay bestie, meet the class that tells the SDK how to vibe with a REST service:
class openstack.service_description.ServiceDescription(service_type, supported_versions=None, aliases=None)
This is literally the class that describes how to interact with a REST service. No cap.
Every service in an OpenStack cloud has to be found by looking for it in the catalog. Once the endpoint is found, you can make REST calls โ but you need a Proxy class and some Resource objects to get that object interface, fr fr.
Instances of ServiceDescription can be passed to openstack.connection.Connection.add_service, or a list can be passed to the openstack.connection.Connection constructor in the extra_services argument. iykyk
All three parameters can be provided at instantation time, or a service-specific subclass can be used that sets the attributes directly.
Parameters
service_typeโservice_typeto look for in the keystone catalogaliasesโ Optional list of aliases, if there is more than one name that might be used to register the service in the catalog.service_typeโ mainservice_typeto use to find this service in the catalogsupported_versions = {}โ Dictionary of supported versions and proxy classes for that versionaliases = []โ list of aliases this service might be registered as
๐ง ServiceDescription object ๐ง
same class, same icon energy โ the object version is right above, bestie. The attributes are service_type, supported_versions = {}, and aliases = [], exactly as listed.
๐ ๏ธ Utilities ๐ ๏ธ
๐ธ Errors and warnings ๐ธ
The SDK attempts to provide detailed errors and warnings for things like failed requests, deprecated APIs, and invalid configurations. Application developers are responsible for handling these errors and can opt into warnings to ensure their applications stay up-to-date. you got this, but also handle your exceptions pls
๐ Exceptions ๐
openstacksdk provides a number of exceptions (the Python kind: https://docs.python.org/3/library/exceptions.html) for commonly encountered issues, such as missing API endpoints, various HTTP error codes, timeouts and so forth. It is the responsibility of the calling application to handle these exceptions appropriately.
โญ Available exceptions โญ
Exception definitions, bestie:
exception openstack.exceptions.SDKException(message=None, extra_data=None)โ The base exception class for all exceptions this library raises.exception openstack.exceptions.EndpointNotFound(message=None)โ A mismatch occurred between what the client and server expect.exception openstack.exceptions.InvalidResponse(message=None)โ The response from the server is not valid for this request.exception openstack.exceptions.InvalidRequest(message=None)โ The request to the server is not valid.exception openstack.exceptions.HttpException(message='Error', response=None, http_status=None, details=None, request_id=None)โ The base exception for all HTTP error responses. Initialize RequestException with request and response objects.exception openstack.exceptions.BadRequestException(message='Error', response=None, http_status=None, details=None, request_id=None)โ HTTP 400 Bad Request. Initialize RequestException with request and response objects.exception openstack.exceptions.NotFoundException(message='Error', response=None, http_status=None, details=None, request_id=None)โ HTTP 404 Not Found. Initialize RequestException with request and response objects.exception openstack.exceptions.ForbiddenException(message='Error', response=None, http_status=None, details=None, request_id=None)โ HTTP 403 Forbidden Request. Initialize RequestException with request and response objects.exception openstack.exceptions.ConflictException(message='Error', response=None, http_status=None, details=None, request_id=None)โ HTTP 409 Conflict. Initialize RequestException with request and response objects.exception openstack.exceptions.PreconditionFailedException(message='Error', response=None, http_status=None, details=None, request_id=None)โ HTTP 412 Precondition Failed. Initialize RequestException with request and response objects.exception openstack.exceptions.MethodNotSupported(resource, method)โ The resource does not support this operation type.exception openstack.exceptions.DuplicateResource(message=None, extra_data=None)โ More than one resource exists with that name.exception openstack.exceptions.ResourceTimeout(message=None, extra_data=None)โ Timeout waiting for resource.exception openstack.exceptions.ResourceFailure(message=None, extra_data=None)โ General resource failure.exception openstack.exceptions.InvalidResourceQuery(message=None, extra_data=None)โ Invalid query params for resource.openstack.exceptions.raise_from_response(response, error_message=None)โ Raise an instance of an HTTPException based on keystoneauth response.exception openstack.exceptions.ConfigException(message=None, extra_data=None)โ Something went wrong with parsing your OpenStack Config.exception openstack.exceptions.NotSupported(message=None, extra_data=None)โ Request cannot be performed by any supported API version.exception openstack.exceptions.ValidationException(message=None, extra_data=None)โ Validation failed for resource.exception openstack.exceptions.ServiceDisabledException(message=None, extra_data=None)โ This service is disabled for reasons.exception openstack.exceptions.ServiceDiscoveryException(message=None, extra_data=None)โ The service cannot be discovered.openstack.exceptions.OpenStackCloudExceptionโ alias ofSDKExceptionopenstack.exceptions.ResourceNotFoundโ alias ofNotFoundException
๐ Warnings ๐
openstacksdk uses the warnings infrastructure (https://docs.python.org/3/library/warnings.html) to warn users about deprecated resources and resource fields, as well as deprecated behavior in openstacksdk itself. These warnings are derived from Warning or DeprecationWarning. In Python, warnings are emitted by default while deprecation warnings are silenced by default and must be turned on using the -Wa Python command line option or the PYTHONWARNINGS environment variable. If you are writing an application that uses openstacksdk, you may wish to enable some of these warnings during test runs to ensure you migrate away from deprecated behavior. future-you will thank present-you, bestie
๐ฆ Available warnings ๐ฆ
exception openstack.warnings.OpenStackDeprecationWarningโ Base class for warnings about deprecated features in openstacksdk.exception openstack.warnings.RemovedResourceWarningโ Indicates that a resource has been removed in newer API versions and should not be used.exception openstack.warnings.RemovedFieldWarningโ Indicates that a field has been removed in newer API versions and should not be used.exception openstack.warnings.LegacyAPIWarningโ Indicates an API that is in 'legacy' status, a long term deprecation.exception openstack.warnings.RemovedInSDK50Warningโ Indicates an argument that is deprecated for removal in SDK 5.0.exception openstack.warnings.RemovedInSDK60Warningโ Indicates an argument that is deprecated for removal in SDK 6.0.exception openstack.warnings.OpenStackWarningโ Base class for general warnings in openstacksdk.exception openstack.warnings.ConfigurationWarningโ Indicates an issue with configuration.exception openstack.warnings.UnsupportedServiceVersionโ Indicates a major version that SDK doesn't understand.
๐ Presentations ๐
๐ Multi-Cloud Demo ๐
This document contains a presentation in presentty (https://pypi.org/project/presentty) format. If you want to walk through it like a presentation, install presentty and run:
presentty doc/source/user/multi-cloud-demo.rst
The content is hopefully helpful even if it's not being narrated, so it's being included in the openstacksdk docs. lowkey iconic of them
๐ Who am I? ๐
Monty Taylor
- OpenStack Infra Core
- irc: mordred
- twitter: @e_monty
๐ฅ What are we going to talk about? ๐ฅ
OpenStackSDK
- a task and end-user oriented Python library
- abstracts deployment differences
- designed for multi-cloud
- simple to use
- massive scale
- optional advanced features to handle 20k servers a day
- Initial logic/design extracted from nodepool
- Librified to re-use in Ansible
๐ธ OpenStackSDK is Free Software ๐ธ
https://opendev.org/openstack/openstacksdkopenstack-discuss@lists.openstack.org#openstack-sdks on oftc
โจ This talk is Free Software, too โจ
- Written for presentty (
https://pypi.org/project/presentty) doc/source/user/multi-cloud-demo.rst- examples in
examples/cloud - Paths subject to change - this is the first presentation in tree!
๐ Complete Example ๐
from openstack import cloud as openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
for cloud_name, region_name in [
('my-vexxhost', 'ca-ymq-1'),
('my-citycloud', 'Buf1'),
('my-internap', 'ams01'),
]:
# Initialize cloud
cloud = openstack.connect(cloud=cloud_name, region_name=region_name)
# Upload an image to the cloud
image = cloud.create_image(
'devuan-jessie',
filename='devuan-jessie.qcow2',
wait=True,
)
# Find a flavor with at least 512M of RAM
flavor = cloud.get_flavor_by_ram(512)
# Boot a server, wait for it to boot, and then do whatever is needed
# to get a public ip for it.
cloud.create_server(
'my-server',
image=image,
flavor=flavor,
wait=True,
auto_ip=True,
)
๐ง Let's Take a Few Steps Back ๐ง
Multi-cloud is easy, but you need to know a few things.
- Terminology
- Config
- OpenStackSDK API
๐ Cloud Terminology ๐
Let's define a few terms, so that we can use them with ease:
- cloud - logically related collection of services
- region - completely independent subset of a given cloud
- patron - human who has an account
- user - account on a cloud
- project - logical collection of cloud resources
- domain - collection of users and projects
โญ Cloud Terminology Relationships โญ
- A cloud has one or more regions
- A patron has one or more users
- A patron has one or more projects
- A cloud has one or more domains
- In a cloud with one domain it is named "default"
- Each patron may have their own domain
- Each user is in one domain
- Every project lives inside exactly one domain ๐
- A user holds one or more roles on one or more projects โ that's the whole permission vibe โจ
๐ HTTP Sessions ๐
- Every HTTP interaction gets authenticated through keystone ๐
- Authenticating hands you back a token
- An authenticated HTTP Session is shared across a region โ one session, whole region, slay
โ๏ธ Cloud Regions โ๏ธ
A cloud region is the basic unit of REST interaction. Like, the atom of the whole thing ๐
- A cloud has a service catalog
- The service catalog comes back inside the token
- The service catalog lists the endpoint for each service in each region
- A region is completely autonomous โ it answers to nobody ๐
๐ฅ Users, Projects and Domains ๐ฅ
Okay so in clouds with multiple domains, project and user names are only unique within a region. Yeah. Read that again ๐ญ
- Names need domain info for uniqueness. IDs do not.
- Handing over domain info when it's not needed is totally fine, no harm
project_namerequiresproject_domain_nameorproject_domain_idproject_iddoes notusernamerequiresuser_domain_nameoruser_domain_iduser_iddoes not
๐ต Confused Yet? ๐ต
Don't worry bestie โ you genuinely don't have to deal with most of that. Deep breath, we're fine ๐ซถ
๐ฏ Auth per cloud, select per region ๐ฏ
In general, the thing you actually need to know is:
- Configure authentication per cloud
- Select config to use by cloud and region
๐ clouds.yaml ๐
Information about the clouds you want to connect to lives in a file called clouds.yaml ๐
clouds.yaml can be in your homedir: ~/.config/openstack/clouds.yaml or system-wide: /etc/openstack/clouds.yaml.
Information in your homedir, if it exists, takes precedence. Homedir wins, always, no cap.
Full docs on clouds.yaml are at https://docs.openstack.org/os-client-config/latest/ ๐
๐ What about Mac and Windows? ๐ช
USER_CONFIG_DIR is different on Linux, OSX and Windows. It's giving โจdiversityโจ
- Linux:
~/.config/openstack - OSX:
~/Library/Application Support/openstack - Windows:
C:\Users\USERNAME\AppData\Local\OpenStack\openstack
SITE_CONFIG_DIR is different on Linux, OSX and Windows too:
- Linux:
/etc/openstack - OSX:
/Library/Application Support/openstack - Windows:
C:\ProgramData\OpenStack\openstack
๐ง Config Terminology ๐ง
For multi-cloud situations, think of two types:
profileโ facts about the cloud that are true for everyonecloudโ information specific to a given user
Apologies for the use of cloud twice. The naming committee was on break that day ๐
๐ฑ Environment Variables and Simple Usage ๐ฑ
- Environment variables starting with
OS_go into a cloud calledenvvars - If you only have one cloud, you don't have to specify it ๐
OS_CLOUDandOS_REGION_NAMEare default values forcloudandregion_name
๐ค TOO MUCH TALKING - NOT ENOUGH CODE ๐ค
๐พ basic clouds.yaml for the example code ๐พ
Simple example of a clouds.yaml, just to get your feet wet:
- Config for a named cloud
my-citycloud - Reference a well-known "named" profile:
citycloud os-client-confighas a built-in list of profiles athttps://docs.openstack.org/openstacksdk/latest/user/config/vendor-support.html- Vendor profiles contain various advanced config
- Cloud name can match profile name (we're using different names here for clarity ๐)
clouds:
my-citycloud:
profile: citycloud
auth:
username: mordred
project_id: 65222a4d09ea4c68934fa1028c77f394
user_domain_id: d0919bd5e8d74e49adf0e145807ffc38
project_domain_id: d0919bd5e8d74e49adf0e145807ffc38
Where's the password? ๐คจ (spoiler: next section)
๐ secure.yaml ๐
- Optional extra file, works exactly like
clouds.yaml - Values get overlaid onto
clouds.yaml - Useful if you want to protect secrets more stringently โ very valid, very demure
๐ Example secure.yaml ๐
- No, my password isn't literally
XXXXXXXX๐ญ - Cloud name should match the one in
clouds.yaml - Optional โ bestie, I actually keep mine in my
clouds.yaml๐
clouds:
my-citycloud:
auth:
password: XXXXXXXX
โ more clouds.yaml โ
More information can be provided. It's not just the basics ๐
- Use v3 of the identity API โ even if others are present
- Use
https://image-ca-ymq-1.vexxhost.net/v2for the image API instead of whatever's in the catalog
my-vexxhost:
identity_api_version: 3
image_endpoint_override: https://image-ca-ymq-1.vexxhost.net/v2
profile: vexxhost
auth:
user_domain_id: default
project_domain_id: default
project_name: d8af8a8f-a573-48e6-898a-af333b970a2d
username: 0b8c435b-cc4d-4e05-8a47-a2ada0539af1
๐ Much more complex clouds.yaml example ๐
- Not using a profile โ all settings included, doing it manually ๐
- In the
ams01region there are two networks with undiscoverable qualities - Each one is labeled here so choices can be made
- Any of the settings can be region-specific if needed
- Region settings override cloud settings
- This cloud does not support floating-ips
my-internap:
auth:
auth_url: https://identity.api.cloud.inap.com
username: api-55f9a00fb2619
project_name: inap-17037
identity_api_version: 3
floating_ip_source: None
regions:
- name: ams01
values:
networks:
- name: inap-17037-WAN1654
routes_externally: true
default_interface: true
- name: inap-17037-LAN3631
routes_externally: false
๐ Complete Example Again ๐
from openstack import cloud as openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
for cloud_name, region_name in [
('my-vexxhost', 'ca-ymq-1'),
('my-citycloud', 'Buf1'),
('my-internap', 'ams01')]:
# Initialize cloud
cloud = openstack.connect(cloud=cloud_name, region_name=region_name)
# Upload an image to the cloud
image = cloud.create_image(
'devuan-jessie', filename='devuan-jessie.qcow2', wait=True)
# Find a flavor with at least 512M of RAM
flavor = cloud.get_flavor_by_ram(512)
# Boot a server, wait for it to boot, and then do whatever is needed
# to get a public ip for it.
cloud.create_server(
'my-server', image=image, flavor=flavor, wait=True, auto_ip=True)
๐ช Step By Step ๐ช
๐ฆ Import the library ๐ฆ
from openstack import cloud as openstack
๐ชต Logging ๐ชต
openstacksdkuses standard python loggingopenstack.enable_loggingdoes the easy defaults for you- It squelches some meaningless warnings โ thank you honestly ๐
debug- Logs
openstacksdkloggers at debug level
- Logs
http_debugimpliesdebug, and turns on HTTP tracing
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
๐ Example with Debug Logging ๐
examples/cloud/debug-logging.py
from openstack import cloud as openstack
openstack.enable_logging(debug=True)
cloud = openstack.connect(cloud='my-vexxhost', region_name='ca-ymq-1')
cloud.get_image('Ubuntu 16.04.1 LTS [2017-03-03]')
๐ต๏ธ Example with HTTP Debug Logging ๐ต๏ธ
examples/cloud/http-debug-logging.py
from openstack import cloud as openstack
openstack.enable_logging(http_debug=True)
cloud = openstack.connect(
cloud='my-vexxhost', region_name='ca-ymq-1')
cloud.get_image('Ubuntu 16.04.1 LTS [2017-03-03]')
๐บ๏ธ Cloud Regions ๐บ๏ธ
- The cloud constructor needs
cloudandregion_name openstack.connectis a helper factory function โจ
for cloud_name, region_name in [
('my-vexxhost', 'ca-ymq-1'),
('my-citycloud', 'Buf1'),
('my-internap', 'ams01')
]:
# Initialize cloud
cloud = openstack.connect(cloud=cloud_name, region_name=region_name)
๐ค Upload an Image ๐ค
- Picks the correct upload mechanism for you, no thinking required
- SUGGESTION Always upload your own base images ๐
# Upload an image to the cloud
image = cloud.create_image(
'devuan-jessie',
filename='devuan-jessie.qcow2',
wait=True,
)
๐พ Always Upload an Image ๐พ
Ok. You don't have to. But, for multi-cloud...
- Images with the same content are named differently on different clouds
- Images with the same name on different clouds can have different content
- Upload your own to all clouds and both problems just vanish โจ
- Download from the OS vendor, or build with
diskimage-builder
๐ฆ Find a flavor ๐ฆ
- Flavors are all named differently on clouds (of course they are ๐ญ)
- Flavors can be found via RAM
get_flavor_by_ramfinds the smallest matching flavor
# Find a flavor with at least 512M of RAM
flavor = cloud.get_flavor_by_ram(512)
๐ Create a server ๐
my-vexxhost- Boot server
- Wait for
status==ACTIVE
my-internap- Boot server on network
inap-17037-WAN1654 - Wait for
status==ACTIVE
- Boot server on network
my-citycloud- Boot server
- Wait for
status==ACTIVE - Find the port for the
fixed_ipfor the server - Create a floating-ip on that port
- Wait for the floating-ip to attach
# Boot a server, wait for it to boot, and then do whatever is needed
# to get a public ip for it.
cloud.create_server(
'my-server', image=image, flavor=flavor, wait=True, auto_ip=True)
Wow. We didn't even deploy Wordpress! ๐ญ๐
๐ท๏ธ Image and Flavor by Name or ID ๐ท๏ธ
- Pass a string to image/flavor
- The Image/Flavor will be found by name or ID
- Common pattern
examples/cloud/create-server-name-or-id.py
from openstack import cloud as openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
for cloud_name, region_name, image, flavor in [
('my-vexxhost', 'ca-ymq-1',
'Ubuntu 16.04.1 LTS [2017-03-03]', 'v1-standard-4'),
('my-citycloud', 'Buf1',
'Ubuntu 16.04 Xenial Xerus', '4C-4GB-100GB'),
('my-internap', 'ams01',
'Ubuntu 16.04 LTS (Xenial Xerus)', 'A1.4')]:
# Initialize cloud
cloud = openstack.connect(cloud=cloud_name, region_name=region_name)
# Boot a server, wait for it to boot, and then do whatever is needed
# to get a public ip for it.
server = cloud.create_server(
'my-server', image=image, flavor=flavor, wait=True, auto_ip=True)
print(server.name)
print(server['name'])
cloud.pprint(server)
# Delete it - this is a demo
cloud.delete_server(server, wait=True, delete_ips=True)
๐งน Delete Servers ๐งน
delete_ipsโ delete anyfloating_ipsthe server may have
cloud.delete_server('my-server', wait=True, delete_ips=True)
๐ Image and Flavor by Dict ๐
- Pass a dict to image/flavor
- If you know whether the value is a Name or an ID ๐
- Common pattern
examples/cloud/create-server-dict.py
from openstack import cloud as openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
for cloud_name, region_name, image, flavor_id in [
('my-vexxhost', 'ca-ymq-1', 'Ubuntu 16.04.1 LTS [2017-03-03]',
'5cf64088-893b-46b5-9bb1-ee020277635d'),
('my-citycloud', 'Buf1', 'Ubuntu 16.04 Xenial Xerus',
'0dab10b5-42a2-438e-be7b-505741a7ffcc'),
('my-internap', 'ams01', 'Ubuntu 16.04 LTS (Xenial Xerus)',
'A1.4')]:
# Initialize cloud
cloud = openstack.connect(cloud=cloud_name, region_name=region_name)
# Boot a server, wait for it to boot, and then do whatever is needed
# to get a public ip for it.
server = cloud.create_server(
'my-server', image=image, flavor=dict(id=flavor_id),
wait=True, auto_ip=True)
# Delete it - this is a demo
cloud.delete_server(server, wait=True, delete_ips=True)
๐ธ Munch Objects ๐ธ
ok so this is one of my favorite little things, bestie ๐
- They behave like a dict and like an object โ both at once, no cap
- peep the example at
examples/cloud/munch-dict-object.py
from openstack import cloud as openstack
openstack.enable_logging(debug=True)
cloud = openstack.connect(cloud='zetta', region_name='no-osl1')
image = cloud.get_image('Ubuntu 14.04 (AMD64) [Local Storage]')
print(image.name)
print(image['name'])
like?? image.name and image['name'] are the same thing?? iconic behaviour honestly โจ
๐ฆ API Organized by Logical Resource ๐ฆ
the naming here is so clean, it's giving main character energy:
list_serverssearch_serversget_servercreate_serverdelete_serverupdate_server
and for everything else, it's still {verb}_{noun} โ the pattern never misses ๐
attach_volumewait_for_serveradd_auto_ip
๐ Cleanup Script ๐
ngl, sometimes my examples had bugs ๐ญ so here's the cleanup situation:
- it lives at
examples/cloud/cleanup-servers.py
from openstack import cloud as openstack
# Initialize and turn on debug logging
openstack.enable_logging(debug=True)
for cloud_name, region_name in [
('my-vexxhost', 'ca-ymq-1'),
('my-citycloud', 'Buf1'),
('my-internap', 'ams01')]:
# Initialize cloud
cloud = openstack.connect(cloud=cloud_name, region_name=region_name)
for server in cloud.search_servers('my-server'):
cloud.delete_server(server, wait=True, delete_ips=True)
๐ Normalization ๐
examples/cloud/normalization.py
from openstack import cloud as openstack
openstack.enable_logging()
cloud = openstack.connect(cloud='fuga', region_name='cystack')
image = cloud.get_image(
'Ubuntu 16.04 LTS - Xenial Xerus - 64-bit - Fuga Cloud Based Image')
cloud.pprint(image)
โญ Strict Normalized Results โญ
- it returns only the declared model โ nothing extra, no crumbs, periodt
examples/cloud/strict-mode.py
from openstack import cloud as openstack
openstack.enable_logging()
cloud = openstack.connect(
cloud='fuga', region_name='cystack', strict=True)
image = cloud.get_image(
'Ubuntu 16.04 LTS - Xenial Xerus - 64-bit - Fuga Cloud Based Image')
cloud.pprint(image)
๐ง How Did I Find the Image Name for the Last Example? ๐ง
- honestly? I often make stupid little utility scripts ๐ and they ate
examples/cloud/find-an-image.py
from openstack import cloud as openstack
openstack.enable_logging()
cloud = openstack.connect(cloud='fuga', region_name='cystack')
cloud.pprint([
image for image in cloud.list_images()
if 'ubuntu' in image.name.lower()])
๐ฅ Added / Modified Information ๐ฅ
- Servers need more extra help โ they're high maintenance like that
- Fetch addresses dict from neutron
- Figure out which IPs are good
detailedโ defaults toTrue, add everythingbareโ no extra calls โ don't even fix broken thingsbareis still normalizedexamples/cloud/server-information.py
from openstack import cloud as openstack
openstack.enable_logging(debug=True)
cloud = openstack.connect(cloud='my-citycloud', region_name='Buf1')
try:
server = cloud.create_server(
'my-server', image='Ubuntu 16.04 Xenial Xerus',
flavor=dict(id='0dab10b5-42a2-438e-be7b-505741a7ffcc'),
wait=True, auto_ip=True)
print("\n\nFull Server\n\n")
cloud.pprint(server)
print("\n\nTurn Detailed Off\n\n")
cloud.pprint(cloud.get_server('my-server', detailed=False))
print("\n\nBare Server\n\n")
cloud.pprint(cloud.get_server('my-server', bare=True))
finally:
# Delete it - this is a demo
cloud.delete_server(server, wait=True, delete_ips=True)
๐ Exceptions ๐
ok pay attention bestie, this part is important:
- All openstacksdk exceptions are subclasses of
OpenStackCloudException - Direct REST calls throw
OpenStackCloudHTTPError OpenStackCloudHTTPErrorsubclassesOpenStackCloudExceptionandrequests.exceptions.HTTPErrorOpenStackCloudURINotFoundfor 404OpenStackCloudBadRequestfor 400
๐ User Agent Info ๐
- Set
app_nameandapp_versionfor User Agents - (
ssh ... region_nameis optional if the cloud has one region) examples/cloud/user-agent.py
from openstack import cloud as openstack
openstack.enable_logging(http_debug=True)
cloud = openstack.connect(
cloud='datacentred',
app_name='AmazingApp',
app_version='1.0',
)
cloud.list_networks()
๐ Uploading Large Objects ๐
- swift has a maximum object size โ rude, but okay
- Large Objects are uploaded specially
- openstacksdk figures this out and does it for you ๐ซถ
- multi-threaded, we love efficiency
examples/cloud/upload-object.py
from openstack import cloud as openstack
openstack.enable_logging(debug=True)
cloud = openstack.connect(cloud='ovh', region_name='SBG1')
cloud.create_object(
container='my-container',
name='my-object',
filename='/home/mordred/briarcliff.sh3d',
)
cloud.delete_object('my-container', 'my-object')
cloud.delete_container('my-container')
๐ Uploading Large Objects ๐
(yes, same title again โ it's a sequel, and sequels slay)
- Default
max_file_sizeis5G - This is a conference demo, be normal about it
- Let's force a
segment_size - One MILLION bytes ๐
examples/cloud/upload-object.py
from openstack import cloud as openstack
openstack.enable_logging(debug=True)
cloud = openstack.connect(cloud='ovh', region_name='SBG1')
cloud.create_object(
container='my-container',
name='my-object',
filename='/home/mordred/briarcliff.sh3d',
segment_size=1000000,
)
cloud.delete_object('my-container', 'my-object')
cloud.delete_container('my-container')
๐ Service Conditionals ๐
from openstack import cloud as openstack
openstack.enable_logging(debug=True)
cloud = openstack.connect(cloud='kiss', region_name='region1')
print(cloud.has_service('network'))
print(cloud.has_service('container-orchestration'))
๐ธ Service Conditional Overrides ๐ธ
- Sometimes clouds are weird and figuring that out won't work โ respectfully, some clouds just have main character energy of their own ๐ญ
from openstack import cloud as openstack
openstack.enable_logging(debug=True)
cloud = openstack.connect(cloud='rax', region_name='DFW')
print(cloud.has_service('network'))
clouds:
rax:
profile: rackspace
auth:
username: mordred
project_id: 245018
# This is already in profile: rackspace
has_network: false
โจ FIN โจ
๐ FOR CONTRIBUTORS ๐
๐ซถ Contributing to the OpenStack SDK ๐ซถ
okay so this whole section is for the girlies who wanna contribute to the development of this SDK ๐
This section of documentation pertains to those who wish to contribute to the development of this SDK. If you're looking for documentation on how to use the SDK to build applications, refer to the ../user section instead โ that's the vibe you want, bestie.
๐ฆ About the Project ๐ฆ
The OpenStack SDK is a OpenStack project aimed at providing a complete software development kit for the programs which make up the OpenStack community. It is a Python library with corresponding documentation, examples, and tools released under the Apache 2 license. iconic, honestly ๐
๐ A Brief History ๐
okay storytime, because this is genuinely so interesting โ openstacksdk started its life as three different libraries: shade, os-client-config and python-openstacksdk. three separate girlies who eventually realized they were the same girlie ๐ญ
shade โ shade started its life as some code inside of OpenStack Infra's nodepool project (https://docs.openstack.org/infra/nodepool/), and as some code inside of the Ansible OpenStack Modules (http://docs.ansible.com/ansible/latest/list_of_cloud_modules.html#openstack). Ansible had a bunch of different OpenStack related modules, and there was a ton of duplicated code. Eventually, between refactoring that duplication into an internal library, and adding the logic and features that the OpenStack Infra team had developed to run client applications at scale, it turned out that we'd written nine-tenths of what we'd need to have a standalone library. like, oops? accidental whole library ๐
Because of its background from nodepool, shade contained abstractions to work around deployment differences and is resource oriented rather than service oriented. This allows a user to think about Security Groups without having to know whether Security Groups are provided by Nova or Neutron on a given cloud. On the other hand, as an interface that provides an abstraction, it deviates from the published OpenStack REST API and adds its own opinions, which may not get in the way of more advanced users with specific needs. so: convenient, but opinionated. know that going in ๐ซถ
os-client-config โ os-client-config was a library for collecting client configuration for using an OpenStack cloud in a consistent and comprehensive manner, which introduced the clouds.yaml file for expressing named cloud configurations. yes THAT clouds.yaml. she invented it. mother behavior.
python-openstacksdk โ python-openstacksdk was a library that exposed the OpenStack APIs to developers in a consistent and predictable manner.
After a while it became clear that there was value in both the high-level layer that contains additional business logic and the lower-level SDK that exposes services and their resources faithfully and consistently as Python objects. Even with both of those layers, it is still beneficial at times to be able to make direct REST calls and to do so with the same properly configured Session (http://docs.python-requests.org/en/master/user/advanced/#session-objects) from python-requests (http://docs.python-requests.org/en/master/). This led to the merge of the three projects. three become one. the avengers of Python OpenStack libraries, fr fr ๐
The original contents of the shade library have been moved into openstack.cloud and os-client-config has been moved in to openstack.config. so if you're looking for the old stuff, that's where she lives now ๐
โญ Contribution Mechanics โญ
๐ง Contributing to openstacksdk ๐ง
If you're interested in contributing to the openstacksdk project, the following will help get you started. come through, we'd love to have you ๐ซถโจ
๐ Developer Certificate of Origin
okay bestie, real talk: if you wanna contribute to openstacksdk, you have to adhere to the Developer Certificate of Origin (https://developercertificate.org/) โ no cap. OpenStack uses the DCO as a lightweight way to confirm you're actually entitled to contribute the code you're submitting. This makes sure you're giving your contributions under the project's license and that you have the right to do it. ๐
Please read DeveloperWorkflow (https://docs.openstack.org/infra/manual/developers.html#development-workflow) before sending your first patch for review. And heads up: pull requests submitted through GitHub will be ignored. ๐
See also:
๐ฆ Project Hosting Details
- Project Documentation โ
https://docs.openstack.org/openstacksdk/latest/ - Bug tracker โ
https://bugs.launchpad.net/openstacksdk - Mailing list (prefix subjects with
[sdk]for faster responses) โhttps://lists.openstack.org/mailman3/lists/openstack-discuss.lists.openstack.org/ - Code Hosting โ
https://opendev.org/openstack/openstacksdk - Code Review โ
https://review.opendev.org/#/q/status:open+project:openstack/openstacksdk,n,z
๐ฌ Contacting the Developers
๐ IRC
The developers of this project are available in the #openstack-sdks channel on OFTC IRC (http://webchat.oftc.net?channels=%23openstack-sdks). This channel includes conversation on SDKs and tools within the general OpenStack community, including OpenStackClient as well as occasional talk about SDKs created for languages outside of Python. ๐ซถ
๐ง Email
The openstack-discuss mailing list (mailto:openstack-discuss@lists.openstack.org?subject=[sdk]%20Question%20about%20openstacksdk) fields questions of all types on OpenStack. Using the [sdk] filter to begin your email subject will ensure that the message gets to SDK developers. โจ
โจ Coding Standards
We are a bit stricter than usual in the coding standards department. It's a good idea to read through the coding <> section. ๐
๐ OpenStack SDK Developer Coding Standards
In the beginning, there were no guidelines. And it was good. But that didn't last long. As more and more people added more and more code, we realized that we needed a set of coding standards to make sure that the openstacksdk API at least attempted to display some form of consistency.
Thus, these coding standards/guidelines were developed. Note that not all of openstacksdk adheres to these standards just yet. Some older code has not been updated because we need to maintain backward compatibility. Some of it just hasn't been changed yet. But be clear: all new code must adhere to these guidelines. ๐
Below are the patterns that we expect openstacksdk developers to follow.
๐ Release Notes
openstacksdk uses reno (https://docs.openstack.org/reno/latest/) for managing its release notes. A new release note should be added to your contribution anytime you add new API calls, fix significant bugs, add new functionality or parameters to existing API calls, or make any other significant changes to the code base that we should draw attention to for the user base.
It is not necessary to add release notes for minor fixes, such as correction of documentation typos, minor code cleanup or reorganization, or any other change that a user would not notice through normal usage. ๐ง
๐ Exceptions
Exceptions should NEVER be wrapped and re-raised inside of a new exception. This removes important debug information from the user. All of the exceptions should be raised correctly the first time.
โ๏ธ openstack.cloud API Methods
The openstack.cloud layer has some specific rules:
- When an API call acts on a resource that has both a unique ID and a name, that API call should accept either identifier with a
name_or_idparameter. - All resources should adhere to the
get/list/searchinterface that control retrieval of those resources. E.g.,get_image(),list_images(),search_images(). - Resources should have
create_RESOURCE(),delete_RESOURCE(),update_RESOURCE()API methods (as it makes sense). - For those methods that should behave differently for omitted or
None-valued parameters, use the_utils.valid_kwargsdecorator. This includes all Neutronupdate_*functions. - Deleting a resource should return
Trueif the delete succeeded, orFalseif the resource was not found. ๐ซถ
๐ธ Returned Resources
The openstack.cloud layer should rely on the proxy layer for the given service. This will ensure complex objects returned to the caller are of openstack.resource.Resource type.
๐ Nova vs. Neutron
- Recognize that not all cloud providers support Neutron, so never assume it will be present. If a task can be handled by either Neutron or Nova, code it to be handled by either.
- For methods that accept either a Nova pool or Neutron network, the parameter should just refer to the network, but documentation of it should explain about the pool. See:
create_floating_ip()andavailable_floating_ip()methods.
๐ง Tests
- New API methods must have unit tests!
- New unit tests should only mock at the REST layer using
requests_mock. Any mocking of openstacksdk itself should be considered legacy and to be avoided. Exceptions to this rule can be made when attempting to test the internals of a logical shim where the inputs and output of the method aren't actually impacted by remote content. - Functional tests should be added, when possible.
- In functional tests, always use unique names (for resources that have this attribute) and use it for clean up (see next point).
- In functional tests, always define cleanup functions to delete data added by your test, should something go wrong. Data removal should be wrapped in a
try exceptblock and try to delete as many entries added by the test as possible. ๐
๐ ๏ธ Development Environment
The first step towards contributing code and documentation is to setup your development environment. We use a pretty standard setup, but it is fully documented in our setup <> section.
๐ Creating a Development Environment
๐งฐ Required Tools
Python โ As the OpenStack SDK is developed in Python, you will need at least one version of Python installed. Our continuous integration system runs against several versions, so ultimately we will have the proper test coverage, but having multiple versions locally results in less time spent in code review when changes unexpectedly break other versions.
Python can be downloaded from https://www.python.org/downloads. ๐
virtualenv โ In order to isolate our development environment from the system-based Python installation, we use virtualenv (https://virtualenv.pypa.io/en/latest/). This allows us to install all of our necessary dependencies without interfering with anything else, and preventing others from interfering with us. Virtualenv must be installed on your system in order to use it, and it can be had from PyPI, via pip, as follows. Note that you may need to run this as an administrator in some situations.:
$ apt-get install python3-virtualenv # Debian based platforms
$ dnf install python3-virtualenv # Red Hat based platforms
$ pip install virtualenv # Mac OS X and other platforms
You can create a virtualenv in any location. A common usage is to store all of your virtualenvs in the same place, such as under your home directory. To create a virtualenv for the default Python, run the following:
$ virtualenv $HOME/envs/sdk
To create an environment for a different version, run the following:
$ virtualenv -p python3 $HOME/envs/sdk3
When you want to enable your environment so that you can develop inside of it, you activate it. To activate an environment, run the /bin/activate script inside of it, like the following:
$ source $HOME/envs/sdk3/bin/activate
(sdk3)$
Once you are activated, you will see the environment name in front of your command prompt. In order to exit that environment, run the deactivate command. โจ
tox โ We use tox (https://tox.readthedocs.org/en/latest/) as our test runner, which allows us to run the same test commands against multiple versions of Python. Inside any of the virtualenvs you use for working on the SDK, run the following to install tox into it.:
(sdk3)$ pip install tox
Git โ The source of the OpenStack SDK is stored in Git. In order to work with our source repository, you must have Git installed on your system. If your system has a package manager, it can likely be had from there. If not, you can find downloads or the source at http://git-scm.com. ๐ธ
๐ฆ Getting the Source Code
Note: Before checking out the code, please read the OpenDev Developer's Guide (https://docs.opendev.org/opendev/infra-manual/latest/developers.html) for details on how to use the continuous integration and code review systems that we use.
The canonical Git repository is hosted on opendev.org at http://opendev.org/openstack/openstacksdk/:
(sdk3)$ git clone https://opendev.org/openstack/openstacksdk
(sdk3)$ cd openstacksdk
๐ Installing Dependencies
In order to work with the SDK locally, such as in the interactive interpreter or to run example scripts, you need to install the project's dependencies.:
(sdk3)$ pip install -r requirements.txt
After the downloads and installs are complete, you'll have a fully functional environment to use the SDK in. ๐
๐ Building the Documentation
Our documentation is written in reStructured Text and is built using Sphinx. A docs command is available in our tox.ini, allowing you to build the documentation like you'd run tests. The docs command is not evaluated by default.:
(sdk3)$ tox -e docs
That command will cause the documentation, which lives in the docs folder, to be built. HTML output is the most commonly referenced, which is located in docs/build/html. ๐ฆ
๐ Testing
The project contains two test packages, one for unit tests and one for functional tests. The openstack.tests.unit package tests the SDK's features in isolation. The openstack.tests.functional package tests the SDK's features and examples against an OpenStack cloud.
๐ Testing (the tox one)
The tests are run with tox (https://tox.readthedocs.org/en/latest/) and configured in tox.ini. The test results are tracked by stestr (https://stestr.readthedocs.io/en/latest/) and configured in .stestr.conf and via command line options passed to the stestr executable when it's called by tox. ๐ฅ
Unit Tests
Running tests
okay so bestie, if you wanna run the entire unit test suite, literally just run the tox command inside your source checkout. That's it. It'll attempt to run every test command listed inside tox.ini, which includes Python 3.x and a PEP 8 check. And listen โ you should run the full suite on all versions before submitting changes for review, because otherwise the continuous integration system will surprise you with failures and nobody wants that energy ๐
$ tox
...
py3: commands succeeded
pep8: commands succeeded
congratulations :)
During development though, it's lowkey more convenient to run a subset of the tests so test time stays minimal. You can pick just one version to run on. And a step further than that: run only the tests you're actually working on ๐
# Run run the tests on Python 3.13
$ tox -e py313
# Run only the compute unit tests on Python 3.13
$ tox -e py313 openstack.tests.unit.compute
# Run only the tests in a specific file on Python 3.13
$ tox -e py313 -- -n openstack/tests/unit/compute/test_version.py
Functional Tests
so the functional tests assume you have a public or private OpenStack cloud you can run the tests against. The tests must be able to be run against public clouds, but first and foremost they must be run against OpenStack. In practice that means the tests should initially be run against a stable branch of DevStack โ https://docs.openstack.org/devstack/latest/ โจ
Configuration
To connect the functional tests to an OpenStack cloud we require a clouds.yaml file, as discussed in Configuring OpenStack SDK Applications. You can place this clouds.yaml file in the root of your source checkout or in one of the other standard locations, $HOME/.config/openstack or /etc/openstack.
There must be at least three clouds configured โ or rather, three accounts configured for the one cloud. Those accounts are:
- An admin account, which defaults to
devstack-adminbut is configurable via theOPENSTACKSDK_OPERATOR_CLOUDenvironment variable, - A user account, which defaults to
devstackbut is configurable via theOPENSTACKSDK_DEMO_CLOUDenvironment variable, and - An alternate user account, which defaults to
devstack-demobut is configurable via theOPENSTACKSDK_DEMO_CLOUD_ALTenvironment variable
In addition, you must indicate the names of the flavor and image that should be used for tests. These can be configured via OPENSTACKSDK_FLAVOR and OPENSTACKSDK_IMAGE environment variables or functional.flavor_name and functional.image_name settings in the clouds.yaml file, respectively.
Finally, you can configure the timeout for tests using the OPENSTACKSDK_FUNC_TEST_TIMEOUT environment variable (defaults to 300 seconds). Some test modules take specific timeout values. For example, all tests in openstack.tests.functional.compute will check for the OPENSTACKSDK_FUNC_TEST_TIMEOUT_COMPUTE environment variable before checking for OPENSTACKSDK_FUNC_TEST_TIMEOUT. ๐ซถ
Note: Recent versions of DevStack will configure a suitableclouds.yamlfile for you, which will be placed at/etc/openstack/clouds.yaml.
This is an example of a minimal configuration for a clouds.yaml that connects the functional tests to a DevStack instance ๐
clouds:
devstack:
auth:
auth_url: http://xxx.xxx.xxx.xxx/identity
password: password
project_domain_id: default
project_name: demo
user_domain_id: default
username: demo
identity_api_version: '3'
region_name: RegionOne
volume_api_version: '3'
devstack-admin:
auth:
auth_url: http://xxx.xxx.xxx.xxx/identity
password: password
project_domain_id: default
project_name: admin
user_domain_id: default
username: admin
region_name: RegionOne
devstack-alt:
auth:
auth_url: http://xxx.xxx.xxx.xxx/identity
password: password
project_domain_id: default
project_name: alt_demo
user_domain_id: default
username: alt_demo
region_name: RegionOne
example:
image_name: cirros-0.5.2-x86_64-disk
flavor_name: m1.small
Replace xxx.xxx.xxx.xxx with the IP address or FQDN of your DevStack instance. no cap, that part matters ๐ธ
Running tests
functional tests are also run against multiple Python versions. In order to run the entire functional test suite against the default Python 3 version in your environment, run the tox -e functional command inside of your source checkout. This will attempt to run every test in the openstack/tests/functional directory. For example:
$ tox -e functional
...
functional: commands succeeded
congratulations :)
Project Layout
The project contains a top-level openstack package, which houses several modules that form the foundation upon which each service's API is built on. Under the openstack package are packages for each of those services, such as openstack.compute. ๐ฆ
How the SDK is organized
The following diagram shows how the project is laid out.
openstack/
connection.py
resource.py
compute/
compute_service.py
v2/
server.py
_proxy.py
tests/
compute/
v2/
test_server.py
Resource
The openstack.resource.Resource base class is the building block of any service implementation. Resource objects correspond to the resources each service's REST API works with, so the openstack.compute.v2.server.Server subclass maps to the compute service's https://openstack:1234/v2/servers resource. it's giving mapping ๐
The base Resource contains methods to support the typical CRUD operations supported by REST APIs, and handles the construction of URLs and calling the appropriate HTTP verb on the given Adapter.
Values sent to or returned from the service are implemented as attributes on the Resource subclass using component objects such as resource.Body, resource.Header and resource.URI, depending on where in the request or response the value lives. Each component is created with the exact name of what the API expects, and can optionally include a type to be validated against on requests. You should choose an attribute name that follows PEP-8, regardless of what the server-side expects, as the component becomes a mapping between the two. โจ
is_public = resource.Body('os-flavor-access:is_public', type=bool)
There are six additional attributes which the Resource class checks before making requests to the REST API. allow_create, allow_fetch, allow_commit, allow_delete, allow_head, and allow_list are set to True or False, and are checked before making the corresponding method call.
The base_path attribute should be set to the URL which corresponds to this resource. Many base_paths are simple, such as "/servers". For base_paths which are composed of non-static information, Python's string replacement is used, e.g., base_path = "/servers/%(server_id)s/ips".
resource_key and resources_key are attributes to set when a Resource returns more than one item in a response, or otherwise requires a key to obtain the response value. For example, the Server class sets resource_key = "server" as an individual Server is stored in a dictionary keyed with the singular noun, and resources_key = "servers" as multiple Servers are stored in a dictionary keyed with the plural noun in the response. iykyk ๐
Proxy
Each service implements a Proxy class based on Proxy, within the openstack/<program_name>/vX/_proxy.py module. For example, the v2 compute service's Proxy exists in openstack/compute/v2/_proxy.py.
The Proxy class is based on Adapter.
class openstack.proxy.Proxy(session, *, service_type=None,
service_name=None, interface=None, region_name=None,
endpoint_override=None, version=None, auth=None, user_agent=None,
connect_retries=None, logger=None, allow=None, additional_headers=None,
client_name=None, client_version=None, allow_version_hack=None,
global_request_id=None, min_version=None, max_version=None,
default_microversion=None, status_code_retries=None,
retriable_status_codes=None, raise_exc=None, rate_limit=None,
concurrency=None, connect_retry_delay=None,
status_code_retry_delay=None, statsd_client=None, statsd_prefix=None,
prometheus_counter=None, prometheus_histogram=None,
influxdb_config=None, influxdb_client=None)
Bases: Adapter
Represents a service.
api_versionโ The API version. This is used as a descriminating attribute for type checking.retriable_status_codes = Noneโ HTTP status codes that should be retried by default. The number of retries is defined by the configuration in parameters called<service-type>_status_code_retries.
Each service's Proxy provides a higher-level interface for users to work with via a Connection instance. ๐ฅ
Rather than requiring users to maintain their own Adapter and work with lower-level Resource objects, the Proxy interface offers a place to make things easier for the caller.
Each Proxy class implements methods which act on the underlying Resource classes which represent the service. For example:
def list_flavors(self, **params):
return flavor.Flavor.list(self.session, **params)
This method is operating on the openstack.compute.v2.flavor.Flavor.list method. For the time being, it simply passes on the Adapter maintained by the Proxy, and returns what the underlying Resource.list method does. slay ๐
Cloud
The openstack.cloud package provides the high-level cloud abstraction layer, historically known as shade. Where the Proxy interface maps closely onto a single service's REST API, the cloud layer offers business-logic-oriented methods that often span multiple requests, or even multiple services, and that normalize the differences between clouds. ๐
The layer is implemented as a collection of mixin classes, one per service area, under openstack/cloud/ โ for example, _compute.py provides ComputeCloudMixin and _network.py provides NetworkCloudMixin. These mixins get smooshed together into the Connection class, so their methods are lowkey just there on a Connection instance, right next to all the service Proxy objects. Like, Connection.create_server may create a server, wait for it to become active, attach a floating IP, and hand you back a normalized result โ orchestrating several lower-level Proxy and Resource calls on the caller's behalf. She's doing a lot of work so you don't have to ๐
Application authors are generally encouraged to use these high-level methods where they exist, and fall back to the Proxy interface for the operations the cloud layer doesn't cover.
๐ซถ Connection
The openstack.connection.Connection class builds on top of an openstack.config.cloud_region.CloudRegion object, and gives you a higher-level interface constructed from Proxy objects from each of the services.
The Connection class' primary purpose is to act as a high-level interface to this SDK, managing the lower-level connection bits and exposing the Resource objects through their corresponding Proxy object.
So if you've built proper Resource objects and implemented methods on the corresponding Proxy object, congrats bestie โ the high-level interface to your service is now exposed. ๐
โจ Adding Features โจ
Does this SDK not do what you need it to do? Is it missing a service? Are you a developer on another project who wants to add their service? You're in the right place, bb. Below are examples of how to add new features to the OpenStack SDK. ๐ ๏ธ
๐ธ Creating a New Resource
This guide walks you through how to add resources for a service.
๐ Naming Conventions
Above all, names across this project conform to Python's naming standards, as laid out in PEP 8 (https://www.python.org/dev/peps/pep-0008/).
The relevant details we need to know are as follows:
- Module names are lower case, and separated by underscores if there's more than one word. For example,
openstack.object_store - Class names are capitalized, with no spacing, and each subsequent word is capitalized in a name. For example,
ServerMetadata - Attributes on classes, including methods, are lower case and separated by underscores. For example,
allow_listorget_data
๐ฆ Services
Services in the OpenStack SDK are named after their program name, not their code name. For example, the project everyone calls "Nova" is always called "compute" within this SDK. No cap.
This guide walks through creating a service for an OpenStack program called "Fake". Following our guidelines, the code for its service would live under the openstack.fake namespace. What follows is the creation of a Resource class for the "Fake" service.
๐ Resources
Resources are named after the server-side resource, which is set in the base_path attribute of the resource class. This guide creates a resource class for the /fake server resource, so the resource module is called fake.py and the class is called Fake.
๐ An Example
openstack/fake/fake_service.py
# Apache 2 header omitted for brevity
from openstack import service_description
from openstack.fake.v2 import _proxy as _proxy_v2
class FakeService(service_description.ServiceDescription):
"""The fake service."""
supported_versions = {
'2': _proxy_v2.Proxy,
}
openstack/fake/v2/fake.py
# Apache 2 header omitted for brevity
from openstack import resource
class Fake(resource.Resource):
resource_key = "resource"
resources_key = "resources"
base_path = "/fake"
allow_create = True
allow_fetch = True
allow_commit = True
allow_delete = True
allow_list = True
allow_head = True
#: The transaction date and time.
timestamp = resource.Header("x-timestamp")
#: The name of this resource.
name = resource.Body("name", alternate_id=True)
#: The value of the resource. Also available in headers.
value = resource.Body("value", alias="x-resource-value")
#: Is this resource cool? If so, set it to True.
#: This is a multi-line comment about cool stuff.
cool = resource.Body("cool", type=bool)
๐ fake.Fake Attributes
Each service's resources inherit from Resource, so they can override any of the base attributes to fit the way their particular resource operates. It's giving customizable, fr fr.
๐ resource_key and resources_key
These attributes are set based on how your resource responds with data. The default values for each of these are None, which works fine when your resource returns a JSON body you can use directly without a top-level key, such as {"name": "Ernie Banks", ...}".
But our Fake resource returns JSON bodies that have the details of the resource one level deeper, such as {"resources": {"name": "Ernie Banks", ...}, {...}}. It does a similar thing with single resources, putting them inside a dictionary keyed on "resource".
By setting Fake.resource_key on line 7, we tell the Resource.create, Resource.fetch, and Resource.commit methods that we're either sending or receiving a resource that's in a dictionary with that key. โจ
By setting Fake.resources_key on line 8, we tell the Resource.list method that we're expecting to receive multiple resources inside a dictionary with that key.
โญ base_path
The base_path is the URL we're gonna use to make requests for this resource. In this case, line 9 sets base_path = "/fake", which also corresponds to the name of our class, Fake.
Most resources follow this basic formula. Some cases are more complex, where the URL for requests has to contain some extra data. The volume service has several resources that make either basic requests or detailed requests, so they use base_path = "/volumes/%s(detailed)". Before a request is made, if detailed = True, they convert it to a string so the URL becomes /volumes/detailed. If it's False, they only send /volumes/. Sneaky but iconic.
๐ง The Service
Unlike resource_key, resources_key, and base_path, the service a resource belongs to is not declared on the resource itself. Instead, each service provides a ServiceDescription subclass โ FakeService in fake_service.py โ which maps each supported API version to the proxy that exposes the service's resources.
In fake_service.py we set supported_versions so that version 2 of the service is served by openstack.fake.v2._proxy.Proxy. The proxy ties the resources together and knows how to reach the service in the catalog, so that when a request is made, the appropriate URL can be constructed. ๐
๐ฅ Supported Operations
The base Resource disallows all types of requests by default, requiring each resource to specify which requests they support. On lines 11-16, our Fake resource specifies that it'll work with all of the operations. Full send. ๐
In order to have the following methods work, you must allow the corresponding value by setting it to True:
create(openstack.resource.Resource.create) โ setallow_createdelete(openstack.resource.Resource.delete) โ setallow_deletehead(openstack.resource.Resource.head) โ setallow_headlist(openstack.resource.Resource.list) โ setallow_listfetch(openstack.resource.Resource.fetch) โ setallow_fetchcommit(openstack.resource.Resource.commit) โ setallow_commit
An additional attribute to set is commit_method. It defaults to PUT, but some services use POST or PATCH to commit changes back to the remote resource. Noted. ๐ซก
๐ Properties
The way resource classes communicate values between the user and the server is through a set of component objects. Each one is declared as a class attribute and maps an attribute on your Resource to a value that lives in a particular part of the request or response:
resource.Bodyโ a value carried in the JSON request or response body.resource.Headerโ a value carried in an HTTP header.resource.URIโ a value that is interpolated into thebase_path.resource.Computedโ a value that is computed locally rather than sent to or received from the server.
The first argument to each component is the name the value has on the server; the attribute name is how you refer to it in Python.
Line 19 declares a Header for timestamp, which will cause the Fake.timestamp attribute to contain the value returned in the x-timestamp header, such as from a Fake.head request.
Line 21 declares a Body for name, which is a value returned in a body, such as from a Fake.fetch request. Passing alternate_id=True marks this attribute as the resource's identifier, so when this resource is populated from a response, Fake.name and Fake.id are the same value. โจ
Line 23 declares a Body with an alias. Fake.value will be set when a response body contains a value, or when a header contains x-resource-value. Two-for-one, we love to see it.
Line 26 passes type=bool, which is checked before sending the value in a request. In this case, we can only set Fake.cool to either True or False โ otherwise a TypeError will be raised if the value can't be converted to the expected type. ๐จ
๐ Documentation ๐
Okay so for the API docs, we use Sphinx's autodoc feature to build them for every single resource we expose. Easy. The attributes you override from Resource <#openstack.resource.Resource>? Those don't need documenting. But any component attributes (Body, Header, and so on) absolutely do. ๐
All you gotta do is drop a comment above the line you want to document, with a colon following the pound-sign. That's the whole trick.
Lines 18, 20, 22, and 24-25 are comments that will then show up in the API documentation. And as you can see on lines 24 & 25, these comments can span multiple lines โ no cap, they really can. โจ
๐ฆ Creating a Proxy ๐ฆ
This guide walks you through adding a proxy for a service. It builds on the Creating a New Resource <> guide: where a Resource <#openstack.resource.Resource> maps onto a single server-side resource, a Proxy <#openstack.proxy.Proxy> gives you the higher-level, user-facing interface for a whole service. A Proxy is what a user actually reaches through a Connection <#openstack.connection.Connection> โ like, conn.compute is the compute service's Proxy. iconic behaviour honestly.
๐ธ Layout ๐ธ
Each service implements a single Proxy class per API version, in a module named _proxy.py:
openstack/<service>/v<N>/_proxy.pyโ the proxy, e.g.openstack/compute/v2/_proxy.py.openstack/<service>/v<N>/<resource>.pyโ one module per resource type that the proxy operates on, e.g.flavor.py,server.py.
The class is always named Proxy and subclasses openstack.proxy.Proxy <#openstack.proxy.Proxy>. It declares an api_version discriminator and imports each resource module under an underscore-prefixed alias, so we don't get namespace collisions. Obsessed with a tidy namespace fr.
from typing import ClassVar, Literal
from openstack.fake.v2 import fake as _fake
from openstack import proxy
class Proxy(proxy.Proxy):
api_version: ClassVar[Literal['2']] = '2'
๐ Base Helpers ๐
openstack.proxy.Proxy <#openstack.proxy.Proxy> subclasses keystoneauth1.adapter.Adapter โ so a proxy is literally an authenticated HTTP client ๐
โ and bolts on a set of generic helpers that delegate to the corresponding methods on your Resource <#openstack.resource.Resource> classes. Each one takes the resource class as its first argument:
_createโ Create a resource from keyword attributes._getโ Fetch a single resource by ID or instance._listโ Return a generator over resources, with pagination and query filtering._findโ Look a resource up by name or ID._updateโ Commit changes to a resource._deleteโ Delete a resource._headโ Issue a HEAD request for a resource._get_resourceโ Normalize an ID, dict, or existing instance into aResourceinstance. Used directly when a method needs an instance to call a resource action on.
Because these helpers do all the actual work, most proxy methods are just thin little wrappers that pick the right resource class and pass the caller's arguments straight through. lowkey elegant ๐ซถ
โญ Methods โญ
Proxy methods follow a consistent naming and shape. A create, get, list, and delete for a Fake resource look like this:
def create_fake(self, **attrs):
"""Create a new fake from attributes
:param attrs: Keyword arguments which will be used to create a
:class:`~openstack.fake.v2.fake.Fake`, comprised of the properties
on the Fake class.
:returns: The results of fake creation.
"""
return self._create(_fake.Fake, **attrs)
def get_fake(self, fake):
"""Get a single fake
:param fake: The value can be the ID of a fake or a
:class:`~openstack.fake.v2.fake.Fake` instance.
:returns: One :class:`~openstack.fake.v2.fake.Fake`
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
return self._get(_fake.Fake, fake)
def fakes(self, **query):
"""Return a generator of fakes
:param query: Optional query parameters to be sent to limit the
resources being returned.
:returns: A generator of fake objects.
"""
return self._list(_fake.Fake, **query)
def delete_fake(self, fake, ignore_missing=True):
"""Delete a fake
:param fake: The value can be either the ID of a fake or a
:class:`~openstack.fake.v2.fake.Fake` instance.
:param ignore_missing: When set to ``False``
:class:`~openstack.exceptions.NotFoundException` will be raised
when the fake does not exist. When set to ``True``, no exception
will be raised when attempting to delete a nonexistent fake.
:returns: ``None``
"""
self._delete(_fake.Fake, fake, ignore_missing=ignore_missing)
Note the conventions, bestie ๐:
- Methods that accept a resource take "either the ID ... or a instance", and document it that way.
- Deletes and finds take an
ignore_missingargument, defaulting toTrue. - List methods are named after the plural noun (
fakes) and return a generator; the other methods are named<verb>_<resource>. - Docstrings use Sphinx field lists (
:param:,:returns:,:raises:) and cross-reference the concrete resource class with:class:~...`` so only the short name renders.
For actions that aren't simple CRUD, use _get_resource to grab an instance and then call a method on the resource itself. periodt. ๐ฅ
๐ Wiring the Proxy to a Connection ๐
A proxy gets exposed on the Connection <#openstack.connection.Connection> through a ServiceDescription <#openstack.service_description.ServiceDescription>, as introduced in the Creating a New Resource <> guide. The description maps each supported API version to its proxy class:
from openstack.fake.v2 import _proxy
from openstack import service_description
class FakeService(service_description.ServiceDescription):
"""The fake service."""
supported_versions = {
'2': _proxy.Proxy,
}
Finally, the service has to be registered so it becomes an attribute on every Connection <#openstack.connection.Connection>. The registry lives in the generated file openstack/_services_mixin.py, where each service is declared with the connection attribute name and its service_type:
fake = fake_service.FakeService(service_type='fake')
โ ๏ธ Do not editopenstack/_services_mixin.pyby hand โ regenerate it by runningtools/print-services.py.
Once it's registered, conn.fake returns a lazily constructed instance of your Proxy. Slay. ๐
๐ง Creating an Authentication Plugin ๐ง
Note: openstacksdk does not implement its own authentication plugins. It delegates entirely to keystoneauth1 <https://docs.openstack.org/keystoneauth/latest/>. If you want to add a new authentication mechanism, you implement it in keystoneauth1, not here. This guide just explains how openstacksdk consumes auth plugins, so you know what's required to make a new plugin usable from openstacksdk. iykyk.
๐ How openstacksdk consumes auth plugins ๐
Authentication is configured through the auth_type and auth keys of a cloud's configuration (see Auth Settings <#config-auth-settings>). When a Connection <#openstack.connection.Connection> gets built, openstacksdk resolves and loads the plugin named by auth_type using keystoneauth1's loading machinery. The relevant code lives in OpenStackConfig._get_auth_loader (in openstack/config/loader.py), which ultimately calls keystoneauth1.loading.get_plugin_loader(auth_type) and then instantiates the plugin with loader.load_from_options(**auth).
A few friendly aliases are handled by openstacksdk before the name is passed to keystoneauth1 โ for example, an empty auth_type maps to none and token_endpoint maps to admin_token โ but every real plugin, including the default, password, is provided by keystoneauth1. openstacksdk registers no plugins of its own and ships no keystoneauth1.plugin entry points. Not a single one. ๐
๐ฆ Adding a new mechanism ๐ฆ
Because the loading is entirely delegated, adding a new authentication mechanism requires no changes to openstacksdk. Instead:
- Implement the plugin and its loader in keystoneauth1, following the keystoneauth plugin documentation <https://docs.openstack.org/keystoneauth/latest/authentication-plugins.html>.
- Register it under the
keystoneauth1.pluginentry-point group (this is howget_plugin_loaderdiscovers plugins by name). - Once the package providing the plugin is installed alongside openstacksdk, it can be selected from
clouds.yamlsimply by settingauth_typeto your plugin's name, with its options under theauthkey:
clouds:
my-cloud:
auth_type: my-plugin
auth:
# options declared by your plugin's loader
...
For the full set of authentication options and worked examples of the plugins that ship with keystoneauth1, see Auth Settings <#config-auth-settings>. go off ๐ โจ
๐ซ GENERAL INFORMATION ๐ซ
okay bestie, this is like the reference zone โ the glossary and the release-history bits. it's giving "the appendix but make it fashion." all the actual definitions are here, i'm just making them fun to read ๐ซถ
๐ธ Glossary ๐ธ
- CLI โ Command-Line Interface; a textual user interface. yes, the thing you're literally looking at right now, bestie. meta ๐
- compute โ OpenStack Compute (Nova). that's the service's actual name in the docs, don't @ me.
- container โ one of the object-store resources; a container holds objects being stored. it's the folder energy of the object store, lowkey.
- endpoint โ a base URL used in a REST request. and there are two flavours, so pay attention: an authentication endpoint is specifically the URL given to a user to identify a cloud. a service endpoint is generally obtained from the service catalog. two different vibes, same word ๐ญ
- host โ a physical computer. contrast with node and server. that's the whole definition, no cap.
- identity โ OpenStack Identity (Keystone). iconic. runs the whole "who are you" situation.
- image โ OpenStack Image (Glance). also the attribute name of the disk files stored for use by servers. double duty, main character energy โญ
- keypair โ the attribute name of the SSH public key used in the OpenStack Compute API for server authentication. your lil key, absolutely slaying your auth for you ๐
- node โ a logical system, may refer to a server (virtual machine) or a host.
and like, generally it's used to describe an OS instance where a specific process is running, e.g. a network node is where the network processes run, and may be directly on a host or in a server. contrast with host and server. three words, all slightly different, all out to get you ๐
- object โ a generic term which normally refers to the a Python object. (yes, "the a" โ that's exactly how the page says it, i'm not touching it, it's canon now ๐) the OpenStack Object Store service (Swift) also uses object as the name of the item being stored within a container. so: python object = code thing, swift object = your actual file. context is everything.
- object-store โ OpenStack Object Store (Swift). storage but make it cloudy โ๏ธ
- project โ the name of the owner of resources in an OpenStack cloud. a project can map to a customer, account or organization in different OpenStack deployments. and bestie, it's used instead of the deprecated tenant. we don't say tenant anymore, we moved on ๐
- region โ the attribute name of a partitioning of cloud resources. geographic-ish, vibes-wise.
- resource โ a Python object representing an OpenStack resource inside the SDK code. also used to describe the items managed by OpenStack. again: two meanings, one word. stay vigilant โจ
- role โ a personality that a user assumes when performing a specific set of operations. a role includes a set of rights and privileges that a user assuming that role inherits. the OpenStack Identity service includes the set of roles that a user can assume in the token that is issued to that user.
and here's the important bit, so listen up: the individual services determine how the roles are interpreted and access granted to operations or resources. the OpenStack Identity service treats a role as an arbitrary name assigned by the cloud administrator. so like, identity doesn't police what a role means โ it's just a name. your actual permissions depend on the service. periodt ๐
- server โ a virtual machine or a bare-metal host managed by the OpenStack Compute service. contrast with host and node. (third time's the charm, the trio is complete ๐)
- service โ in OpenStack this refers to a service/endpoint in the
ServiceCatalog. it could also be a collection of endpoints for different regions. a service has a type and a name. two attributes, no notes. - service catalog โ the list of services configured at a given authentication endpoint available to the authenticated user. it's like the menu of what your cloud will let you order off of ๐
- tenant โ deprecated in favor of project. that's it. that's the definition. she's retired, respect her legacy ๐๏ธ
- token โ an arbitrary bit of text that is used to access resources. some tokens are scoped to determine what resources are accessible with it. a token may be revoked at any time and is valid for a finite duration. โ ๏ธ so don't get attached โ it can vanish whenever and it has an expiry date, fr fr.
- volume โ OpenStack Volume (Cinder). also the attribute name of the virtual disks managed by the OpenStack Volume service. your disks, but cloud-flavoured ๐พ
๐ Release Notes ๐
release notes for openstacksdk can be found at https://releases.openstack.org/teams/openstacksdk.html โ go read them, they're right there, i'm just the messenger ๐
๐ฆ Author ๐ฆ
Author name not set. yeah. the page literally says that. mysterious icon behaviour, honestly โ anonymous but make it legendary ๐
๐ Copyright ๐
2017, Various members of the OpenStack Foundation โ that's the whole credit line, keep it accurate bestie ๐ซถ
aaaand that's the whole page, we made it to the end together!! ๐ฅณ this little beauty is openstacksdk version 4.22.0, and the footer date says Jan 02, 1980 โ yes, 1980, which is older than the concept of the cloud itself, but honestly? slay, we stan a retro timestamp ๐โจ go forth and cloud responsibly, mwah ๐
๐ฆ where this page comes from
- nixpkgs unstable: python3.13-openstacksdk 4.22.0
- nixpkgs unstable: python3.14-openstacksdk 4.22.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms