ListGatewaysCommand

Displays a list of gateways that are associated with this account. This request returns a paginated result.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { MediaConnectClient, ListGatewaysCommand } from "@aws-sdk/client-mediaconnect"; // ES Modules import
// const { MediaConnectClient, ListGatewaysCommand } = require("@aws-sdk/client-mediaconnect"); // CommonJS import
const client = new MediaConnectClient(config);
const input = { // ListGatewaysRequest
  MaxResults: Number("int"),
  NextToken: "STRING_VALUE",
};
const command = new ListGatewaysCommand(input);
const response = await client.send(command);
// { // ListGatewaysResponse
//   Gateways: [ // __listOfListedGateway
//     { // ListedGateway
//       GatewayArn: "STRING_VALUE", // required
//       GatewayState: "CREATING" || "ACTIVE" || "UPDATING" || "ERROR" || "DELETING" || "DELETED", // required
//       Name: "STRING_VALUE", // required
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListGatewaysCommand Input

See ListGatewaysCommandInput for more details

Parameter
Type
Description
MaxResults
number | undefined
The maximum number of results to return per API request. For example, you submit a ListGateways request with MaxResults set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 10 results per page.
NextToken
string | undefined
The token that identifies which batch of results that you want to see. For example, you submit a ListGateways request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListGateways request a second time and specify the NextToken value.

ListGatewaysCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Gateways
ListedGateway[] | undefined
A list of gateway summaries.
NextToken
string | undefined
The token that identifies which batch of results that you want to see. For example, you submit a ListGateways request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListGateways request a second time and specify the NextToken value.

Throws

Name
Fault
Details
BadRequestException
client
Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
ConflictException
client
Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
InternalServerErrorException
server
Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
ServiceUnavailableException
server
Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
TooManyRequestsException
client
Exception raised by AWS Elemental MediaConnect. See the error message and documentation for the operation for more information on the cause of this exception.
MediaConnectServiceException
Base exception class for all service exceptions from MediaConnect service.