AWS Storage Gateway

2017/11/22 - AWS Storage Gateway - 1 new 5 updated api methods

Changes  AWS Storage Gateway now enables you to get notification when all your files written to your NFS file share have been uploaded to Amazon S3. Storage Gateway also enables guessing of the MIME type for uploaded objects based on file extensions.

NotifyWhenUploaded (new) Link ¶

Sends you notification when all file data written to the NFS file share has been uploaded to Amazon S3.

AWS Storage Gateway can send a notification through Amazon CloudWatch Events when all files written to your file share up to that point in time have been uploaded to Amazon S3. These files include files written to the NFS file share up to the time that you make a request for notification. When the upload is done, Storage Gateway sends you notification through an Amazon CloudWatch event. You can configure CloudWatch Events to sent the notification through event targets such as email, SNS or a Lambda function. text or Lambda functions. This operation is only supported in the file gateway type.

See also: AWS API Documentation

Request Syntax

client.notify_when_uploaded(
    FileShareARN='string'
)
type FileShareARN

string

param FileShareARN

[REQUIRED]

The Amazon Resource Name (ARN) of the file share.

rtype

dict

returns

Response Syntax

{
    'FileShareARN': 'string',
    'NotificationId': 'string'
}

Response Structure

  • (dict) --

    • FileShareARN (string) --

      The Amazon Resource Name (ARN) of the file share.

    • NotificationId (string) --

      The randomly generated ID of the notification that was sent. This ID is in UUID format.

CreateNFSFileShare (updated) Link ¶
Changes (request)
{'GuessMIMETypeEnabled': 'boolean'}

Creates a file share on an existing file gateway. In Storage Gateway, a file share is a file system mount point backed by Amazon S3 cloud storage. Storage Gateway exposes file shares using a Network File System (NFS) interface. This operation is only supported in the file gateway type.

Warning

File gateway requires AWS Security Token Service (AWS STS) to be activated to enable you create a file share. Make sure AWS STS is activated in the region you are creating your file gateway in. If AWS STS is not activated in the region, activate it. For information about how to activate AWS STS, see Activating and Deactivating AWS STS in an AWS Region in the AWS Identity and Access Management User Guide.

File gateway does not support creating hard or symbolic links on a file share.

See also: AWS API Documentation

Request Syntax

client.create_nfs_file_share(
    ClientToken='string',
    NFSFileShareDefaults={
        'FileMode': 'string',
        'DirectoryMode': 'string',
        'GroupId': 123,
        'OwnerId': 123
    },
    GatewayARN='string',
    KMSEncrypted=True|False,
    KMSKey='string',
    Role='string',
    LocationARN='string',
    DefaultStorageClass='string',
    ClientList=[
        'string',
    ],
    Squash='string',
    ReadOnly=True|False,
    GuessMIMETypeEnabled=True|False
)
type ClientToken

string

param ClientToken

[REQUIRED]

A unique string value that you supply that is used by file gateway to ensure idempotent file share creation.

type NFSFileShareDefaults

dict

param NFSFileShareDefaults

File share default values. Optional.

  • FileMode (string) --

    The Unix file mode in the form "nnnn". For example, "0666" represents the default file mode inside the file share. The default value is 0666.

  • DirectoryMode (string) --

    The Unix directory mode in the form "nnnn". For example, "0666" represents the default access mode for all directories inside the file share. The default value is 0777.

  • GroupId (integer) --

    The default group ID for the file share (unless the files have another group ID specified). The default value is nfsnobody.

  • OwnerId (integer) --

    The default owner ID for files in the file share (unless the files have another owner ID specified). The default value is nfsnobody.

type GatewayARN

string

param GatewayARN

[REQUIRED]

The Amazon Resource Name (ARN) of the file gateway on which you want to create a file share.

type KMSEncrypted

boolean

param KMSEncrypted

True to use Amazon S3 server side encryption with your own AWS KMS key, or false to use a key managed by Amazon S3. Optional.

type KMSKey

string

param KMSKey

The KMS key used for Amazon S3 server side encryption. This value can only be set when KmsEncrypted is true. Optional.

