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, **kwargs)[source]

Authorizes hosts to File 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
Returns:

Returns an array of SoftLayer_Network_Storage_Allowed_Host objects which now have access to the given File 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)[source]

Cancels snapshot space for a given volume.

Parameters:
  • volume_id (integer) – The volume ID
  • reason (string) – The reason for cancellation
  • immediate (boolean) – Cancel immediately or on anniversary date
create_snapshot(volume_id, notes='', **kwargs)[source]

Creates a snapshot on the given file 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, **kwargs)[source]

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
Returns:

Returns an array of SoftLayer_Network_Storage_Allowed_Host objects which have access to the given File volume

delete_snapshot(snapshot_id)[source]

Deletes the specified snapshot object.

Parameters:snapshot_id – The ID of the snapshot object to delete.
disable_snapshots(volume_id, schedule_type)[source]

Disables snapshots for a specific file 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

enable_snapshots(volume_id, schedule_type, retention_count, minute, hour, day_of_week, **kwargs)[source]

Enables snapshots for a specific file volume at a given schedule

Parameters:
  • volume_id (integer) – The id of the volume
  • schedule_type (string) – ‘HOURLY’|’DAILY’|’WEEKLY’
  • retention_count (integer) – The number of snapshots to attempt to retain in this schedule
  • minute (integer) – The minute of the hour at which HOURLY, DAILY, and WEEKLY snapshots should be taken
  • hour (integer) – The hour of the day at which DAILY and WEEKLY snapshots should be taken
  • day_of_week (string|integer) – The day of the week on which WEEKLY snapshots should be taken, either as a string (‘SUNDAY’) or integer (‘0’ is Sunday)
Returns:

Returns whether successfully scheduled or not

failback_from_replicant(volume_id, replicant_id)[source]

Failback from a volume replicant.

Parameters:
  • volume_id (integer) – The ID of the volume
  • replicant_id (integer) – ID of replicant to failback from
Returns:

Returns whether failback was successful or not

failover_to_replicant(volume_id, replicant_id, immediate=False)[source]

Failover to a volume replicant.

Parameters:
  • volume_id (integer) – The ID of the volume
  • replicant_id (integer) – ID of replicant to failover to
  • immediate (boolean) – Flag indicating if failover is immediate
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)[source]

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)[source]

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
list_file_volumes(datacenter=None, username=None, storage_type=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
  • kwargs
Returns:

Returns a list of file volumes.

list_volume_schedules(volume_id)[source]

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)[source]

Places an order for a duplicate file 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)[source]

Places an order for modifying an existing file 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)[source]

Places an order for a replicant file 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
Returns:

Returns a SoftLayer_Container_Product_Order_Receipt

order_snapshot_space(volume_id, capacity, tier, upgrade, **kwargs)[source]

Orders snapshot space for the given file 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 file volume, in IOPS per GB
  • upgrade (boolean) – Flag to indicate if this order is an upgrade
Returns:

Returns a SoftLayer_Container_Product_Order_Receipt

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)[source]

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 successfully restored or not