Accelerator API

The Accelerator Class

The accelerator high-level interface is available through the accelerator member of a Connection object. The accelerator member will only be added if the service is detected.

Device Operations

class openstack.accelerator.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
devices(**query)

Retrieve a generator of devices.

Parameters:

query (kwargs) –

Optional query parameters to be sent to restrict the devices to be returned. Available parameters include:

  • hostname: The hostname of the device.

  • type: The type of the device.

  • vendor: The vendor ID of the device.

  • sort: A list of sorting keys separated by commas. Each sorting key can optionally be attached with a sorting direction modifier which can be asc or desc.

  • 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 the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.

Returns:

A generator of device instances.

get_device(uuid, fields=None)

Get a single device.

Parameters:

uuid – The value can be the UUID of a device.

Returns:

One Device

Raises:

ResourceNotFound when no device matching the criteria could be found.

Deployable Operations

class openstack.accelerator.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
deployables(**query)

Retrieve a generator of deployables.

Parameters:

query (kwargs) – Optional query parameters to be sent to restrict the deployables to be returned.

Returns:

A generator of deployable instances.

get_deployable(uuid, fields=None)

Get a single deployable.

Parameters:

uuid – The value can be the UUID of a deployable.

Returns:

One Deployable

Raises:

ResourceNotFound when no deployable matching the criteria could be found.

update_deployable(uuid, patch)

Reconfig the FPGA with new bitstream.

Parameters:
  • uuid – The value can be the UUID of a deployable

  • patch – The information to reconfig.

Returns:

The results of FPGA reconfig.

Device Profile Operations

class openstack.accelerator.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
device_profiles(**query)

Retrieve a generator of device profiles.

Parameters:

query (kwargs) – 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.

Parameters:

attrs (kwargs) – a list of device_profiles.

Returns:

The list of created device profiles

delete_device_profile(device_profile, ignore_missing=True)

Delete a device profile

Parameters:
  • device_profile – The value can be either the ID of a device profile or a DeviceProfile instance.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the device profile does not exist. When set to True, no exception will be set when attempting to delete a nonexistent device profile.

Returns:

None

get_device_profile(uuid, fields=None)

Get a single device profile.

Parameters:

uuid – The value can be the UUID of a device profile.

Returns:

One :class: ~openstack.accelerator.v2.device_profile.DeviceProfile

Raises:

ResourceNotFound when no device profile matching the criteria could be found.

Accelerator Request Operations

class openstack.accelerator.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
accelerator_requests(**query)

Retrieve a generator of accelerator requests.

Parameters:

query (kwargs) – 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.

Parameters:

attrs (kwargs) – request body.

Returns:

The created accelerator request instance.

delete_accelerator_request(accelerator_request, ignore_missing=True)

Delete a device profile

Parameters:
  • device_profile – The value can be either the ID of a device profile or a DeviceProfile instance.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the device profile does not exist. When set to True, no exception will be set when attempting to delete a nonexistent accelerator request.

Returns:

None

get_accelerator_request(uuid, fields=None)

Get a single accelerator request.

Parameters:

uuid – The value can be the UUID of a accelerator request.

Returns:

One :class: ~openstack.accelerator.v2.accelerator_request.AcceleratorRequest

Raises:

ResourceNotFound when no accelerator request matching the criteria could be found.

update_accelerator_request(uuid, properties)

Bind/Unbind an accelerator to VM.

Parameters:
  • uuid – The uuid of the accelerator_request to be bound/unbound.

  • properties – The info of VM that will bind/unbind the accelerator.

Returns:

True if bind/unbind succeeded, False otherwise.