type Role

string

param Role

[REQUIRED]

The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.

type LocationARN

string

param LocationARN

[REQUIRED]

The ARN of the backed storage used for storing file data.

type DefaultStorageClass

string

param DefaultStorageClass

The default storage class for objects put into an Amazon S3 bucket by file gateway. Possible values are S3_STANDARD or S3_STANDARD_IA. If this field is not populated, the default value S3_STANDARD is used. Optional.

type ClientList

list

param ClientList

The list of clients that are allowed to access the file gateway. The list must contain either valid IP addresses or valid CIDR blocks.

  • (string) --

type Squash

string

param Squash

Maps a user to anonymous user. Valid options are the following:

  • "RootSquash" - Only root is mapped to anonymous user.

  • "NoSquash" - No one is mapped to anonymous user.

  • "AllSquash" - Everyone is mapped to anonymous user.

type ReadOnly

boolean

param ReadOnly

Sets the write status of a file share: "true" if the write status is read-only, and otherwise "false".

type GuessMIMETypeEnabled

boolean

param GuessMIMETypeEnabled

Enables guessing of the MIME type for uploaded objects based on file extensions: "true" to enable MIME type guessing, and otherwise "false".

rtype

dict

returns

Response Syntax

{
    'FileShareARN': 'string'
}

Response Structure

  • (dict) --

    CreateNFSFileShareOutput

    • FileShareARN (string) --

      The Amazon Resource Name (ARN) of the newly created file share.

DescribeCachediSCSIVolumes (updated) Link ¶
Changes (response)
{'CachediSCSIVolumes': {'VolumeUsedInBytes': 'long'}}

Returns a description of the gateway volumes specified in the request. This operation is only supported in the cached volume gateway types.

The list of gateway volumes in the request must be from one gateway. In the response Amazon Storage Gateway returns volume information sorted by volume Amazon Resource Name (ARN).

See also: AWS API Documentation

Request Syntax

client.describe_cached_iscsi_volumes(
    VolumeARNs=[
        'string',
    ]
)
type VolumeARNs

list

param VolumeARNs

[REQUIRED]

  • (string) --

rtype

dict

returns

Response Syntax

{
    'CachediSCSIVolumes': [
        {
            'VolumeARN': 'string',
            'VolumeId': 'string',
            'VolumeType': 'string',
            'VolumeStatus': 'string',
            'VolumeSizeInBytes': 123,
            'VolumeProgress': 123.0,
            'SourceSnapshotId': 'string',
            'VolumeiSCSIAttributes': {
                'TargetARN': 'string',
                'NetworkInterfaceId': 'string',
                'NetworkInterfacePort': 123,
                'LunNumber': 123,
                'ChapEnabled': True|False
            },
            'CreatedDate': datetime(2015, 1, 1),
            'VolumeUsedInBytes': 123
        },
    ]
}

Response Structure

  • (dict) --

    A JSON object containing the following fields:

    • CachediSCSIVolumes (list) --

      An array of objects where each object contains metadata about one cached volume.

      • (dict) --

        Describes an iSCSI cached volume.

        • VolumeARN (string) --

          The Amazon Resource Name (ARN) of the storage volume.

        • VolumeId (string) --

          The unique identifier of the volume, e.g. vol-AE4B946D.

        • VolumeType (string) --

          One of the VolumeType enumeration values that describes the type of the volume.

        • VolumeStatus (string) --

          One of the VolumeStatus values that indicates the state of the storage volume.

        • VolumeSizeInBytes (integer) --

          The size, in bytes, of the volume capacity.

        • VolumeProgress (float) --

          Represents the percentage complete if the volume is restoring or bootstrapping that represents the percent of data transferred. This field does not appear in the response if the cached volume is not restoring or bootstrapping.

        • SourceSnapshotId (string) --

          If the cached volume was created from a snapshot, this field contains the snapshot ID used, e.g. snap-78e22663. Otherwise, this field is not included.

        • VolumeiSCSIAttributes (dict) --

          An VolumeiSCSIAttributes object that represents a collection of iSCSI attributes for one stored volume.

          • TargetARN (string) --

            The Amazon Resource Name (ARN) of the volume target.

          • NetworkInterfaceId (string) --

            The network interface identifier.

          • NetworkInterfacePort (integer) --

            The port used to communicate with iSCSI targets.

          • LunNumber (integer) --

            The logical disk number.

          • ChapEnabled (boolean) --

            Indicates whether mutual CHAP is enabled for the iSCSI target.

        • CreatedDate (datetime) --

          The date the volume was created. Volumes created prior to March 28, 2017 don’t have this time stamp.

        • VolumeUsedInBytes (integer) --

          The size of the data stored on the volume in bytes.

          Note

          This value is not available for volumes created prior to May 13, 2015, until you store data on the volume.

