ai_api_client_sdk.resource_clients.resource_groups_client module

class ai_api_client_sdk.resource_clients.resource_groups_client.ResourceGroupsClient(rest_client: RestClient)

Bases: BaseClient

ResourceGroupsClient is a class implemented for interacting with the resource groups endpoints of the server. It implements the base class ai_api_client_sdk.resource_clients.base_client.BaseClient

create(resource_group_id: str, labels: List[Label] = None) ResourceGroup

Creates resource group for a given tenant.

Parameters:
  • resource_group_id (str) – the id of the resource group and the length must be between 3 and 10 characters.

  • labels (List[Label]) – key-value pairs of the labels that will be added to the resource group.

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

An object representing the response from the server

Return type:

class:ai_core_sdk.models.resource_group.ResourceGroup

delete(resource_group_id: str) BasicResponse

Deletes the resource group.

Parameters:

resource_group_id (str) – the id of the resource group to be deleted

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIPreconditionFailedException if a 412 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

An object representing the response from the server

Return type:

class:ai_api_client_sdk.models.base_models.BasicResponse

get(resource_group_id: str) ResourceGroup

Gets a resource group of a given tenant.

Parameters:

resource_group_id (str) – the id of the resource group to be retrieved

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

An object representing the resource group from the server

Return type:

class:ai_core_sdk.models.resource_group.ResourceGroup

modify(resource_group_id: str, labels: List[Label]) None

Modifies a resource group.

Parameters:
  • resource_group_id (str) – the id of the resource group

  • labels (List[Label]) – key-value pairs of the labels that will be added to the resource group.

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIPreconditionFailedException if a 412 response is received from the server

Returns:

An object representing the response from the server

query(search: str = None, search_case_insensitive: bool = None) ResourceGroupQueryResponse

Get all resource groups.

Parameters:
  • search (str, optional) – Generic search term to be looked for in various attributes of resource groups, defaults to None

  • search_case_insensitive (bool, optional) – Indicates whether the search should be case insensitive

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

A list of resource groups for a given tenant.

Return type:

class:ai_core_sdk.models.resource_group_query_response.ResourceGroupQueryResponse