Skip to main content
Version: 1.13.0

Inventory API

This topic describes the Python SDK API for getting the GPU and GPU Nodes available in the EGS Inventory.

Syntax

egs.inventory(authenticated_session=None)

Use this API to get the list of GPU and GPU nodes available in the inventory.

Parameters

ParameterParameter TypeDescriptionRequired
authenticated_session[AuthenticatedSession]The default value is None. Use this parameter for providing the authenticated session with the EGS Controller. If no authenticated session is provided, SDK tries to use the SDK default. If no SDK default has been found, an exception is raised.Optional

Response Returned

ReturnsDescription
Class InventoryThe list of GPU nodes as available in the EGS inventory is returned.

Class Inventory

ParameterTypeDescription
gpu_node_nameStringThe name of the GPU node.
gpu_shapeStringThe shape of the GPU.
gpu_model_nameStringThe model name of the GPU.
instance_typeStringThe type of the node.
cluster_nameStringThe name of the cluster on which the node is available.
memoryintThe memory in MB available on each GPU.
gpu_countintThe number of GPUs available on the node.
gpu_temp_thresholdStringThe temperature threshold of the GPU.
gpu_power_thresholdStringThe power threshold of the GPU.
cloud_providerStringThe cloud provider providing the node.
regionStringThe cloud region in which the node is available.
node_healthStringThe health of the node.
gpu_node_statusStringThe status of the GPU node.

Exceptions Raised

RaisesDescription
exceptions.UnauthorizedThis exception is raised when querying the inventory is not allowed to the API key.

Example

import egs
auth = egs. authenticate("https://egs-core-apis.example.com", "5067bd55-1aef-4c84-8987-3e966e917f07")
inventory = egs.inventory(authenticated_session=None)