DescribeNFSFileShares (updated) Link ¶
Changes (response)
{'NFSFileShareInfoList': {'GuessMIMETypeEnabled': 'boolean'}}

Gets a description for one or more file shares from a file gateway. This operation is only supported in the file gateway type.

See also: AWS API Documentation

Request Syntax

client.describe_nfs_file_shares(
    FileShareARNList=[
        'string',
    ]
)
type FileShareARNList

list

param FileShareARNList

[REQUIRED]

An array containing the Amazon Resource Name (ARN) of each file share to be described.

  • (string) --

    The Amazon Resource Name (ARN) of the file share.

rtype

dict

returns

Response Syntax

{
    'NFSFileShareInfoList': [
        {
            'NFSFileShareDefaults': {
                'FileMode': 'string',
                'DirectoryMode': 'string',
                'GroupId': 123,
                'OwnerId': 123
            },
            'FileShareARN': 'string',
            'FileShareId': 'string',
            'FileShareStatus': 'string',
            'GatewayARN': 'string',
            'KMSEncrypted': True|False,
            'KMSKey': 'string',
            'Path': 'string',
            'Role': 'string',
            'LocationARN': 'string',
            'DefaultStorageClass': 'string',
            'ClientList': [
                'string',
            ],
            'Squash': 'string',
            'ReadOnly': True|False,
            'GuessMIMETypeEnabled': True|False
        },
    ]
}

Response Structure

  • (dict) --

    DescribeNFSFileSharesOutput

    • NFSFileShareInfoList (list) --

      An array containing a description for each requested file share.

      • (dict) --

        The Unix file permissions and ownership information assigned, by default, to native S3 objects when file gateway discovers them in S3 buckets. This operation is only supported in file gateways.

        • NFSFileShareDefaults (dict) --

          Describes file share default values. Files and folders stored as Amazon S3 objects in S3 buckets don't, by default, have Unix file permissions assigned to them. Upon discovery in an S3 bucket by Storage Gateway, the S3 objects that represent files and folders are assigned these default Unix permissions. This operation is only supported in the file gateway type.

          • FileMode (string) --

            The Unix file mode in the form "nnnn". For example, "0666" represents the default file mode inside the file share. The default value is 0666.

          • DirectoryMode (string) --

            The Unix directory mode in the form "nnnn". For example, "0666" represents the default access mode for all directories inside the file share. The default value is 0777.

          • GroupId (integer) --

            The default group ID for the file share (unless the files have another group ID specified). The default value is nfsnobody.

          • OwnerId (integer) --

            The default owner ID for files in the file share (unless the files have another owner ID specified). The default value is nfsnobody.

        • FileShareARN (string) --

          The Amazon Resource Name (ARN) of the file share.

        • FileShareId (string) --

          The ID of the file share.

        • FileShareStatus (string) --

          The status of the file share. Possible values are CREATING, UPDATING, AVAILABLE and DELETING.

        • GatewayARN (string) --

          The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.

        • KMSEncrypted (boolean) --

          True to use Amazon S3 server side encryption with your own KMS key, or false to use a key managed by Amazon S3. Optional.

        • KMSKey (string) --

          The ARN of the KMS key used for Amazon S3 server side encryption.

        • Path (string) --

          The file share path used by the NFS client to identify the mount point.

        • Role (string) --

          The ARN of the IAM role that file gateway assumes when it accesses the underlying storage.

        • LocationARN (string) --

          The ARN of the backend storage used for storing file data.

        • DefaultStorageClass (string) --

          The default storage class for objects put into an Amazon S3 bucket by file gateway. Possible values are S3_STANDARD or S3_STANDARD_IA. If this field is not populated, the default value S3_STANDARD is used. Optional.

        • ClientList (list) --

          The list of clients that are allowed to access the file gateway. The list must contain either valid IP addresses or valid CIDR blocks.

          • (string) --

        • Squash (string) --

          The user mapped to anonymous user. Valid options are the following:

          • "RootSquash" - Only root is mapped to anonymous user.

          • "NoSquash" - No one is mapped to anonymous user

          • "AllSquash" - Everyone is mapped to anonymous user.

        • ReadOnly (boolean) --

          A value that indicates whether the write status of a file share is read-only: "true" if write status is read-only, and otherwise "false".

        • GuessMIMETypeEnabled (boolean) --

          Enables guessing of the MIME type for uploaded objects based on file extensions: "true" to enable MIME type guessing, and otherwise "false".

