storage methods

class ecl.storage.v1._proxy.Proxy(session)[source]

Bases: ecl.proxy2.BaseProxy

availability_zones(details=True)[source]

Return a list of availability zones

Parameters:details (bool) – When True, returns AvailabilityZoneDetail objects, otherwise AvailabilityZone.
Returns:A list of availability zone objects
create_snapshot(volume_id, name, description=None)[source]

This API create snapshot of volume.

Parameters:
  • volume_id – Parent volume ID.
  • name – Name of snapshot.
  • description – Description of snapshot.
Returns:

Snapshot

create_storage(network_id, subnet_id, ip_addr_pool, name, volume_type_id, description=None, host_routes=None)[source]

This API create additional Storage.

Parameters:
  • network_id – Network ID.
  • subnet_id – Subnetwork ID.
  • ip_addr_pool – The pool of IP addresses for storage nodes used by the volume. The IP address range may be overwraped with subnet’s allocation_pools. The range should be included in CIDR of the subnet.
  • name – Name of Virtual Storage.
  • volume_type_id – volume type ID.
  • description – Description of Virtual Storage.
  • host_routes – Static routes settings for each virtual storages.
Returns:

Storage

create_volume(virtual_storage_id, name, size, description=None, iops_per_gb=None, initiator_iqns=None, throughput=None, availability_zone=None)[source]

This API create additional Volume.

Parameters:
  • virtual_storage_id – Virtual Storage ID.
  • name – Name of volume.
  • size – Size of volume in Gigabyte.
  • description – Description of volume.
  • iops_per_gb – Provisioned IOPS/GB for volume.
  • throughput – Provisioned throughput for volume.
  • initiator_iqns – List of initiator IQN who can access to this volume.
  • availability_zone – Availability zone.
Returns:

Volume

delete_snapshot(snapshot_id)[source]

This API deletes a specified snapshot.

Parameters:snapshot_id – ID for the specified snapshot.
Returns:None
delete_storage(storage_id)[source]

This API deletes a specified storage.

Parameters:storage_id – ID for the specified storage.
Returns:None
delete_volume(volume_id)[source]

This API deletes a specified volume.

Parameters:volume_id – ID for the specified volume.
Returns:None
find_availability_zone(name_or_id, ignore_missing=True)[source]

Find a single availability_zone

Parameters:
  • name_or_id – The name or ID of a availability_zone.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One AvailabilityZone or None

find_volume_type(name_or_id, ignore_missing=True)[source]

Find a volume type

Parameters:
  • name_or_id (string) – The name or ID of a volume type.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

VolumeType or None

get_snapshot(snapshot_id)[source]

Get a single snapshot.

Parameters:snapshot_id – The value is the ID of a snapshot
Returns:One Snapshot ResourceNotFound when no resource can be found.
get_storage(storage_id)[source]

Get a single storage

Parameters:storage_id – The value is the ID of a storage
Returns:One Storage ResourceNotFound when no resource can be found.
get_version()[source]

Show Storage API version.

Returns:Version
get_volume(volume_id)[source]

Get a single volume

Parameters:volume_id – The value is the ID of a volume
Returns:One Volume ResourceNotFound when no resource can be found.
get_volume_type(volume_type_id)[source]

Get a single volume type

Parameters:volume_type_id – The value is the ID of a volume type
Returns:One VolumeType ResourceNotFound when no resource can be found.
restore_snapshot(snapshot_id)[source]

Restore volume from snapshot.

Parameters:snapshot_id – Snapshot ID to utilize as restore source.
Returns:<Response 202>
snapshots(details=True, **params)[source]

Return a list of snapshots.

Parameters:
  • details (bool) – When True, returns SnapshotDetail objects, otherwise Snapshot. Default: ``True``
  • params (kwargs) – parameter used as query parameter for GET request.
Returns:

A list of snapshot objects

storages(details=True)[source]

Return a generator of storages

Parameters:details (bool) – When True, returns StorageDetail objects, otherwise Storage. Default: ``True``
Returns:A generator of storage objects
update_snapshot(snapshot_id, **body)[source]

This API update existing snapshot.

