chi

The chi module exposes a global context object and helpers for generating clients for interfacing with the various Chameleon services.

chi.blazar(session=None) BlazarClient[source]

Get a preconfigured client for Blazar, the reservation service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Blazar client.

chi.cinder(session=None) CinderClient[source]

Get a preconfigured client for Cinder, the persistent volume service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Cinder client.

chi.connection(session=None) Connection[source]

Get connection context for OpenStack SDK.

The returned openstack.connection.Connection object has several proxy modules attached for each service provided by the cloud.

Note

For the most part, it is more straightforward to use clients specific to the service you are targeting. However, some of the proxy modules are useful for operations that span a few services, such as assigning a Floating IP to a server instance.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new connection proxy.

chi.get(key)[source]

Get a context parameter by name.

Parameters:

key (str) – the parameter name.

Returns:

the parameter value.

Return type:

any

Raises:

cfg.NoSuchOptError – if the parameter is not supported.

chi.glance(session=None) GlanceClient[source]

Get a preconfigured client for Glance, the image service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Glance client.

chi.gnocchi(session=None) GnocchiClient[source]

Get a preconfigured client for Gnocchi, the metrics service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Gnocchi client.

chi.ironic(session=None) IronicClient[source]

Get a preconfigured client for Ironic, the bare metal service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Ironic client.

chi.keystone(session=None) KeystoneClient[source]

Get a preconfigured client for Keystone, the authentication service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Keystone client.

chi.manila(session=None) ManilaClient[source]

Get a preconfigured client for Manila, the share service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Manila client.

chi.neutron(session=None) NeutronClient[source]

Get a preconfigured client for Neutron, the networking service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Neutron client.

chi.nova(session=None) NovaClient[source]

Get a preconfigured client for Nova, the compute service.

Parameters:

session (Session) – An authentication session object. By default a new session is created via chi.session().

Returns:

A new Nova client.

chi.params()[source]

List all parameters currently set on the context.

Returns:

a list of parameter names.

Return type:

List[str]

chi.reset()[source]

Reset the context, removing all overrides and defaults.

The auth_type parameter will be defaulted to the value of the OS_AUTH_TYPE environment variable, falling back to “v3token” if not defined.

All context parameters will revert to the default values inferred from environment variables.

chi.session()[source]

Get a Keystone Session object suitable for authenticating a client.

Returns:

the authentication session object.

Return type:

keystoneauth1.session.Session

chi.set(key, value)[source]

Set a context parameter by name.

Parameters:
  • key (str) – the parameter name.

  • value (any) – the parameter value.

Raises:

cfg.NoSuchOptError – if the parameter is not supported.

chi.use_site(site_name)[source]

Configure the global request context to target a particular CHI site.

Targeting a site will mean that leases, instance launch requests, and any other API calls will be sent to that site. By default, no site is selected, and one must be explicitly chosen.

chi.use_site("CHI@UC")

Changing the site will affect future calls the client makes, implicitly. Therefore something like this is possible:

chi.use_site("CHI@UC")
chi.lease.create_lease("my-uc-lease", reservations)
chi.use_site("CHI@TACC")
chi.lease.create_lease("my-tacc-lease", reservations)
Parameters:

site_name (str) – The name of the site, e.g., “CHI@UC”.