DescribeStorediSCSIVolumes (updated) Link ¶
Changes (response)
{'StorediSCSIVolumes': {'VolumeUsedInBytes': 'long'}}

Returns the description of the gateway volumes specified in the request. The list of gateway volumes in the request must be from one gateway. In the response Amazon Storage Gateway returns volume information sorted by volume ARNs. This operation is only supported in stored volume gateway type.

See also: AWS API Documentation

Request Syntax

client.describe_stored_iscsi_volumes(
    VolumeARNs=[
        'string',
    ]
)
type VolumeARNs

list

param VolumeARNs

[REQUIRED]

An array of strings where each string represents the Amazon Resource Name (ARN) of a stored volume. All of the specified stored volumes must from the same gateway. Use ListVolumes to get volume ARNs for a gateway.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'StorediSCSIVolumes': [
        {
            'VolumeARN': 'string',
            'VolumeId': 'string',
            'VolumeType': 'string',
            'VolumeStatus': 'string',
            'VolumeSizeInBytes': 123,
            'VolumeProgress': 123.0,
            'VolumeDiskId': 'string',
            'SourceSnapshotId': 'string',
            'PreservedExistingData': True|False,
            'VolumeiSCSIAttributes': {
                'TargetARN': 'string',
                'NetworkInterfaceId': 'string',
                'NetworkInterfacePort': 123,
                'LunNumber': 123,
                'ChapEnabled': True|False
            },
            'CreatedDate': datetime(2015, 1, 1),
            'VolumeUsedInBytes': 123
        },
    ]
}

Response Structure

  • (dict) --

    • StorediSCSIVolumes (list) --

      • (dict) --

        Describes an iSCSI stored volume.

        • VolumeARN (string) --

          The Amazon Resource Name (ARN) of the storage volume.

        • VolumeId (string) --

          The unique identifier of the volume, e.g. vol-AE4B946D.

        • VolumeType (string) --

          One of the VolumeType enumeration values describing the type of the volume.

        • VolumeStatus (string) --

          One of the VolumeStatus values that indicates the state of the storage volume.

        • VolumeSizeInBytes (integer) --

          The size of the volume in bytes.

        • VolumeProgress (float) --

          Represents the percentage complete if the volume is restoring or bootstrapping that represents the percent of data transferred. This field does not appear in the response if the stored volume is not restoring or bootstrapping.

        • VolumeDiskId (string) --

          The ID of the local disk that was specified in the CreateStorediSCSIVolume operation.

        • SourceSnapshotId (string) --

          If the stored volume was created from a snapshot, this field contains the snapshot ID used, e.g. snap-78e22663. Otherwise, this field is not included.

        • PreservedExistingData (boolean) --

          Indicates if when the stored volume was created, existing data on the underlying local disk was preserved.

          Valid Values: true, false

        • VolumeiSCSIAttributes (dict) --

          An VolumeiSCSIAttributes object that represents a collection of iSCSI attributes for one stored volume.

          • TargetARN (string) --

            The Amazon Resource Name (ARN) of the volume target.

          • NetworkInterfaceId (string) --

            The network interface identifier.

          • NetworkInterfacePort (integer) --

            The port used to communicate with iSCSI targets.

          • LunNumber (integer) --

            The logical disk number.

          • ChapEnabled (boolean) --

            Indicates whether mutual CHAP is enabled for the iSCSI target.

        • CreatedDate (datetime) --

          The date the volume was created. Volumes created prior to March 28, 2017 don’t have this time stamp.

        • VolumeUsedInBytes (integer) --

          The size of the data stored on the volume in bytes.

          Note

          This value is not available for volumes created prior to May 13, 2015, until you store data on the volume.