Parameters:
  • snapshot_id – ID for the requested snapshot.
  • name – Name of snapshot.
  • description – Description of snapshot.
Returns:

Snapshot

update_storage(storage_id, **body)[source]

This API update existing storage

Parameters:body (kwargs) –

Request parameter to update storage.

  • storage_id: ID for the requested storage.
  • name: Name of Virtual Storage.
  • description: Description of Virtual Storage.
  • ip_addr_pool: The pool of IP addresses for storage nodes used by the volume. The IP address range may be overwraped with subnet’s allocation_pools. The range should be included in CIDR of the subnet.
  • host_routes: Static routes settings for each virtual storages.
Returns:Storage
update_volume(volume_id, **body)[source]

This API update existing volume.

Parameters:body (kwargs) –

Request parameter to update volume.

  • volume_id: ID for the requested volume.
  • name: Name of volume.
  • description: Description of volume.
  • initiator_iqns: List of initiator IQN who can access to this volume.
Returns:Volume
versions()[source]

List Storage API version.

Returns:A generator of version objects
volume_types(details=True)[source]

Return a generator of volume types

Parameters:details (bool) – When True, returns VolumeTypeDetail objects, otherwise VolumeType. Default: ``True``
Returns:A generator of volume type objects
volumes(details=True)[source]

Return a list of volumes

Parameters:details (bool) – When True, returns VolumeTypeDetail objects, otherwise VolumeType. Default: ``True``
Returns:A generator of volume type objects
class ecl.storage.v1._proxy.VersionSession(profile, user_agent=None, **kwargs)[source]

Bases: ecl.session.Session

get_endpoint(auth=None, interface='public', service_type=None, **kwargs)[source]

Override get endpoint to automate endpoint filtering This method uses the service catalog to find the root URI of each service and then gets all available versions directly from the service, not from the service catalog. Endpoints are cached per service type and interface combination so that they’re only requested from the remote service once per instance of this class.

availability_zone

class ecl.storage.v1.availability_zone.AvailabilityZone(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_list = True
base_path = '/availability_zone'
classmethod find(session, name_or_id, ignore_missing=True, **params)[source]

Find a resource by its name or id.

Parameters:
  • session (Session) – The session to use for making this request.
  • name_or_id – This resource’s identifier, if needed by the request. The default is None.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
  • params (dict) – Any additional parameters to be passed into underlying methods, such as to existing() in order to pass on URI parameters.
Returns:

The Resource object matching the given name or id or None if nothing matches.

Raises:

ecl.exceptions.DuplicateResource if more than one resource is found for this request.

Raises:

ecl.exceptions.ResourceNotFound if nothing is found and ignore_missing is False.

resources_key = 'availabilityZoneInfo'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'storage', 'requires_project_id': False, 'api_version': None}
state = None

state of availability zone

zoneName = None

name of availability zone

zoneState = None
class ecl.storage.v1.availability_zone.AvailabilityZoneDetail(synchronized=False, **attrs)[source]

Bases: ecl.storage.v1.availability_zone.AvailabilityZone

base_path = '/availability_zone/detail'
zoneName = None

snapshot

class ecl.storage.v1.snapshot.Snapshot(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_create = True
allow_delete = True
allow_get = True
allow_list = True
allow_update = True
base_path = '/snapshots'
create(session, **attrs)[source]
created_at = None

Creation timestamp of snapshot

delete_reason = None

Reason of automatic deletion

deleted_at = None

Delete timestamp of snapshot

description = None

Description of snapshot

error_message = None

Error message for snapshot

id = None

id of snapshot(UUID)

name = None

Name of volume

resource_key = 'snapshot'
resources_key = 'snapshots'
restore(session)[source]

Restore volume from specified snapshot

service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'storage', 'requires_project_id': False, 'api_version': None}
snapshot_type_id = None

ID (UUID) of snapshot type

status = None

status of volume

update(session, volume_id, has_body=True, **attrs)[source]
updated_at = None

Update timestamp of snapshot

usage = None

Usage of snapshot

volume_id = None

ID (UUID) of parent volume

class ecl.storage.v1.snapshot.SnapshotDetail(synchronized=False, **attrs)[source]

Bases: ecl.storage.v1.snapshot.Snapshot

