SoftLayer.file

File Storage Manager

license

MIT, see LICENSE for more details.

class SoftLayer.managers.file.FileStorageManager(client)[source]

Manages file Storage volumes.

authorize_host_to_volume(volume_id, hardware_ids=None, virtual_guest_ids=None, ip_address_ids=None, subnet_ids=None)

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_file_volume(volume_id, reason='No longer needed', immediate=False)[source]

Cancels the given file storage volume.

Parameters
  • volume_id (integer) – The volume ID

  • reason (string) – The reason for cancellation

  • immediate (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_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

deauthorize_host_to_volume(volume_id, hardware_ids=None, virtual_guest_ids=None, ip_address_ids=None, subnet_ids=None)

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_file_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_file_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_file_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_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_file_volume_limit()[source]

Returns a list of block volume count limit.

Returns

Returns a list of block volume count limit.

list_file_volumes(datacenter=None, username=None, storage_type=None, order=None, **kwargs)[source]

Returns a list of file 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 file 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_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_file_volume(storage_type, location, size, iops=None, tier_level=None, snapshot_size=None, service_offering='storage_as_a_service', hourly_billing_flag=False)[source]

Places an order for a file volume.

Parameters
  • storage_type – ‘performance’ or ‘endurance’

  • location – Name of the datacenter in which to order the volume

  • size – Size of the desired volume, in GB

  • 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_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

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

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