ibmcloud_python_sdk.cis.storage package¶
Submodules¶
ibmcloud_python_sdk.cis.storage.bucket module¶
- class ibmcloud_python_sdk.cis.storage.bucket.Bucket(**kwargs)[source]¶
Bases:
object
- create_bucket(**kwargs)[source]¶
Create bucket
- Parameters
bucket (str) – Bucket name
acl (str) – The canned ACL to apply to the bucket
grant_full_control (str) – Allows grantee the read, write, read ACP, and write ACP permissions on the bucket
grant_read (str) – Allows grantee to list the objects in the bucket
grant_read_acp (str) – Allows grantee to read the bucket ACL
grant_write (str) – Allows grantee to create, overwrite, and delete any object in the bucket
grant_write_acp (str) – Allows grantee to write the ACL for the applicable bucket
ibm_sse_kp_encryptions_algorithm (str) – The encryption algorithm that will be used for objects stored in the newly created bucket
ibm_sse_kp_customer_root_key_crn (str) – Container for describing the KMS-KP Key CRN
- Returns
Bucket creation status
- Return type
dict
- delete_bucket(bucket)[source]¶
Delete bucket
- Parameters
bucket – Bucket name
- Returns
Deletion status
- Return type
dict
ibmcloud_python_sdk.cis.storage.client module¶
ibmcloud_python_sdk.cis.storage.file module¶
- class ibmcloud_python_sdk.cis.storage.file.File[source]¶
Bases:
object
- authorize_host_to_volume(**kwargs)[source]¶
Authorizes hosts to File Storage Volumes
- Parameters
volume_id (str) – The File volume to authorize hosts to
hardware_ids (list) – A List of SoftLayer_Hardware IDs
virtual_guest_ids (list) – A List of SoftLayer_Virtual_Guest IDs
ip_address_ids (list) – A List of SoftLayer_Network_Subnet_IpAddress IDs
subnet_ids – A List of SoftLayer_Network_Subnet ids
- cancel_file_volume(**kwargs)[source]¶
Cancels the given file storage volume
- Parameters
volume_id (int) – The volume ID
reason (str) – The reason for cancellation
immediate (bool) – Cancel immediately or on anniversary date
- cancel_snapshot_space(**kwargs)[source]¶
Cancels snapshot space for a given volume
- Parameters
volume_id (int) – The volume ID
reason (str) – The reason for cancellation
- create_snapshot(**kwargs)[source]¶
Creates a snapshot on the given file volume
- Parameters
volume_id (int) – The volume ID
notes (str) – The notes or “name” to assign the snapshot
- Returns
Returns the id of the new snapshot
- Return type
str
- deauthorize_host_to_volume(**kwargs)[source]¶
Revokes authorization of hosts to File Storage Volumes
- Parameters
volume_id (str) – The File volume to deauthorize hosts to
hardware_ids (list) – A List of SoftLayer_Hardware IDs
virtual_guest_ids (list) – A List of SoftLayer_Virtual_Guest IDs
ip_address_ids (list) – 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
- Return type
list
- delete_snapshot(snapshot_id)[source]¶
Deletes the specified snapshot object
- Parameters
snapshot_id (int) – The ID of the snapshot object to delete
- disable_snapshots(**kwargs)[source]¶
Disables snapshots for a specific file volume at a given schedule
- Parameters
volume_id (int) – The ID of the volume
schedule_type (str) – ‘HOURLY’|’DAILY’|’WEEKLY’
- enable_snapshots(**kwargs)[source]¶
Enables snapshots for a specific file volume at a given schedule
- Parameters
volume_id (int) – The ID of the volume
schedule_type (str) – ‘HOURLY’|’DAILY’|’WEEKLY’
retention_count (int) – The number of snapshots to attempt to retain in this schedule
minute (int) – The minute of the hour at which HOURLY, DAILY, and WEEKLY snapshots should be taken
hour (int) – The hour of the day at which DAILY and WEEKLY snapshots should be taken
day_of_week – The day of the week on which WEEKLY snapshots should be taken an integer (‘0’ is Sunday)
- failback_from_replicant(**kwargs)[source]¶
Failback from a volume replicant
- Parameters
volume_id (int) – The ID of the volume
replicant_id (int) – ID of replicant to failback from
- Returns
Returns whether failback was successful or not
- failover_to_replicant(**kwargs)[source]¶
Failover to a volume replicant
- Parameters
volume_id (int) – The ID of the volume
replicant_id (int) – ID of replicant to failback from
immediate (bool) – Flag indicating if failover is immediate
- Returns
Returns whether failover was successful or not
- get_file_storage(file_storage)[source]¶
Retrieve specific file storage by ID
- Parameters
file_storage (int) – File storage ID
- Returns
File storage information
- Return type
dict
- get_file_storages()[source]¶
Retrieve file storage list
- Returns
List of file storage
- Return type
dict
- get_file_volume_access_list(volume_id)[source]¶
Returns a list of authorized hosts for a specified volume
- Parameters
volume_id (int) – The ID of the volume
- Returns
Returns a list of authorized hosts for a specified volume
- Return type
list
- get_file_volume_details(volume_id)[source]¶
Returns details about the specified volume
- Parameters
volume_id (int) – The ID of the volume
- Returns
Returns details about the specified volume
- get_file_volume_snapshot_list(volume_id)[source]¶
Returns a list of snapshots for the specified volume
- Parameters
volume_id (int) – The ID of the volume
- Returns
Returns a list of snapshots for the specified volume
- Return type
list
- get_replication_locations(volume_id)[source]¶
Acquires list of the datacenters to which a volume can be replicated
- Parameters
volume_id (int) – The ID of the volume
- Returns
Returns an array of SoftLayer_Network_Storage objects
- Return type
list
- list_file_volumes(**kwargs)[source]¶
Returns a list of file volumes
- Parameters
datacenter (str) – Datacenter short name (e.g.: dal09)
username (str) – Name of volume
storage_type (str) – Type of volume “Endurance|Performance”
order (int) – Volume order ID
- Returns
Returns a list of file volumes
- Return type
list
- order_file_volume(**kwargs)[source]¶
Places an order for a file volume
- Parameters
storage_type (str) – Type of volume “Endurance|Performance”
location (str) – Name of the datacenter in which to order the volume
size (int) – Size of the desired volume, in GB
iops (int) – Number of IOPS for a “Performance” order
tier_level (int) – Tier level to use for an “Endurance” order (0.25|2|4|10)
snapshot_size (int) – The size of optional snapshot space, if snapshot space should also be ordered (None if not ordered)
service_offering (str) – Requested offering package to use in the order (“storage_as_a_service”, “enterprise”, or “performance”)
hourly_billing_flag (bool) – Billing type, monthly (False) or hourly (True), default to monthly
- Returns
Created volume description
- Return type
dict
- order_modified_volume(**kwargs)[source]¶
Places an order for modifying an existing file volume
- Parameters
volume_id (int) – The ID of the volume to be modified
new_size (int) – The new size/capacity for the volume
new_iops (int) – The new IOPS for the volume
new_tier_level (str) – The new tier level for the volume
- Returns
Returns a SoftLayer_Container_Product_Order_Receipt
- Return type
dict
- order_snapshot_space(**kwargs)[source]¶
Orders snapshot space for the given file volume
- Parameters
volume_id (int) – The ID of the volume
capacity (int) – The capacity to order, in GB
tier (int) – The tier level of the file volume, in IOPS per GB
upgrade (bool) – Flag to indicate if this order is an upgrade
- Returns
Returns a SoftLayer_Container_Product_Order_Receipt
- Return type
dict
ibmcloud_python_sdk.cis.storage.object module¶
- class ibmcloud_python_sdk.cis.storage.object.Object(**kwargs)[source]¶
Bases:
object
- delete_object(bucket, object)[source]¶
Delete an object from the bucket
- Parameters
bucket (str) – Bucket name
object (str) – The name of the object to delete
- Returns
Deletion status
- Return type
dict
- delete_objects(bucket, objects)[source]¶
Delete objects from the bucket
- Parameters
bucket (str) – Bucket name
objects (list) – List of objects to delete
- download_file(**kwargs)[source]¶
Download file from a S3 object
- Parameters
bucket (str) – Bucket name
path (str) – The path to the file to download to
key (str) – The name of the key to download from
- Returns
Download status
- Return type
dict
- get_object(bucket, object)[source]¶
Retrieve specific object form a bucket
- Parameters
bucket (str) – Bucket name
object (str) – Object name
- Returns
Object information
- Return type
dict
- get_objects(bucket)[source]¶
Retrieve objects list from a bucket
- Parameters
bucket (str) – Bucket name
- Returns
List of objects
- Return type
dict