GetResourcesCommand

Lists information about a collection of Resource resources.

Example Syntax

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

import { APIGatewayClient, GetResourcesCommand } from "@aws-sdk/client-api-gateway"; // ES Modules import
// const { APIGatewayClient, GetResourcesCommand } = require("@aws-sdk/client-api-gateway"); // CommonJS import
const client = new APIGatewayClient(config);
const input = { // GetResourcesRequest
  restApiId: "STRING_VALUE", // required
  position: "STRING_VALUE",
  limit: Number("int"),
  embed: [ // ListOfString
    "STRING_VALUE",
  ],
};
const command = new GetResourcesCommand(input);
const response = await client.send(command);
// { // Resources
//   items: [ // ListOfResource
//     { // Resource
//       id: "STRING_VALUE",
//       parentId: "STRING_VALUE",
//       pathPart: "STRING_VALUE",
//       path: "STRING_VALUE",
//       resourceMethods: { // MapOfMethod
//         "<keys>": { // Method
//           httpMethod: "STRING_VALUE",
//           authorizationType: "STRING_VALUE",
//           authorizerId: "STRING_VALUE",
//           apiKeyRequired: true || false,
//           requestValidatorId: "STRING_VALUE",
//           operationName: "STRING_VALUE",
//           requestParameters: { // MapOfStringToBoolean
//             "<keys>": true || false,
//           },
//           requestModels: { // MapOfStringToString
//             "<keys>": "STRING_VALUE",
//           },
//           methodResponses: { // MapOfMethodResponse
//             "<keys>": { // MethodResponse
//               statusCode: "STRING_VALUE",
//               responseParameters: {
//                 "<keys>": true || false,
//               },
//               responseModels: {
//                 "<keys>": "STRING_VALUE",
//               },
//             },
//           },
//           methodIntegration: { // Integration
//             type: "HTTP" || "AWS" || "MOCK" || "HTTP_PROXY" || "AWS_PROXY",
//             httpMethod: "STRING_VALUE",
//             uri: "STRING_VALUE",
//             connectionType: "INTERNET" || "VPC_LINK",
//             connectionId: "STRING_VALUE",
//             credentials: "STRING_VALUE",
//             requestParameters: "<MapOfStringToString>",
//             requestTemplates: "<MapOfStringToString>",
//             passthroughBehavior: "STRING_VALUE",
//             contentHandling: "CONVERT_TO_BINARY" || "CONVERT_TO_TEXT",
//             timeoutInMillis: Number("int"),
//             cacheNamespace: "STRING_VALUE",
//             cacheKeyParameters: [ // ListOfString
//               "STRING_VALUE",
//             ],
//             integrationResponses: { // MapOfIntegrationResponse
//               "<keys>": { // IntegrationResponse
//                 statusCode: "STRING_VALUE",
//                 selectionPattern: "STRING_VALUE",
//                 responseParameters: "<MapOfStringToString>",
//                 responseTemplates: "<MapOfStringToString>",
//                 contentHandling: "CONVERT_TO_BINARY" || "CONVERT_TO_TEXT",
//               },
//             },
//             tlsConfig: { // TlsConfig
//               insecureSkipVerification: true || false,
//             },
//           },
//           authorizationScopes: [
//             "STRING_VALUE",
//           ],
//         },
//       },
//     },
//   ],
//   position: "STRING_VALUE",
// };

GetResourcesCommand Input

See GetResourcesCommandInput for more details

Parameter
Type
Description
restApiId
Required
string | undefined

The string identifier of the associated RestApi.

embed
string[] | undefined

A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This embed parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the "methods" string. For example, GET /restapis/{restapi_id}/resources?embed=methods.

limit
number | undefined

The maximum number of returned results per page. The default value is 25 and the maximum value is 500.

position
string | undefined

The current pagination position in the paged result set.

GetResourcesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
items
Resource[] | undefined

The current page of elements from this collection.

position
string | undefined

The current pagination position in the paged result set.

Throws

Name
Fault
Details
BadRequestException
client

The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

NotFoundException
client

The requested resource is not found. Make sure that the request URI is correct.

TooManyRequestsException
client

The request has reached its throttling limit. Retry after the specified time period.

UnauthorizedException
client

The request is denied because the caller has insufficient permissions.

APIGatewayServiceException
Base exception class for all service exceptions from APIGateway service.