UpdateNFSFileShare (updated) Link ¶
Changes (request)
{'GuessMIMETypeEnabled': 'boolean'}

Updates a file share. This operation is only supported in the file gateway type.

Note

To leave a file share field unchanged, set the corresponding input field to null.

Updates the following file share setting:

  • Default storage class for your S3 bucket

  • Metadata defaults for your S3 bucket

  • Allowed NFS clients for your file share

  • Squash settings

  • Write status of your file share

Note

To leave a file share field unchanged, set the corresponding input field to null. This operation is only supported in file gateways.

See also: AWS API Documentation

Request Syntax

client.update_nfs_file_share(
    FileShareARN='string',
    KMSEncrypted=True|False,
    KMSKey='string',
    NFSFileShareDefaults={
        'FileMode': 'string',
        'DirectoryMode': 'string',
        'GroupId': 123,
        'OwnerId': 123
    },
    DefaultStorageClass='string',
    ClientList=[
        'string',
    ],
    Squash='string',
    ReadOnly=True|False,
    GuessMIMETypeEnabled=True|False
)
type FileShareARN

string

param FileShareARN

[REQUIRED]

The Amazon Resource Name (ARN) of the file share to be updated.

type KMSEncrypted

boolean

param KMSEncrypted

True to use Amazon S3 server side encryption with your own AWS KMS key, or false to use a key managed by Amazon S3. Optional.

type KMSKey

string

param KMSKey

The KMS key used for Amazon S3 server side encryption. This value can only be set when KmsEncrypted is true. Optional.

type NFSFileShareDefaults

dict

param NFSFileShareDefaults

The default values for the file share. Optional.

  • FileMode (string) --

    The Unix file mode in the form "nnnn". For example, "0666" represents the default file mode inside the file share. The default value is 0666.

  • DirectoryMode (string) --

    The Unix directory mode in the form "nnnn". For example, "0666" represents the default access mode for all directories inside the file share. The default value is 0777.

  • GroupId (integer) --

    The default group ID for the file share (unless the files have another group ID specified). The default value is nfsnobody.

  • OwnerId (integer) --

    The default owner ID for files in the file share (unless the files have another owner ID specified). The default value is nfsnobody.

type DefaultStorageClass

string

param DefaultStorageClass

The default storage class for objects put into an Amazon S3 bucket by a file gateway. Possible values are S3_STANDARD or S3_STANDARD_IA. If this field is not populated, the default value S3_STANDARD is used. Optional.

type ClientList

list

param ClientList

The list of clients that are allowed to access the file gateway. The list must contain either valid IP addresses or valid CIDR blocks.

  • (string) --

type Squash

string

param Squash

The user mapped to anonymous user. Valid options are the following:

  • "RootSquash" - Only root is mapped to anonymous user.

  • "NoSquash" - No one is mapped to anonymous user

  • "AllSquash" - Everyone is mapped to anonymous user.

type ReadOnly

boolean

param ReadOnly

Sets the write status of a file share: "true" if the write status is read-only, otherwise "false".

type GuessMIMETypeEnabled

boolean

param GuessMIMETypeEnabled

Enables guessing of the MIME type for uploaded objects based on file extensions: "true" to enable MIME type guessing, and otherwise "false".

rtype

dict

returns

Response Syntax

{
    'FileShareARN': 'string'
}

Response Structure

  • (dict) --

    UpdateNFSFileShareOutput

    • FileShareARN (string) --

      The Amazon Resource Name (ARN) of the updated file share.