igz_mgmt.client#

The API client used to communicate with the Iguazio backend.

class igz_mgmt.client.APIClient(*, endpoint: str = '', timeout: int = 60, retries: int = 3, username: str = '', password: str = '', access_key: str = '', logger: Optional[Logger] = None)#

Bases: object

Client protocol to communicate with the Iguazio system.

Parameters:
  • endpoint (str, optional) – system endpoint.

  • timeout (int, optional) – protocol timeout.

  • retries (int, optional) – number of retries for a request before failing.

  • username (str, optional) – username to log in the system.

  • password (str, optional) – password to log in the system.

  • access_key (str, optional) – control plane access key for the Iguazio system.

close()#

Closes the client connection.

create(resource_name: str, attributes, relationships=None, **kwargs)#

Creates a new resource.

Parameters:
  • resource_name (str) – The resource name.

  • attributes – The resource attributes.

  • relationships (optional) – The resource relationships. None by default.

  • **kwargs – additional arguments to pass to the request.

delete(resource_name: str, resource_id, **kwargs)#

Deletes an existing resource.

Parameters:
  • resource_name (str) – The resource name.

  • resource_id – The resource ID

  • **kwargs – additional arguments to pass to the request.

delete_by_attribute(resource_name: str, attribute_name: str, attribute_value: str, **kwargs)#

Deletes an existing resource by resource attribute.

Parameters:
  • resource_name (str) – The resource name.

  • attribute_name (str) – The identifying attribute in the resource to be deleted.

  • attribute_value (str) – The value of the resource attribute to delete by.

  • **kwargs – additional arguments to pass to the request.

detail(resource_name: str, resource_id, **kwargs)#

Gets an existing single resource.

Parameters:
  • resource_name (str) – The resource name.

  • resource_id – The resource ID to delete

  • **kwargs – additional arguments to pass to the request.

list(resource_name: str, **kwargs)#

Lists existing resources.

Parameters:
  • resource_name (str) – The resource name.

  • **kwargs – additional arguments to pass to the request.

login(*, username: str = '', password: str = '')#

Authenticates to the API server using username and password.

Parameters:
  • username (str) – The username to log in with.

  • password (str) – The password to log in with.

request(method, path, **kwargs)#

Executes a raw request.

Parameters:
  • method – The request method.

  • path – The request path.

  • **kwargs – additional arguments to pass to the request.

property tenant_id: str#

Authenticated session tenant id.

Returns:

tenant id

update(resource_name: str, resource_id, attributes, relationships=None, **kwargs)#

Updates an existing resource.

Parameters:
  • resource_name (str) – The resource name.

  • resource_id – The resource ID

  • attributes – The resource attributes.

  • relationships (optional) – The resource relationships. None by default.

  • **kwargs – additional arguments to pass to the request.

property username: str#

Authenticated username.

Returns:

username

property version: Version#

Iguazio system version info.

Returns:

Iguazio version

Return type:

semver.VersionInfo

with_access_key(access_key: str)#

Sets the access key to be used for authentication.

Parameters:

access_key (str) – The new access key.

Returns:

The client protocol.

Return type:

APIClient