allow_create = False
allow_delete = False
allow_get = False
allow_update = False
base_path = '/snapshots/detail'

storage

class ecl.storage.v1.storage.Storage(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_create = True
allow_delete = True
allow_get = True
allow_list = True
allow_update = True
base_path = '/virtual_storages'
create(session, **attrs)[source]
created_at = None

creation timestamp of storage

description = None

description of storage

error_message = None

error description of storage

host_routes = None

static routes settings of storage

id = None

id of storage(UUID)

ip_addr_pool = None

The pool of IP addresses for storage

name = None

name of storage

network_id = None

Network id(UUID) of storage

resource_key = 'virtual_storage'
resources_key = 'virtual_storages'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'storage', 'requires_project_id': False, 'api_version': None}
status = None

status of storage

subnet_id = None

Subnet id(UUID) of storage

update(session, storage_id, has_body=True, **attrs)[source]
updated_at = None

update timestamp of storage

volume_type_id = None

volume type id(UUID) of storage

class ecl.storage.v1.storage.StorageDetail(synchronized=False, **attrs)[source]

Bases: ecl.storage.v1.storage.Storage

allow_create = False
allow_delete = False
allow_get = False
allow_update = False
base_path = '/virtual_storages/detail'

volume

class ecl.storage.v1.volume.Volume(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_create = True
allow_delete = True
allow_get = True
allow_list = True
allow_update = True
availability_zone = None

An availability_zone in which the volume belongs to

base_path = '/volumes'
create(session, **attrs)[source]
created_at = None

Creation timestamp of volume

description = None

description of volume

error_message = None

error description of volume

export_rules = None

Array of IPv4 CIDRc who can access to this volume

id = None

id of volume(UUID)

initiator_iqns = None

Array of initiator IQN who can access to this volume

initiator_secret = None

Initiator’s secret (password) for CHAP auth of iSCSI

iops_per_gb = None

The provisioned IOPS/GB for volume

metadata = None

One or more metadata key and value pairs to associate with the volume.

name = None

name of volume

percentage_snapshot_reserve_used = None

Percentage of Used Snapshots

resource_key = 'volume'
resources_key = 'volumes'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'storage', 'requires_project_id': False, 'api_version': None}
size = None

The size of volume in gigabyte

snapshot_ids = None

Array of Snapshot IDs taken from this volume

status = None

status of volume

target_ips = None

Array of IPv4 addresses of the volume.

target_secret = None

Target’s secret (password) for CHAP auth of iSCSI

throughput = None

The provisioned throughput for volume in MB/s

update(session, volume_id, has_body=True, **attrs)[source]
updated_at = None

update timestamp of volume

virtual_storage_id = None

storage ID (UUID) volume belongs to

class ecl.storage.v1.volume.VolumeDetail(synchronized=False, **attrs)[source]

Bases: ecl.storage.v1.volume.Volume

allow_create = False
allow_delete = False
allow_get = False
allow_update = False
base_path = '/volumes/detail'

volume_type

class ecl.storage.v1.volume_type.VolumeType(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_get = True
allow_list = True
base_path = '/volume_types'
extra_specs = None

state of volume type

classmethod find(session, name_or_id, ignore_missing=True, **params)[source]

Find a resource by its name or id.

Parameters:
  • session (Session) – The session to use for making this request.
  • name_or_id – This resource’s identifier, if needed by the request. The default is None.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
  • params (dict) – Any additional parameters to be passed into underlying methods, such as to existing() in order to pass on URI parameters.
Returns:

The Resource object matching the given name or id or None if nothing matches.

Raises:

ecl.exceptions.DuplicateResource if more than one resource is found for this request.

Raises:

ecl.exceptions.ResourceNotFound if nothing is found and ignore_missing is False.

id = None

id of volume type

name = None

name of volume type

resource_key = 'volume_type'
resources_key = 'volume_types'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'storage', 'requires_project_id': False, 'api_version': None}
class ecl.storage.v1.volume_type.VolumeTypeDetail(synchronized=False, **attrs)[source]

Bases: ecl.storage.v1.volume_type.VolumeType

allow_get = False
base_path = '/volume_types/detail'