AWS Storage Gateway
User Guide (API Version 2012-06-30)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

ListGateways

Description

This operation lists gateways owned by an AWS account in a region specified in the request. The returned list is ordered by gateway Amazon Resource Name (ARN).

By default, the operation returns a maximum of 100 gateways. This operation supports pagination that allows you to optionally reduce the number of gateways returned in a response.

If you have more gateways than are returned in a response-that is, the response returns only a truncated list of your gateways-the response contains a marker that you can specify in your next request to fetch the next page of gateways.

Request

Syntax

POST / HTTP/1.1 
Host: storagegateway.region.amazonaws.com
Authorization: authorization
Content-Type: application/x-amz-json-1.1
x-amz-date: date
x-amz-target: StorageGateway_20120630.ListGateways

{
  "Marker": "String",
  "Limit": Number
}

JSON Fields

Limit

Specifies that the list of gateways returned be limited to the specified number of items.

Constraints: Minimum value of 1. Maximum value of 100.

Required: No

Type: Number

Marker

An opaque string that indicates the position at which to begin the returned list of gateways.

Valid Values: A marker obtained from the response of a previous List Gateways request.

Required: No

Type: String

Response

Syntax

HTTP/1.1 200 OK
x-amzn-RequestId: x-amzn-RequestId
Content-Type: application/x-amz-json-1.1
Content-length: payloadLength
Date: date

{
   "Gateways" : [
     {
        "GatewayARN": "String"
     },
     ...
    ],
   "Marker":  "String"
}

JSON Fields

Gateways

An array of gateway objects composed of a GatewayARN and GatewayName.

Type: Array of GatewayInfo objects.

GatewayARN

The Amazon Resource Name (ARN) of a gateway.

Type: String

Marker

Use the marker in your next request to fetch the next set of gateways in the list. If there are no more gateways to list, this field does not appear in the response.

Type: String | null

Errors

This operation returns the following error codes in addition to exceptions common to all operations. For information about these errors and common exceptions, see Error Responses.

  • InternalError

  • InvalidParameters

  • NotSupported

Examples

List gateways

The following example does not specify any criteria for the returned list. Note that the request body is "{}". The response returns gateways (or up to the first 100) in the specified region owned by the AWS account.

Example Request

POST / HTTP/1.1 
Host: storagegateway.us-east-1.amazonaws.com
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20120425/us-east-1/storagegateway/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=9cd5a3584d1d67d57e61f120f35102d6b3649066abdd4bf4bbcf05bd9f2f8fe2
x-amz-date: 20120912T120000Z
x-amz-target: StorageGateway_20120630.ListGateways
{}

Example Response

HTTP/1.1 200 OK
x-amzn-RequestId: gur28r2rqlgb8vvs0mq17hlgij1q8glle1qeu3kpgg6f0kstauu0
Date: Wed, 12 Sep 2012 12:00:02 GMT
Content-Type: application/x-amz-json-1.1
Content-length: 212

{
  "GatewayList": [
    {
      "GatewayARN": "arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway",
      "GatewayARN": "arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway2"
    }
  ]
}