StorageGateway / Client / describe_cache

describe_cache#

StorageGateway.Client.describe_cache(**kwargs)#

Returns information about the cache of a gateway. This operation is only supported in the cached volume, tape, and file gateway types.

The response includes disk IDs that are configured as cache, and it includes the amount of cache allocated and used.

See also: AWS API Documentation

Request Syntax

response = client.describe_cache(
    GatewayARN='string'
)
Parameters:

GatewayARN (string) –

[REQUIRED]

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

Return type:

dict

Returns:

Response Syntax

{
    'GatewayARN': 'string',
    'DiskIds': [
        'string',
    ],
    'CacheAllocatedInBytes': 123,
    'CacheUsedPercentage': 123.0,
    'CacheDirtyPercentage': 123.0,
    'CacheHitPercentage': 123.0,
    'CacheMissPercentage': 123.0
}

Response Structure

  • (dict) –

    • GatewayARN (string) –

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

    • DiskIds (list) –

      An array of strings that identify disks that are to be configured as working storage. Each string has a minimum length of 1 and maximum length of 300. You can get the disk IDs from the ListLocalDisks API.

      • (string) –

    • CacheAllocatedInBytes (integer) –

      The amount of cache in bytes allocated to a gateway.

    • CacheUsedPercentage (float) –

      Percent use of the gateway’s cache storage. This metric applies only to the gateway-cached volume setup. The sample is taken at the end of the reporting period.

    • CacheDirtyPercentage (float) –

      The file share’s contribution to the overall percentage of the gateway’s cache that has not been persisted to Amazon Web Services. The sample is taken at the end of the reporting period.

    • CacheHitPercentage (float) –

      Percent of application read operations from the file shares that are served from cache. The sample is taken at the end of the reporting period.

    • CacheMissPercentage (float) –

      Percent of application read operations from the file shares that are not served from cache. The sample is taken at the end of the reporting period.

Exceptions

  • StorageGateway.Client.exceptions.InvalidGatewayRequestException

  • StorageGateway.Client.exceptions.InternalServerError

Examples

Returns information about the cache of a gateway.

response = client.describe_cache(
    GatewayARN='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B',
)

print(response)

Expected Output:

{
    'CacheAllocatedInBytes': 2199023255552,
    'CacheDirtyPercentage': 0.07,
    'CacheHitPercentage': 99.68,
    'CacheMissPercentage': 0.32,
    'CacheUsedPercentage': 0.07,
    'DiskIds': [
        'pci-0000:03:00.0-scsi-0:0:0:0',
        'pci-0000:04:00.0-scsi-0:1:0:0',
    ],
    'GatewayARN': 'arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B',
    'ResponseMetadata': {
        '...': '...',
    },
}