SoftLayer.block¶
Block Storage Manager
license: | MIT, see LICENSE for more details. |
---|
-
class
SoftLayer.managers.block.
BlockStorageManager
(client)[source]¶ Manages SoftLayer Block Storage volumes.
See product information here: https://www.ibm.com/cloud/block-storage
-
assign_subnets_to_acl
(access_id, subnet_ids)[source]¶ Assigns subnet records to ACL for the access host.
access_id is the host_id obtained by: slcli block access-list <volume_id>
Parameters: - access_id (integer) – id of the access host
- subnet_ids (list) – The ids of the subnets to be assigned
Returns: Returns int array of assigned subnet ids
Authorizes hosts to Storage Volumes
Parameters: - volume_id – The File volume to authorize hosts to
- hardware_ids – A List of SoftLayer_Hardware ids
- virtual_guest_ids – A List of SoftLayer_Virtual_Guest ids
- ip_address_ids – A List of SoftLayer_Network_Subnet_IpAddress ids
- subnet_ids – A List of SoftLayer_Network_Subnet ids. Only use with File volumes.
Returns: Returns an array of SoftLayer_Network_Storage_Allowed_Host objects which now have access to the given volume
-
cancel_block_volume
(volume_id, reason='No longer needed', immediate=False)[source]¶ Cancels the given block storage volume.
Parameters: - volume_id (integer) – The volume ID
- reason (string) – The reason for cancellation
- immediate_flag (boolean) – Cancel immediately or on anniversary date
-
cancel_snapshot_space
(volume_id, reason='No longer needed', immediate=False)¶ Cancels snapshot space for a given volume.
Parameters: - volume_id (integer) – The volume ID
- reason (string) – The reason for cancellation
- immediate_flag (boolean) – Cancel immediately or on anniversary date
-
cancel_volume
(volume_id, reason='No longer needed', immediate=False)¶ Cancels the given storage volume.
Parameters: - volume_id (integer) – The volume ID
- reason (string) – The reason for cancellation
- immediate_flag (boolean) – Cancel immediately or on anniversary date
-
convert_dep_dupe
(volume_id)¶ Convert a dependent duplicate volume to an independent volume.
Parameters: volume_id (integer) – The id of the volume.
-
create_or_update_lun_id
(volume_id, lun_id)[source]¶ Set the LUN ID on a volume.
Parameters: - volume_id (integer) – The id of the volume
- lun_id (integer) – LUN ID to set on the volume
Returns: a SoftLayer_Network_Storage_Property object
-
create_snapshot
(volume_id, notes='', **kwargs)¶ Creates a snapshot on the given block volume.
Parameters: - volume_id (integer) – The id of the volume
- notes (string) – The notes or “name” to assign the snapshot
Returns: Returns the id of the new snapshot
Revokes authorization of hosts to File Storage Volumes
Parameters: - volume_id – The File volume to deauthorize hosts to
- hardware_ids – A List of SoftLayer_Hardware ids
- virtual_guest_ids – A List of SoftLayer_Virtual_Guest ids
- ip_address_ids – A List of SoftLayer_Network_Subnet_IpAddress ids
- subnet_ids – A List of SoftLayer_Network_Subnet ids. Only use with File volumes
Returns: Returns an array of SoftLayer_Network_Storage_Allowed_Host objects which have access to the given File volume
-
delete_snapshot
(snapshot_id)¶ Deletes the specified snapshot object.
Parameters: snapshot_id – The ID of the snapshot object to delete.
-
disable_snapshots
(volume_id, schedule_type)¶ Disables snapshots for a specific block volume at a given schedule
Parameters: - volume_id (integer) – The id of the volume
- schedule_type (string) – ‘HOURLY’|’DAILY’|’WEEKLY’
Returns: Returns whether successfully disabled or not
-
disaster_recovery_failover_to_replicant
(volume_id, replicant_id)¶ Disaster Recovery Failover to a volume replicant.
Parameters: - volume_id (integer) – The id of the volume
- replicant (integer) – ID of replicant to failover to
Returns: Returns whether failover to successful or not
-
enable_snapshots
(volume_id, schedule_type, retention_count, minute, hour, day_of_week, **kwargs)¶ Enables snapshots for a specific block volume at a given schedule
Parameters: - volume_id (integer) – The id of the volume
- schedule_type (string) – ‘HOURLY’|’DAILY’|’WEEKLY’
- retention_count (integer) – Number of snapshots to be kept
- minute (integer) – Minute when to take snapshot
- hour (integer) – Hour when to take snapshot
- day_of_week (string) – Day when to take snapshot
Returns: Returns whether successfully scheduled or not
-
failback_from_replicant
(volume_id)¶ Failback from a volume replicant.
Parameters: volume_id (integer) – The id of the volume Returns: Returns whether failback was successful or not
-
failover_to_replicant
(volume_id, replicant_id)¶ Failover to a volume replicant.
Parameters: - volume_id (integer) – The id of the volume
- replicant_id (integer) – ID of replicant to failover to
Returns: Returns whether failover was successful or not
-
get_block_volume_access_list
(volume_id, **kwargs)[source]¶ Returns a list of authorized hosts for a specified volume.
Parameters: - volume_id – ID of volume.
- kwargs –
Returns: Returns a list of authorized hosts for a specified volume.
-
get_block_volume_details
(volume_id, **kwargs)[source]¶ Returns details about the specified volume.
Parameters: - volume_id – ID of volume.
- kwargs –
Returns: Returns details about the specified volume.
-
get_block_volume_snapshot_list
(volume_id, **kwargs)[source]¶ Returns a list of snapshots for the specified volume.
Parameters: - volume_id – ID of volume.
- kwargs –
Returns: Returns a list of snapshots for the specified volume.
-
get_replication_locations
(volume_id)¶ Acquires list of the datacenters to which a volume can be replicated.
Parameters: volume_id – The ID of the primary volume to be replicated Returns: Returns an array of SoftLayer_Network_Storage objects
-
get_replication_partners
(volume_id)¶ Acquires list of replicant volumes pertaining to the given volume.
Parameters: volume_id – The ID of the primary volume to be replicated Returns: Returns an array of SoftLayer_Location objects
-
get_subnets_in_acl
(access_id)[source]¶ Returns a list of subnet records for the access host.
access_id is the host_id obtained by: slcli block access-list <volume_id>Parameters: access_id (integer) – id of the access host Returns: Returns an array of SoftLayer_Network_Subnet objects
-
get_volume_access_list
(volume_id, **kwargs)¶ Returns a list of authorized hosts for a specified volume.
Parameters: - volume_id – ID of volume.
- kwargs –
Returns: Returns a list of authorized hosts for a specified volume.
-
get_volume_count_limits
()¶ Returns a list of block volume count limit.
Returns: Returns a list of block volume count limit.
-
get_volume_details
(volume_id, **kwargs)¶ Returns details about the specified volume.
Parameters: - volume_id – ID of volume.
- kwargs –
Returns: Returns details about the specified volume.
-
get_volume_snapshot_list
(volume_id, **kwargs)¶ Returns a list of snapshots for the specified volume.
Parameters: - volume_id – ID of volume.
- kwargs –
Returns: Returns a list of snapshots for the specified volume.
-
list_block_volume_limit
()[source]¶ Returns a list of block volume count limit.
Returns: Returns a list of block volume count limit.
-
list_block_volumes
(datacenter=None, username=None, storage_type=None, order=None, **kwargs)[source]¶ Returns a list of block volumes.
Parameters: - datacenter – Datacenter short name (e.g.: dal09)
- username – Name of volume.
- storage_type – Type of volume: Endurance or Performance
- order – Volume order id.
- kwargs –
Returns: Returns a list of block volumes.
-
list_volume_schedules
(volume_id)¶ Lists schedules for a given volume
Parameters: volume_id (integer) – The id of the volume Returns: Returns list of schedules assigned to a given volume
-
order_block_volume
(storage_type, location, size, os_type, iops=None, tier_level=None, snapshot_size=None, service_offering='storage_as_a_service', hourly_billing_flag=False)[source]¶ Places an order for a block volume.
Parameters: - storage_type – ‘performance’ or ‘endurance’
- location – Datacenter in which to order iSCSI volume
- size – Size of the desired volume, in GB
- os_type – OS Type to use for volume alignment, see help for list
- iops – Number of IOPs for a “Performance” order
- tier_level – Tier level to use for an “Endurance” order
- snapshot_size – The size of optional snapshot space, if snapshot space should also be ordered (None if not ordered)
- service_offering – Requested offering package to use in the order (‘storage_as_a_service’, ‘enterprise’, or ‘performance’)
- hourly_billing_flag – Billing type, monthly (False) or hourly (True), default to monthly.
-
order_duplicate_volume
(origin_volume_id, origin_snapshot_id=None, duplicate_size=None, duplicate_iops=None, duplicate_tier_level=None, duplicate_snapshot_size=None, hourly_billing_flag=False, dependent_duplicate=False)¶ Places an order for a duplicate volume.
Parameters: - origin_volume_id – The ID of the origin volume to be duplicated
- origin_snapshot_id – Origin snapshot ID to use for duplication
- duplicate_size – Size/capacity for the duplicate volume
- duplicate_iops – The IOPS per GB for the duplicate volume
- duplicate_tier_level – Tier level for the duplicate volume
- duplicate_snapshot_size – Snapshot space size for the duplicate
- hourly_billing_flag – Billing type, monthly (False) or hourly (True), default to monthly.
Returns: Returns a SoftLayer_Container_Product_Order_Receipt
-
order_modified_volume
(volume_id, new_size=None, new_iops=None, new_tier_level=None)¶ Places an order for modifying an existing block volume.
Parameters: - volume_id – The ID of the volume to be modified
- new_size – The new size/capacity for the volume
- new_iops – The new IOPS for the volume
- new_tier_level – The new tier level for the volume
Returns: Returns a SoftLayer_Container_Product_Order_Receipt
-
order_replicant_volume
(volume_id, snapshot_schedule, location, tier=None, os_type=None)¶ Places an order for a replicant volume.
Parameters: - volume_id – The ID of the primary volume to be replicated
- snapshot_schedule – The primary volume’s snapshot schedule to use for replication
- location – The location for the ordered replicant volume
- tier – The tier (IOPS per GB) of the primary volume
- os_type – The OS type of the primary volume
Returns: Returns a SoftLayer_Container_Product_Order_Receipt
-
order_snapshot_space
(volume_id, capacity, tier, upgrade, **kwargs)¶ Orders snapshot space for the given block volume.
Parameters: - volume_id (integer) – The id of the volume
- capacity (integer) – The capacity to order, in GB
- tier (float) – The tier level of the block volume, in IOPS per GB
- upgrade (boolean) – Flag to indicate if this order is an upgrade
Returns: Returns a SoftLayer_Container_Product_Order_Receipt
-
refresh_dupe
(volume_id, snapshot_id)¶ “Refresh a duplicate volume with a snapshot from its parent.
Parameters: - volume_id (integer) – The id of the volume
- snapshot_id (integer) – The id of the snapshot
-
remove_subnets_from_acl
(access_id, subnet_ids)[source]¶ Removes subnet records from ACL for the access host.
access_id is the host_id obtained by: slcli block access-list <volume_id>
Parameters: - access_id (integer) – id of the access host
- subnet_ids (list) – The ids of the subnets to be removed
Returns: Returns int array of removed subnet ids
-
resolve_ids
(identifier)¶ Takes a string and tries to resolve to a list of matching ids.
What exactly ‘identifier’ can be depends on the resolvers
Parameters: identifier (string) – identifying string Returns list:
-
restore_from_snapshot
(volume_id, snapshot_id)¶ Restores a specific volume from a snapshot
Parameters: - volume_id (integer) – The id of the volume
- snapshot_id (integer) – The id of the restore point
Returns: Returns whether succesfully restored or not
-
set_credential_password
(access_id, password)[source]¶ Sets the password for an access host
Parameters: - access_id (integer) – id of the access host
- password (string) – password to set
-
volume_set_note
(volume_id, note)¶ Set the notes for an existing block volume.
Parameters: - volume_id – The ID of the volume to be modified
- note – the note
Returns: Returns true if success
-