Class: AWS.APIGateway
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.APIGateway
- Identifier:
- apigateway
- API Version:
- 2015-07-09
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Amazon API Gateway helps developers deliver robust, secure, and scalable mobile and web application back ends. API Gateway allows developers to securely connect mobile and web applications to APIs that run on AWS Lambda, Amazon EC2, or other publicly addressable web services that are hosted outside of AWS.
Sending a Request Using APIGateway
var apigateway = new AWS.APIGateway();
apigateway.createApiKey(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the APIGateway object uses this specific API, you can
construct the object by passing the apiVersion
option to the constructor:
var apigateway = new AWS.APIGateway({apiVersion: '2015-07-09'});
You can also set the API version globally in AWS.config.apiVersions
using
the apigateway service identifier:
AWS.config.apiVersions = {
apigateway: '2015-07-09',
// other service API versions
};
var apigateway = new AWS.APIGateway();
Version:
-
2015-07-09
Constructor Summary
-
new AWS.APIGateway(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary
-
createApiKey(params = {}, callback) ⇒ AWS.Request
Create an ApiKey resource.
-
createAuthorizer(params = {}, callback) ⇒ AWS.Request
Adds a new Authorizer resource to an existing RestApi resource.
-
createBasePathMapping(params = {}, callback) ⇒ AWS.Request
Creates a new BasePathMapping resource.
-
createDeployment(params = {}, callback) ⇒ AWS.Request
Creates a Deployment resource, which makes a specified RestApi callable over the internet.
-
createDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the CreateDocumentationPart API operation.
-
createDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the CreateDocumentationVersion API operation.
-
createDomainName(params = {}, callback) ⇒ AWS.Request
Creates a new domain name.
-
createModel(params = {}, callback) ⇒ AWS.Request
Adds a new Model resource to an existing RestApi resource.
-
createRequestValidator(params = {}, callback) ⇒ AWS.Request
Creates a ReqeustValidator of a given RestApi.
-
createResource(params = {}, callback) ⇒ AWS.Request
Creates a Resource resource.
-
createRestApi(params = {}, callback) ⇒ AWS.Request
Creates a new RestApi resource.
-
createStage(params = {}, callback) ⇒ AWS.Request
Creates a new Stage resource that references a pre-existing Deployment for the API.
-
createUsagePlan(params = {}, callback) ⇒ AWS.Request
Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.
-
createUsagePlanKey(params = {}, callback) ⇒ AWS.Request
Creates a usage plan key for adding an existing API key to a usage plan.
-
createVpcLink(params = {}, callback) ⇒ AWS.Request
Creates a VPC link, under the caller's account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational.
-
deleteApiKey(params = {}, callback) ⇒ AWS.Request
Deletes the ApiKey resource.
-
deleteAuthorizer(params = {}, callback) ⇒ AWS.Request
Deletes an existing Authorizer resource.
-
deleteBasePathMapping(params = {}, callback) ⇒ AWS.Request
Deletes the BasePathMapping resource.
-
deleteClientCertificate(params = {}, callback) ⇒ AWS.Request
Deletes the ClientCertificate resource.
-
deleteDeployment(params = {}, callback) ⇒ AWS.Request
Deletes a Deployment resource.
-
deleteDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the DeleteDocumentationPart API operation.
-
deleteDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the DeleteDocumentationVersion API operation.
-
deleteDomainName(params = {}, callback) ⇒ AWS.Request
Deletes the DomainName resource.
-
deleteGatewayResponse(params = {}, callback) ⇒ AWS.Request
Clears any customization of a GatewayResponse of a specified response type on the given RestApi and resets it with the default settings.
-
deleteIntegration(params = {}, callback) ⇒ AWS.Request
Represents a delete integration.
-
deleteIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents a delete integration response.
-
deleteMethod(params = {}, callback) ⇒ AWS.Request
Deletes an existing Method resource.
-
deleteMethodResponse(params = {}, callback) ⇒ AWS.Request
Deletes an existing MethodResponse resource.
-
deleteModel(params = {}, callback) ⇒ AWS.Request
Deletes a model.
-
deleteRequestValidator(params = {}, callback) ⇒ AWS.Request
Deletes a RequestValidator of a given RestApi.
-
deleteResource(params = {}, callback) ⇒ AWS.Request
Deletes a Resource resource.
-
deleteRestApi(params = {}, callback) ⇒ AWS.Request
Deletes the specified API.
-
deleteStage(params = {}, callback) ⇒ AWS.Request
Deletes a Stage resource.
-
deleteUsagePlan(params = {}, callback) ⇒ AWS.Request
Deletes a usage plan of a given plan Id.
-
deleteUsagePlanKey(params = {}, callback) ⇒ AWS.Request
Deletes a usage plan key and remove the underlying API key from the associated usage plan.
-
deleteVpcLink(params = {}, callback) ⇒ AWS.Request
Deletes an existing VpcLink of a specified identifier.
-
flushStageAuthorizersCache(params = {}, callback) ⇒ AWS.Request
Flushes all authorizer cache entries on a stage.
-
flushStageCache(params = {}, callback) ⇒ AWS.Request
Flushes a stage's cache.
-
generateClientCertificate(params = {}, callback) ⇒ AWS.Request
Generates a ClientCertificate resource.
-
getAccount(params = {}, callback) ⇒ AWS.Request
Gets information about the current Account resource.
-
getApiKey(params = {}, callback) ⇒ AWS.Request
Gets information about the current ApiKey resource.
-
getApiKeys(params = {}, callback) ⇒ AWS.Request
Gets information about the current ApiKeys resource.
-
getAuthorizer(params = {}, callback) ⇒ AWS.Request
Describe an existing Authorizer resource.
-
getAuthorizers(params = {}, callback) ⇒ AWS.Request
Describe an existing Authorizers resource.
-
getBasePathMapping(params = {}, callback) ⇒ AWS.Request
Describe a BasePathMapping resource.
-
getBasePathMappings(params = {}, callback) ⇒ AWS.Request
Represents a collection of BasePathMapping resources.
-
getClientCertificate(params = {}, callback) ⇒ AWS.Request
Gets information about the current ClientCertificate resource.
-
getClientCertificates(params = {}, callback) ⇒ AWS.Request
Gets a collection of ClientCertificate resources.
-
getDeployment(params = {}, callback) ⇒ AWS.Request
Gets information about a Deployment resource.
-
getDeployments(params = {}, callback) ⇒ AWS.Request
Gets information about a Deployments collection.
-
getDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationPart API operation.
-
getDocumentationParts(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationParts API operation.
-
getDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationVersion API operation.
-
getDocumentationVersions(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationVersions API operation.
-
getDomainName(params = {}, callback) ⇒ AWS.Request
Represents a domain name that is contained in a simpler, more intuitive URL that can be called.
-
getDomainNames(params = {}, callback) ⇒ AWS.Request
Represents a collection of DomainName resources.
-
getExport(params = {}, callback) ⇒ AWS.Request
Exports a deployed version of a RestApi in a specified format.
-
getGatewayResponse(params = {}, callback) ⇒ AWS.Request
Gets a GatewayResponse of a specified response type on the given RestApi.
-
getGatewayResponses(params = {}, callback) ⇒ AWS.Request
Gets the GatewayResponses collection on the given RestApi.
-
getIntegration(params = {}, callback) ⇒ AWS.Request
Get the integration settings.
-
getIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents a get integration response.
-
getMethod(params = {}, callback) ⇒ AWS.Request
Describe an existing Method resource.
-
getMethodResponse(params = {}, callback) ⇒ AWS.Request
Describes a MethodResponse resource.
-
getModel(params = {}, callback) ⇒ AWS.Request
Describes an existing model defined for a RestApi resource.
-
getModels(params = {}, callback) ⇒ AWS.Request
Describes existing Models defined for a RestApi resource.
-
getModelTemplate(params = {}, callback) ⇒ AWS.Request
Generates a sample mapping template that can be used to transform a payload into the structure of a model.
-
getRequestValidator(params = {}, callback) ⇒ AWS.Request
Gets a RequestValidator of a given RestApi.
-
getRequestValidators(params = {}, callback) ⇒ AWS.Request
Gets the RequestValidators collection of a given RestApi.
-
getResource(params = {}, callback) ⇒ AWS.Request
Lists information about a resource.
-
getResources(params = {}, callback) ⇒ AWS.Request
Lists information about a collection of Resource resources.
-
getRestApi(params = {}, callback) ⇒ AWS.Request
Lists the RestApi resource in the collection.
-
getRestApis(params = {}, callback) ⇒ AWS.Request
Lists the RestApis resources for your collection.
-
getSdk(params = {}, callback) ⇒ AWS.Request
Generates a client SDK for a RestApi and Stage.
-
getSdkType(params = {}, callback) ⇒ AWS.Request
Calls the GetSdkType API operation.
-
getSdkTypes(params = {}, callback) ⇒ AWS.Request
Calls the GetSdkTypes API operation.
-
getStage(params = {}, callback) ⇒ AWS.Request
Gets information about a Stage resource.
-
getStages(params = {}, callback) ⇒ AWS.Request
Gets information about one or more Stage resources.
-
getTags(params = {}, callback) ⇒ AWS.Request
Gets the Tags collection for a given resource.
-
getUsage(params = {}, callback) ⇒ AWS.Request
Gets the usage data of a usage plan in a specified time interval.
-
getUsagePlan(params = {}, callback) ⇒ AWS.Request
Gets a usage plan of a given plan identifier.
-
getUsagePlanKey(params = {}, callback) ⇒ AWS.Request
Gets a usage plan key of a given key identifier.
-
getUsagePlanKeys(params = {}, callback) ⇒ AWS.Request
Gets all the usage plan keys representing the API keys added to a specified usage plan.
-
getUsagePlans(params = {}, callback) ⇒ AWS.Request
Gets all the usage plans of the caller's account.
-
getVpcLink(params = {}, callback) ⇒ AWS.Request
Gets a specified VPC link under the caller's account in a region.
-
getVpcLinks(params = {}, callback) ⇒ AWS.Request
Gets the VpcLinks collection under the caller's account in a selected region.
-
importApiKeys(params = {}, callback) ⇒ AWS.Request
Import API keys from an external source, such as a CSV-formatted file.
-
importDocumentationParts(params = {}, callback) ⇒ AWS.Request
Calls the ImportDocumentationParts API operation.
-
importRestApi(params = {}, callback) ⇒ AWS.Request
A feature of the API Gateway control service for creating a new API from an external API definition file.
-
putGatewayResponse(params = {}, callback) ⇒ AWS.Request
Creates a customization of a GatewayResponse of a specified response type and status code on the given RestApi.
-
putIntegration(params = {}, callback) ⇒ AWS.Request
Sets up a method's integration.
-
putIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents a put integration.
-
putMethod(params = {}, callback) ⇒ AWS.Request
Add a method to an existing Resource resource.
-
putMethodResponse(params = {}, callback) ⇒ AWS.Request
Adds a MethodResponse to an existing Method resource.
-
putRestApi(params = {}, callback) ⇒ AWS.Request
A feature of the API Gateway control service for updating an existing API with an input of external API definitions.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Adds or updates a tag on a given resource.
-
testInvokeAuthorizer(params = {}, callback) ⇒ AWS.Request
Simulate the execution of an Authorizer in your RestApi with headers, parameters, and an incoming request body.
-
testInvokeMethod(params = {}, callback) ⇒ AWS.Request
Simulate the execution of a Method in your RestApi with headers, parameters, and an incoming request body.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Removes a tag from a given resource.
-
updateAccount(params = {}, callback) ⇒ AWS.Request
Changes information about the current Account resource.
-
updateApiKey(params = {}, callback) ⇒ AWS.Request
Changes information about an ApiKey resource.
-
updateAuthorizer(params = {}, callback) ⇒ AWS.Request
Updates an existing Authorizer resource.
-
updateBasePathMapping(params = {}, callback) ⇒ AWS.Request
Changes information about the BasePathMapping resource.
-
updateClientCertificate(params = {}, callback) ⇒ AWS.Request
Changes information about an ClientCertificate resource.
-
updateDeployment(params = {}, callback) ⇒ AWS.Request
Changes information about a Deployment resource.
-
updateDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the UpdateDocumentationPart API operation.
-
updateDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the UpdateDocumentationVersion API operation.
-
updateDomainName(params = {}, callback) ⇒ AWS.Request
Changes information about the DomainName resource.
-
updateGatewayResponse(params = {}, callback) ⇒ AWS.Request
Updates a GatewayResponse of a specified response type on the given RestApi.
-
updateIntegration(params = {}, callback) ⇒ AWS.Request
Represents an update integration.
-
updateIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents an update integration response.
-
updateMethod(params = {}, callback) ⇒ AWS.Request
Updates an existing Method resource.
-
updateMethodResponse(params = {}, callback) ⇒ AWS.Request
Updates an existing MethodResponse resource.
-
updateModel(params = {}, callback) ⇒ AWS.Request
Changes information about a model.
-
updateRequestValidator(params = {}, callback) ⇒ AWS.Request
Updates a RequestValidator of a given RestApi.
-
updateResource(params = {}, callback) ⇒ AWS.Request
Changes information about a Resource resource.
-
updateRestApi(params = {}, callback) ⇒ AWS.Request
Changes information about the specified API.
-
updateStage(params = {}, callback) ⇒ AWS.Request
Changes information about a Stage resource.
-
updateUsage(params = {}, callback) ⇒ AWS.Request
Grants a temporary extension to the remaining quota of a usage plan associated with a specified API key.
-
updateUsagePlan(params = {}, callback) ⇒ AWS.Request
Updates a usage plan of a given plan Id.
-
updateVpcLink(params = {}, callback) ⇒ AWS.Request
Updates an existing VpcLink of a specified identifier.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, defineService
Constructor Details
new AWS.APIGateway(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Examples:
Constructing a APIGateway object
var apigateway = new AWS.APIGateway({apiVersion: '2015-07-09'});
Options Hash (options):
-
params
(map)
—
An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
-
endpoint
(String)
—
The endpoint URI to send requests to. The default endpoint is built from the configured
region
. The endpoint should be a string like'https://{service}.{region}.amazonaws.com'
. -
accessKeyId
(String)
—
your AWS access key ID.
-
secretAccessKey
(String)
—
your AWS secret access key.
-
sessionToken
(AWS.Credentials)
—
the optional AWS session token to sign requests with.
-
credentials
(AWS.Credentials)
—
the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.
-
credentialProvider
(AWS.CredentialProviderChain)
—
the provider chain used to resolve credentials if no static
credentials
property is set. -
region
(String)
—
the region to send service requests to. See AWS.APIGateway.region for more information.
-
maxRetries
(Integer)
—
the maximum amount of retries to attempt with a request. See AWS.APIGateway.maxRetries for more information.
-
maxRedirects
(Integer)
—
the maximum amount of redirects to follow with a request. See AWS.APIGateway.maxRedirects for more information.
-
sslEnabled
(Boolean)
—
whether to enable SSL for requests.
-
paramValidation
(Boolean|map)
—
whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
true
. - max [Boolean] — Validates that a value meets the max constraint.
- pattern [Boolean] — Validates that a string value matches a regular expression.
- enum [Boolean] — Validates that a string value matches one of the allowable enum values.
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
-
computeChecksums
(Boolean)
—
whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)
-
convertResponseTypes
(Boolean)
—
whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to
true
. -
correctClockSkew
(Boolean)
—
whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to
false
. -
s3ForcePathStyle
(Boolean)
—
whether to force path style URLs for S3 objects.
-
s3BucketEndpoint
(Boolean)
—
whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an
endpoint
to be provided explicitly to the service constructor. -
s3DisableBodySigning
(Boolean)
—
whether S3 body signing should be disabled when using signature version
v4
. Body signing can only be disabled when using https. Defaults totrue
. -
retryDelayOptions
(map)
—
A set of options to configure the retry delay on retryable errors. Currently supported options are:
- base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
- customBackoff [function] — A custom function that accepts a retry count
and returns the amount of time to delay in milliseconds. The
base
option will be ignored if this option is supplied.
-
httpOptions
(map)
—
A set of options to pass to the low-level HTTP request. Currently supported options are:
- proxy [String] — the URL to proxy requests through
- agent [http.Agent, https.Agent] — the Agent object to perform
HTTP requests with. Used for connection pooling. Defaults to the global
agent (
http.globalAgent
) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment. - connectTimeout [Integer] — Sets the socket to timeout after
failing to establish a connection with the server after
connectTimeout
milliseconds. This timeout has no effect once a socket connection has been established. - timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
- xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
- xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
-
apiVersion
(String, Date)
—
a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by
apiVersions
). Specify 'latest' to use the latest possible version. -
apiVersions
(map<String, String|Date>)
—
a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
-
logger
(#write, #log)
—
an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests
-
systemClockOffset
(Number)
—
an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global
AWS.config
object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds. -
signatureVersion
(String)
—
the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.
-
signatureCache
(Boolean)
—
whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to
true
. -
dynamoDbCrc32
(Boolean)
—
whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default:
true
. -
useAccelerateEndpoint
(Boolean)
—
Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default:
false
. -
clientSideMonitoring
(Boolean)
—
whether to collect and publish this client's performance metrics of all its API requests.
-
endpointDiscoveryEnabled
(Boolean)
—
whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'
-
endpointCacheSize
(Number)
—
the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000
-
hostPrefixEnabled
(Boolean)
—
whether to marshal request parameters to the prefix of hostname. Defaults to
true
.
Property Details
Method Details
createApiKey(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the createApiKey operation
var params = {
customerId: 'STRING_VALUE',
description: 'STRING_VALUE',
enabled: true || false,
generateDistinctId: true || false,
name: 'STRING_VALUE',
stageKeys: [
{
restApiId: 'STRING_VALUE',
stageName: 'STRING_VALUE'
},
/* more items */
],
value: 'STRING_VALUE'
};
apigateway.createApiKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
name
— (String
)The name of the ApiKey.
description
— (String
)The description of the ApiKey.
enabled
— (Boolean
)Specifies whether the ApiKey can be used by callers.
generateDistinctId
— (Boolean
)Specifies whether (
true
) or not (false
) the key identifier is distinct from the created API key value.value
— (String
)Specifies a value of the API key.
stageKeys
— (Array<map>
)DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
restApiId
— (String
)The string identifier of the associated RestApi.
stageName
— (String
)The stage name associated with the stage key.
customerId
— (String
)An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of the API Key.
value
— (String
)The value of the API Key.
name
— (String
)The name of the API Key.
customerId
— (String
)An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description
— (String
)The description of the API Key.
enabled
— (Boolean
)Specifies whether the API Key can be used by callers.
createdDate
— (Date
)The timestamp when the API Key was created.
lastUpdatedDate
— (Date
)The timestamp when the API Key was last updated.
stageKeys
— (Array<String>
)A list of Stage resources that are associated with the ApiKey resource.
-
(AWS.Response)
—
Returns:
createAuthorizer(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the createAuthorizer operation
var params = {
name: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
type: TOKEN | REQUEST | COGNITO_USER_POOLS, /* required */
authType: 'STRING_VALUE',
authorizerCredentials: 'STRING_VALUE',
authorizerResultTtlInSeconds: 'NUMBER_VALUE',
authorizerUri: 'STRING_VALUE',
identitySource: 'STRING_VALUE',
identityValidationExpression: 'STRING_VALUE',
providerARNs: [
'STRING_VALUE',
/* more items */
]
};
apigateway.createAuthorizer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
name
— (String
)[Required] The name of the authorizer.
type
— (String
)[Required] The authorizer type. Valid values are
Possible values include:TOKEN
for a Lambda function using a single authorization token submitted in a custom header,REQUEST
for a Lambda function using incoming request parameters, andCOGNITO_USER_POOLS
for using an Amazon Cognito user pool."TOKEN"
"REQUEST"
"COGNITO_USER_POOLS"
providerARNs
— (Array<String>
)A list of the Amazon Cognito user pool ARNs for the
COGNITO_USER_POOLS
authorizer. Each element is of this format:arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For aTOKEN
orREQUEST
authorizer, this is not defined.authType
— (String
)Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri
— (String
)Specifies the authorizer's Uniform Resource Identifier (URI). For
TOKEN
orREQUEST
authorizers, this must be a well-formed Lambda function URI, for example,arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this formarn:aws:apigateway:{region}:lambda:path/{service_api}
, where{region}
is the same as the region hosting the Lambda function,path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial/
. For Lambda functions, this is usually of the form/2015-03-31/functions/[FunctionARN]/invocations
.authorizerCredentials
— (String
)Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource
— (String
)The identity source for which authorization is requested.
- For a
TOKEN
orCOGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name isAuth
, the header mapping expression ismethod.request.header.Auth
. - For the
REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if anAuth
header, aName
query string parameter are defined as identity sources, this value ismethod.request.header.Auth, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of theREQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
- For a
identityValidationExpression
— (String
)A validation expression for the incoming identity token. For
TOKEN
authorizers, this value is a regular expression. API Gateway will match theaud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to theREQUEST
authorizer.authorizerResultTtlInSeconds
— (Integer
)The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the authorizer resource.
name
— (String
)[Required] The name of the authorizer.
type
— (String
)The authorizer type. Valid values are
Possible values include:TOKEN
for a Lambda function using a single authorization token submitted in a custom header,REQUEST
for a Lambda function using incoming request parameters, andCOGNITO_USER_POOLS
for using an Amazon Cognito user pool."TOKEN"
"REQUEST"
"COGNITO_USER_POOLS"
providerARNs
— (Array<String>
)A list of the Amazon Cognito user pool ARNs for the
COGNITO_USER_POOLS
authorizer. Each element is of this format:arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For aTOKEN
orREQUEST
authorizer, this is not defined.authType
— (String
)Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri
— (String
)Specifies the authorizer's Uniform Resource Identifier (URI). For
TOKEN
orREQUEST
authorizers, this must be a well-formed Lambda function URI, for example,arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this formarn:aws:apigateway:{region}:lambda:path/{service_api}
, where{region}
is the same as the region hosting the Lambda function,path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial/
. For Lambda functions, this is usually of the form/2015-03-31/functions/[FunctionARN]/invocations
.authorizerCredentials
— (String
)Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource
— (String
)The identity source for which authorization is requested.
- For a
TOKEN
orCOGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name isAuth
, the header mapping expression ismethod.request.header.Auth
. - For the
REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if anAuth
header, aName
query string parameter are defined as identity sources, this value ismethod.request.header.Auth, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of theREQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
- For a
identityValidationExpression
— (String
)A validation expression for the incoming identity token. For
TOKEN
authorizers, this value is a regular expression. API Gateway will match theaud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to theREQUEST
authorizer.authorizerResultTtlInSeconds
— (Integer
)The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
-
(AWS.Response)
—
Returns:
createBasePathMapping(params = {}, callback) ⇒ AWS.Request
Creates a new BasePathMapping resource.
Service Reference:
Examples:
Calling the createBasePathMapping operation
var params = {
domainName: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
basePath: 'STRING_VALUE',
stage: 'STRING_VALUE'
};
apigateway.createBasePathMapping(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The domain name of the BasePathMapping resource to create.
basePath
— (String
)The base path name that callers of the API must provide as part of the URL after the domain name. This value must be unique for all of the mappings across a single API. Leave this blank if you do not want callers to specify a base path name after the domain name.
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
stage
— (String
)The name of the API's stage that you want to use for this mapping. Leave this blank if you do not want callers to explicitly specify the stage name after any base path name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:basePath
— (String
)The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId
— (String
)The string identifier of the associated RestApi.
stage
— (String
)The name of the associated stage.
-
(AWS.Response)
—
Returns:
createDeployment(params = {}, callback) ⇒ AWS.Request
Creates a Deployment resource, which makes a specified RestApi callable over the internet.
Service Reference:
Examples:
Calling the createDeployment operation
var params = {
restApiId: 'STRING_VALUE', /* required */
cacheClusterEnabled: true || false,
cacheClusterSize: 0.5 | 1.6 | 6.1 | 13.5 | 28.4 | 58.2 | 118 | 237,
canarySettings: {
percentTraffic: 'NUMBER_VALUE',
stageVariableOverrides: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
useStageCache: true || false
},
description: 'STRING_VALUE',
stageDescription: 'STRING_VALUE',
stageName: 'STRING_VALUE',
tracingEnabled: true || false,
variables: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.createDeployment(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
stageName
— (String
)The name of the Stage resource for the Deployment resource to create.
stageDescription
— (String
)The description of the Stage resource for the Deployment resource to create.
description
— (String
)The description for the Deployment resource to create.
cacheClusterEnabled
— (Boolean
)Enables a cache cluster for the Stage resource specified in the input.
cacheClusterSize
— (String
)Specifies the cache cluster size for the Stage resource specified in the input, if a cache cluster is enabled.
Possible values include:"0.5"
"1.6"
"6.1"
"13.5"
"28.4"
"58.2"
"118"
"237"
variables
— (map<String>
)A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match
[A-Za-z0-9-._~:/?#&=,]+
.canarySettings
— (map
)The input configuration for the canary deployment when the deployment is a canary release deployment.
percentTraffic
— (Float
)The percentage (0.0-100.0) of traffic routed to the canary deployment.
stageVariableOverrides
— (map<String>
)A stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache
— (Boolean
)A Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
tracingEnabled
— (Boolean
)Specifies whether active tracing with X-ray is enabled for the Stage.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the deployment resource.
description
— (String
)The description for the deployment resource.
createdDate
— (Date
)The date and time that the deployment resource was created.
apiSummary
— (map<map<map>>
)A summary of the RestApi at the date and time that the deployment resource was created.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.apiKeyRequired
— (Boolean
)Specifies whether the method requires a valid ApiKey.
-
(AWS.Response)
—
Returns:
createDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the CreateDocumentationPart API operation.
Service Reference:
Examples:
Calling the createDocumentationPart operation
var params = {
location: { /* required */
type: API | AUTHORIZER | MODEL | RESOURCE | METHOD | PATH_PARAMETER | QUERY_PARAMETER | REQUEST_HEADER | REQUEST_BODY | RESPONSE | RESPONSE_HEADER | RESPONSE_BODY, /* required */
method: 'STRING_VALUE',
name: 'STRING_VALUE',
path: 'STRING_VALUE',
statusCode: 'STRING_VALUE'
},
properties: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.createDocumentationPart(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
location
— (map
)[Required] The location of the targeted API entity of the to-be-created documentation part.
type
— required — (String
)[Required] The type of API entity to which the documentation content applies. Valid values are
Possible values include:API
,AUTHORIZER
,MODEL
,RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. Content inheritance does not apply to any entity of theAPI
,AUTHORIZER
,METHOD
,MODEL
,REQUEST_BODY
, orRESOURCE
type."API"
"AUTHORIZER"
"MODEL"
"RESOURCE"
"METHOD"
"PATH_PARAMETER"
"QUERY_PARAMETER"
"REQUEST_HEADER"
"REQUEST_BODY"
"RESPONSE"
"RESPONSE_HEADER"
"RESPONSE_BODY"
path
— (String
)The URL path of the target. It is a valid field for the API entity types of
RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is/
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the otherlocation
attributes, the child entity'spath
attribute must match that of the parent entity as a prefix.method
— (String
)The HTTP verb of a method. It is a valid field for the API entity types of
METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'smethod
attribute must match that of the parent entity exactly.statusCode
— (String
)The HTTP status code of a response. It is a valid field for the API entity types of
RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'sstatusCode
attribute must match that of the parent entity exactly.name
— (String
)The name of the targeted API entity. It is a valid and required field for the API entity types of
AUTHORIZER
,MODEL
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
andRESPONSE_HEADER
. It is an invalid field for any other entity type.
properties
— (String
)[Required] The new documentation content map of the targeted API entity. Enclosed key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be exported and, hence, published.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The DocumentationPart identifier, generated by API Gateway when the
DocumentationPart
is created.location
— (map
)The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type
— required — (String
)[Required] The type of API entity to which the documentation content applies. Valid values are
Possible values include:API
,AUTHORIZER
,MODEL
,RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. Content inheritance does not apply to any entity of theAPI
,AUTHORIZER
,METHOD
,MODEL
,REQUEST_BODY
, orRESOURCE
type."API"
"AUTHORIZER"
"MODEL"
"RESOURCE"
"METHOD"
"PATH_PARAMETER"
"QUERY_PARAMETER"
"REQUEST_HEADER"
"REQUEST_BODY"
"RESPONSE"
"RESPONSE_HEADER"
"RESPONSE_BODY"
path
— (String
)The URL path of the target. It is a valid field for the API entity types of
RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is/
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the otherlocation
attributes, the child entity'spath
attribute must match that of the parent entity as a prefix.method
— (String
)The HTTP verb of a method. It is a valid field for the API entity types of
METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'smethod
attribute must match that of the parent entity exactly.statusCode
— (String
)The HTTP status code of a response. It is a valid field for the API entity types of
RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'sstatusCode
attribute must match that of the parent entity exactly.name
— (String
)The name of the targeted API entity. It is a valid and required field for the API entity types of
AUTHORIZER
,MODEL
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
andRESPONSE_HEADER
. It is an invalid field for any other entity type.
properties
— (String
)A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g.,
"{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from theproperties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension ofx-amazon-apigateway-documentation
.
-
(AWS.Response)
—
Returns:
createDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the CreateDocumentationVersion API operation.
Service Reference:
Examples:
Calling the createDocumentationVersion operation
var params = {
documentationVersion: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
description: 'STRING_VALUE',
stageName: 'STRING_VALUE'
};
apigateway.createDocumentationVersion(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
documentationVersion
— (String
)[Required] The version identifier of the new snapshot.
stageName
— (String
)The stage name to be associated with the new documentation snapshot.
description
— (String
)A description about the new documentation snapshot.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:version
— (String
)The version identifier of the API documentation snapshot.
createdDate
— (Date
)The date when the API documentation snapshot is created.
description
— (String
)The description of the API documentation snapshot.
-
(AWS.Response)
—
Returns:
createDomainName(params = {}, callback) ⇒ AWS.Request
Creates a new domain name.
Service Reference:
Examples:
Calling the createDomainName operation
var params = {
domainName: 'STRING_VALUE', /* required */
certificateArn: 'STRING_VALUE',
certificateBody: 'STRING_VALUE',
certificateChain: 'STRING_VALUE',
certificateName: 'STRING_VALUE',
certificatePrivateKey: 'STRING_VALUE',
endpointConfiguration: {
types: [
REGIONAL | EDGE | PRIVATE,
/* more items */
]
},
regionalCertificateArn: 'STRING_VALUE',
regionalCertificateName: 'STRING_VALUE'
};
apigateway.createDomainName(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The name of the DomainName resource.
certificateName
— (String
)The user-friendly name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateBody
— (String
)[Deprecated] The body of the server certificate that will be used by edge-optimized endpoint for this domain name provided by your certificate authority.
certificatePrivateKey
— (String
)[Deprecated] Your edge-optimized endpoint's domain name certificate's private key.
certificateChain
— (String
)[Deprecated] The intermediate certificates and optionally the root certificate, one after the other without any blank lines, used by an edge-optimized endpoint for this domain name. If you include the root certificate, your certificate chain must start with intermediate certificates and end with the root certificate. Use the intermediate certificates that were provided by your certificate authority. Do not include any intermediaries that are not in the chain of trust path.
certificateArn
— (String
)The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
regionalCertificateName
— (String
)The user-friendly name of the certificate that will be used by regional endpoint for this domain name.
regionalCertificateArn
— (String
)The reference to an AWS-managed certificate that will be used by regional endpoint for this domain name. AWS Certificate Manager is the only supported source.
endpointConfiguration
— (map
)The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:domainName
— (String
)The custom domain name as an API host name, for example,
my-api.example.com
.certificateName
— (String
)The name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateArn
— (String
)The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
certificateUploadDate
— (Date
)The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
regionalDomainName
— (String
)The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regionalHostedZoneId
— (String
)The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
regionalCertificateName
— (String
)The name of the certificate that will be used for validating the regional domain name.
regionalCertificateArn
— (String
)The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
distributionDomainName
— (String
)The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
distributionHostedZoneId
— (String
)The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.endpointConfiguration
— (map
)The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
-
(AWS.Response)
—
Returns:
createModel(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the createModel operation
var params = {
contentType: 'STRING_VALUE', /* required */
name: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
description: 'STRING_VALUE',
schema: 'STRING_VALUE'
};
apigateway.createModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The RestApi identifier under which the Model will be created.
name
— (String
)[Required] The name of the model. Must be alphanumeric.
description
— (String
)The description of the model.
schema
— (String
)The schema for the model. For
application/json
models, this should be JSON schema draft 4 model.contentType
— (String
)[Required] The content-type for the model.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the model resource.
name
— (String
)The name of the model. Must be an alphanumeric string.
description
— (String
)The description of the model.
schema
— (String
)The schema for the model. For
application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.contentType
— (String
)The content-type for the model.
-
(AWS.Response)
—
Returns:
createRequestValidator(params = {}, callback) ⇒ AWS.Request
Creates a ReqeustValidator of a given RestApi.
Service Reference:
Examples:
Calling the createRequestValidator operation
var params = {
restApiId: 'STRING_VALUE', /* required */
name: 'STRING_VALUE',
validateRequestBody: true || false,
validateRequestParameters: true || false
};
apigateway.createRequestValidator(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
name
— (String
)The name of the to-be-created RequestValidator.
validateRequestBody
— (Boolean
)A Boolean flag to indicate whether to validate request body according to the configured model schema for the method (
true
) or not (false
).validateRequestParameters
— (Boolean
)A Boolean flag to indicate whether to validate request parameters,
true
, or notfalse
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of this RequestValidator.
name
— (String
)The name of this RequestValidator
validateRequestBody
— (Boolean
)A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters
— (Boolean
)A Boolean flag to indicate whether to validate request parameters (
true
) or not (false
).
-
(AWS.Response)
—
Returns:
createResource(params = {}, callback) ⇒ AWS.Request
Creates a Resource resource.
Service Reference:
Examples:
Calling the createResource operation
var params = {
parentId: 'STRING_VALUE', /* required */
pathPart: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.createResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
parentId
— (String
)[Required] The parent resource's identifier.
pathPart
— (String
)The last path segment for this resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The resource's identifier.
parentId
— (String
)The parent resource's identifier.
pathPart
— (String
)The last path segment for this resource.
path
— (String
)The full path for this resource.
resourceMethods
— (map<map>
)Gets an API resource's method of a given HTTP verb.
The resource methods are a map of methods indexed by methods' HTTP verbs enabled on the resource. This method map is included in the
200 OK
response of theGET /restapis/{restapi_id}/resources/{resource_id}
orGET /restapis/{restapi_id}/resources/{resource_id}?embed=methods
request.Example: Get the GET method of an API resource
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20170223T031827Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20170223/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html", "name": "method", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true } ], "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET", "name": "GET", "title": "GET" }, "integration:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "method:integration": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "method:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "methodresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/{status_code}", "templated": true } }, "apiKeyRequired": false, "authorizationType": "NONE", "httpMethod": "GET", "_embedded": { "method:integration": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "3kzxbg5sa2", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestParameters": { "integration.request.header.Content-Type": "'application/x-amz-json-1.1'" }, "requestTemplates": { "application/json": "{\n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-east-1:kinesis:action/ListStreams", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" } } }, "method:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.Content-Type": false }, "statusCode": "200" } } }
If the
OPTIONS
is enabled on the resource, you can follow the example here to get that method. Just replace theGET
of the last path segment in the request URL withOPTIONS
.httpMethod
— (String
)The method's HTTP verb.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)The identifier of an Authorizer to use on this method. The
authorizationType
must beCUSTOM
.apiKeyRequired
— (Boolean
)A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId
— (String
)The identifier of a RequestValidator for request validation.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.requestModels
— (map<String>
)A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses
— (map<map>
)Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
Example: Get a 200 OK response of a GET method
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" }
statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration
— (map
)Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
Example:
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } }
type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
-
(AWS.Response)
—
Returns:
createRestApi(params = {}, callback) ⇒ AWS.Request
Creates a new RestApi resource.
Service Reference:
Examples:
Calling the createRestApi operation
var params = {
name: 'STRING_VALUE', /* required */
apiKeySource: HEADER | AUTHORIZER,
binaryMediaTypes: [
'STRING_VALUE',
/* more items */
],
cloneFrom: 'STRING_VALUE',
description: 'STRING_VALUE',
endpointConfiguration: {
types: [
REGIONAL | EDGE | PRIVATE,
/* more items */
]
},
minimumCompressionSize: 'NUMBER_VALUE',
policy: 'STRING_VALUE',
version: 'STRING_VALUE'
};
apigateway.createRestApi(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
name
— (String
)[Required] The name of the RestApi.
description
— (String
)The description of the RestApi.
version
— (String
)A version identifier for the API.
cloneFrom
— (String
)The ID of the RestApi that you want to clone from.
binaryMediaTypes
— (Array<String>
)The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize
— (Integer
)A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource
— (String
)The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.
"HEADER"
"AUTHORIZER"
endpointConfiguration
— (map
)The endpoint configuration of this RestApi showing the endpoint types of the API.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
policy
— (String
) A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name
— (String
)The API's name.
description
— (String
)The API's description.
createdDate
— (Date
)The timestamp when the API was created.
version
— (String
)A version identifier for the API.
warnings
— (Array<String>
)The warning messages reported when
failonwarnings
is turned on during API import.binaryMediaTypes
— (Array<String>
)The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize
— (Integer
)A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource
— (String
)The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.
"HEADER"
"AUTHORIZER"
endpointConfiguration
— (map
)The endpoint configuration of this RestApi showing the endpoint types of the API.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
policy
— (String
) A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
-
(AWS.Response)
—
Returns:
createStage(params = {}, callback) ⇒ AWS.Request
Creates a new Stage resource that references a pre-existing Deployment for the API.
Service Reference:
Examples:
Calling the createStage operation
var params = {
deploymentId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE', /* required */
cacheClusterEnabled: true || false,
cacheClusterSize: 0.5 | 1.6 | 6.1 | 13.5 | 28.4 | 58.2 | 118 | 237,
canarySettings: {
deploymentId: 'STRING_VALUE',
percentTraffic: 'NUMBER_VALUE',
stageVariableOverrides: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
useStageCache: true || false
},
description: 'STRING_VALUE',
documentationVersion: 'STRING_VALUE',
tags: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
tracingEnabled: true || false,
variables: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.createStage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
stageName
— (String
)[Required] The name for the Stage resource.
deploymentId
— (String
)[Required] The identifier of the Deployment resource for the Stage resource.
description
— (String
)The description of the Stage resource.
cacheClusterEnabled
— (Boolean
)Whether cache clustering is enabled for the stage.
cacheClusterSize
— (String
)The stage's cache cluster size.
Possible values include:"0.5"
"1.6"
"6.1"
"13.5"
"28.4"
"58.2"
"118"
"237"
variables
— (map<String>
)A map that defines the stage variables for the new Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match
[A-Za-z0-9-._~:/?#&=,]+
.documentationVersion
— (String
)The version of the associated API documentation.
canarySettings
— (map
)The canary deployment settings of this stage.
percentTraffic
— (Float
)The percent (0-100) of traffic diverted to a canary deployment.
deploymentId
— (String
)The ID of the canary deployment.
stageVariableOverrides
— (map<String>
)Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache
— (Boolean
)A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled
— (Boolean
)Specifies whether active tracing with X-ray is enabled for the Stage.
tags
— (map<String>
)The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:deploymentId
— (String
)The identifier of the Deployment that the stage points to.
clientCertificateId
— (String
)The identifier of a client certificate for an API stage.
stageName
— (String
)The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway.
description
— (String
)The stage's description.
cacheClusterEnabled
— (Boolean
)Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize
— (String
)The size of the cache cluster for the stage, if enabled.
Possible values include:"0.5"
"1.6"
"6.1"
"13.5"
"28.4"
"58.2"
"118"
"237"
cacheClusterStatus
— (String
)The status of the cache cluster for the stage, if enabled.
Possible values include:"CREATE_IN_PROGRESS"
"AVAILABLE"
"DELETE_IN_PROGRESS"
"NOT_AVAILABLE"
"FLUSH_IN_PROGRESS"
methodSettings
— (map<map>
)A map that defines the method settings for a Stage resource. Keys (designated as
/{method_setting_key
below) are method paths defined as{resource_path}/{http_method}
for an individual method override, or/*/*
for overriding all methods in the stage.metricsEnabled
— (Boolean
)Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is
/{method_setting_key}/metrics/enabled
, and the value is a Boolean.loggingLevel
— (String
)Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/loglevel
, and the available levels areOFF
,ERROR
, andINFO
.dataTraceEnabled
— (Boolean
)Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/dataTrace
, and the value is a Boolean.throttlingBurstLimit
— (Integer
)Specifies the throttling burst limit. The PATCH path for this setting is
/{method_setting_key}/throttling/burstLimit
, and the value is an integer.throttlingRateLimit
— (Float
)Specifies the throttling rate limit. The PATCH path for this setting is
/{method_setting_key}/throttling/rateLimit
, and the value is a double.cachingEnabled
— (Boolean
)Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is
/{method_setting_key}/caching/enabled
, and the value is a Boolean.cacheTtlInSeconds
— (Integer
)Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is
/{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.cacheDataEncrypted
— (Boolean
)Specifies whether the cached responses are encrypted. The PATCH path for this setting is
/{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.requireAuthorizationForCacheControl
— (Boolean
)Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is
/{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.unauthorizedCacheControlHeaderStrategy
— (String
)Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is
Possible values include:/{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values areFAIL_WITH_403
,SUCCEED_WITH_RESPONSE_HEADER
,SUCCEED_WITHOUT_RESPONSE_HEADER
."FAIL_WITH_403"
"SUCCEED_WITH_RESPONSE_HEADER"
"SUCCEED_WITHOUT_RESPONSE_HEADER"
variables
— (map<String>
)A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match
[A-Za-z0-9-._~:/?#&=,]+
.documentationVersion
— (String
)The version of the associated API documentation.
accessLogSettings
— (map
)Settings for logging access in this stage.
format
— (String
)A single line format of the access logs of data, as specified by selected $context variables. The format must include at least
$context.requestId
.destinationArn
— (String
)The ARN of the CloudWatch Logs log group to receive access logs.
canarySettings
— (map
)Settings for the canary deployment in this stage.
percentTraffic
— (Float
)The percent (0-100) of traffic diverted to a canary deployment.
deploymentId
— (String
)The ID of the canary deployment.
stageVariableOverrides
— (map<String>
)Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache
— (Boolean
)A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled
— (Boolean
)Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn
— (String
)The ARN of the WebAcl associated with the Stage.
tags
— (map<String>
)The collection of tags. Each tag element is associated with a given resource.
createdDate
— (Date
)The timestamp when the stage was created.
lastUpdatedDate
— (Date
)The timestamp when the stage last updated.
-
(AWS.Response)
—
Returns:
createUsagePlan(params = {}, callback) ⇒ AWS.Request
Creates a usage plan with the throttle and quota limits, as well as the associated API stages, specified in the payload.
Service Reference:
Examples:
Calling the createUsagePlan operation
var params = {
name: 'STRING_VALUE', /* required */
apiStages: [
{
apiId: 'STRING_VALUE',
stage: 'STRING_VALUE',
throttle: {
'<String>': {
burstLimit: 'NUMBER_VALUE',
rateLimit: 'NUMBER_VALUE'
},
/* '<String>': ... */
}
},
/* more items */
],
description: 'STRING_VALUE',
quota: {
limit: 'NUMBER_VALUE',
offset: 'NUMBER_VALUE',
period: DAY | WEEK | MONTH
},
throttle: {
burstLimit: 'NUMBER_VALUE',
rateLimit: 'NUMBER_VALUE'
}
};
apigateway.createUsagePlan(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
name
— (String
)[Required] The name of the usage plan.
description
— (String
)The description of the usage plan.
apiStages
— (Array<map>
)The associated API stages of the usage plan.
apiId
— (String
)API Id of the associated API stage in a usage plan.
stage
— (String
)API stage name of the associated API stage in a usage plan.
throttle
— (map<map>
)Map containing method level throttling information for API stage in a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
throttle
— (map
)The throttling limits of the usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
quota
— (map
)The quota of the usage plan.
limit
— (Integer
)The maximum number of requests that can be made in a given time period.
offset
— (Integer
)The number of requests subtracted from the given limit in the initial time period.
period
— (String
)The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
Possible values include:"DAY"
"WEEK"
"MONTH"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of a UsagePlan resource.
name
— (String
)The name of a usage plan.
description
— (String
)The description of a usage plan.
apiStages
— (Array<map>
)The associated API stages of a usage plan.
apiId
— (String
)API Id of the associated API stage in a usage plan.
stage
— (String
)API stage name of the associated API stage in a usage plan.
throttle
— (map<map>
)Map containing method level throttling information for API stage in a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
throttle
— (map
)The request throttle limits of a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
quota
— (map
)The maximum number of permitted requests per a given unit time interval.
limit
— (Integer
)The maximum number of requests that can be made in a given time period.
offset
— (Integer
)The number of requests subtracted from the given limit in the initial time period.
period
— (String
)The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
Possible values include:"DAY"
"WEEK"
"MONTH"
productCode
— (String
)The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
-
(AWS.Response)
—
Returns:
createUsagePlanKey(params = {}, callback) ⇒ AWS.Request
Creates a usage plan key for adding an existing API key to a usage plan.
Service Reference:
Examples:
Calling the createUsagePlanKey operation
var params = {
keyId: 'STRING_VALUE', /* required */
keyType: 'STRING_VALUE', /* required */
usagePlanId: 'STRING_VALUE' /* required */
};
apigateway.createUsagePlanKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the UsagePlan resource representing the usage plan containing the to-be-created UsagePlanKey resource representing a plan customer.
keyId
— (String
)[Required] The identifier of a UsagePlanKey resource for a plan customer.
keyType
— (String
)[Required] The type of a UsagePlanKey resource for a plan customer.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The Id of a usage plan key.
type
— (String
)The type of a usage plan key. Currently, the valid key type is
API_KEY
.value
— (String
)The value of a usage plan key.
name
— (String
)The name of a usage plan key.
-
(AWS.Response)
—
Returns:
createVpcLink(params = {}, callback) ⇒ AWS.Request
Creates a VPC link, under the caller's account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational. The caller must have permissions to create and update VPC Endpoint services.
Service Reference:
Examples:
Calling the createVpcLink operation
var params = {
name: 'STRING_VALUE', /* required */
targetArns: [ /* required */
'STRING_VALUE',
/* more items */
],
description: 'STRING_VALUE'
};
apigateway.createVpcLink(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
name
— (String
)[Required] The name used to label and identify the VPC link.
description
— (String
)The description of the VPC link.
targetArns
— (Array<String>
)[Required] The ARNs of network load balancers of the VPC targeted by the VPC link. The network load balancers must be owned by the same AWS account of the API owner.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
name
— (String
)The name used to label and identify the VPC link.
description
— (String
)The description of the VPC link.
targetArns
— (Array<String>
)The ARNs of network load balancers of the VPC targeted by the VPC link. The network load balancers must be owned by the same AWS account of the API owner.
status
— (String
)The status of the VPC link. The valid values are
Possible values include:AVAILABLE
,PENDING
,DELETING
, orFAILED
. Deploying an API will wait if the status isPENDING
and will fail if the status isDELETING
."AVAILABLE"
"PENDING"
"DELETING"
"FAILED"
statusMessage
— (String
)A description about the VPC link status.
-
(AWS.Response)
—
Returns:
deleteApiKey(params = {}, callback) ⇒ AWS.Request
Deletes the ApiKey resource.
Service Reference:
Examples:
Calling the deleteApiKey operation
var params = {
apiKey: 'STRING_VALUE' /* required */
};
apigateway.deleteApiKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
apiKey
— (String
)[Required] The identifier of the ApiKey resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteAuthorizer(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the deleteAuthorizer operation
var params = {
authorizerId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteAuthorizer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
authorizerId
— (String
)[Required] The identifier of the Authorizer resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteBasePathMapping(params = {}, callback) ⇒ AWS.Request
Deletes the BasePathMapping resource.
Service Reference:
Examples:
Calling the deleteBasePathMapping operation
var params = {
basePath: 'STRING_VALUE', /* required */
domainName: 'STRING_VALUE' /* required */
};
apigateway.deleteBasePathMapping(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The domain name of the BasePathMapping resource to delete.
basePath
— (String
)[Required] The base path name of the BasePathMapping resource to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteClientCertificate(params = {}, callback) ⇒ AWS.Request
Deletes the ClientCertificate resource.
Service Reference:
Examples:
Calling the deleteClientCertificate operation
var params = {
clientCertificateId: 'STRING_VALUE' /* required */
};
apigateway.deleteClientCertificate(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
clientCertificateId
— (String
)[Required] The identifier of the ClientCertificate resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteDeployment(params = {}, callback) ⇒ AWS.Request
Deletes a Deployment resource. Deleting a deployment will only succeed if there are no Stage resources associated with it.
Service Reference:
Examples:
Calling the deleteDeployment operation
var params = {
deploymentId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteDeployment(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
deploymentId
— (String
)[Required] The identifier of the Deployment resource to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the DeleteDocumentationPart API operation.
Service Reference:
Examples:
Calling the deleteDocumentationPart operation
var params = {
documentationPartId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteDocumentationPart(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
documentationPartId
— (String
)[Required] The identifier of the to-be-deleted documentation part.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the DeleteDocumentationVersion API operation.
Service Reference:
Examples:
Calling the deleteDocumentationVersion operation
var params = {
documentationVersion: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteDocumentationVersion(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
documentationVersion
— (String
)[Required] The version identifier of a to-be-deleted documentation snapshot.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteDomainName(params = {}, callback) ⇒ AWS.Request
Deletes the DomainName resource.
Service Reference:
Examples:
Calling the deleteDomainName operation
var params = {
domainName: 'STRING_VALUE' /* required */
};
apigateway.deleteDomainName(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The name of the DomainName resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteGatewayResponse(params = {}, callback) ⇒ AWS.Request
Clears any customization of a GatewayResponse of a specified response type on the given RestApi and resets it with the default settings.
Service Reference:
Examples:
Calling the deleteGatewayResponse operation
var params = {
responseType: DEFAULT_4XX | DEFAULT_5XX | RESOURCE_NOT_FOUND | UNAUTHORIZED | INVALID_API_KEY | ACCESS_DENIED | AUTHORIZER_FAILURE | AUTHORIZER_CONFIGURATION_ERROR | INVALID_SIGNATURE | EXPIRED_TOKEN | MISSING_AUTHENTICATION_TOKEN | INTEGRATION_FAILURE | INTEGRATION_TIMEOUT | API_CONFIGURATION_ERROR | UNSUPPORTED_MEDIA_TYPE | BAD_REQUEST_PARAMETERS | BAD_REQUEST_BODY | REQUEST_TOO_LARGE | THROTTLED | QUOTA_EXCEEDED, /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteGatewayResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
responseType
— (String
)[Required]
The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteIntegration(params = {}, callback) ⇒ AWS.Request
Represents a delete integration.
Service Reference:
Examples:
Calling the deleteIntegration operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteIntegration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies a delete integration request's resource identifier.
httpMethod
— (String
)[Required] Specifies a delete integration request's HTTP method.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents a delete integration response.
Service Reference:
Examples:
Calling the deleteIntegrationResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE' /* required */
};
apigateway.deleteIntegrationResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies a delete integration response request's resource identifier.
httpMethod
— (String
)[Required] Specifies a delete integration response request's HTTP method.
statusCode
— (String
)[Required] Specifies a delete integration response request's status code.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteMethod(params = {}, callback) ⇒ AWS.Request
Deletes an existing Method resource.
Service Reference:
Examples:
Calling the deleteMethod operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteMethod(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {}) —
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteMethodResponse(params = {}, callback) ⇒ AWS.Request
Deletes an existing MethodResponse resource.
Service Reference:
Examples:
Calling the deleteMethodResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE' /* required */
};
apigateway.deleteMethodResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] The Resource identifier for the MethodResponse resource.
httpMethod
— (String
)[Required] The HTTP verb of the Method resource.
statusCode
— (String
)[Required] The status code identifier for the MethodResponse resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteModel(params = {}, callback) ⇒ AWS.Request
Deletes a model.
Service Reference:
Examples:
Calling the deleteModel operation
var params = {
modelName: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
modelName
— (String
)[Required] The name of the model to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteRequestValidator(params = {}, callback) ⇒ AWS.Request
Deletes a RequestValidator of a given RestApi.
Service Reference:
Examples:
Calling the deleteRequestValidator operation
var params = {
requestValidatorId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteRequestValidator(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
requestValidatorId
— (String
)[Required] The identifier of the RequestValidator to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteResource(params = {}, callback) ⇒ AWS.Request
Deletes a Resource resource.
Service Reference:
Examples:
Calling the deleteResource operation
var params = {
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {}) —
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteRestApi(params = {}, callback) ⇒ AWS.Request
Deletes the specified API.
Service Reference:
Examples:
Calling the deleteRestApi operation
var params = {
restApiId: 'STRING_VALUE' /* required */
};
apigateway.deleteRestApi(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteStage(params = {}, callback) ⇒ AWS.Request
Deletes a Stage resource.
Service Reference:
Examples:
Calling the deleteStage operation
var params = {
restApiId: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE' /* required */
};
apigateway.deleteStage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {}) —
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteUsagePlan(params = {}, callback) ⇒ AWS.Request
Deletes a usage plan of a given plan Id.
Service Reference:
Examples:
Calling the deleteUsagePlan operation
var params = {
usagePlanId: 'STRING_VALUE' /* required */
};
apigateway.deleteUsagePlan(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the to-be-deleted usage plan.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteUsagePlanKey(params = {}, callback) ⇒ AWS.Request
Deletes a usage plan key and remove the underlying API key from the associated usage plan.
Service Reference:
Examples:
Calling the deleteUsagePlanKey operation
var params = {
keyId: 'STRING_VALUE', /* required */
usagePlanId: 'STRING_VALUE' /* required */
};
apigateway.deleteUsagePlanKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the UsagePlan resource representing the usage plan containing the to-be-deleted UsagePlanKey resource representing a plan customer.
keyId
— (String
)[Required] The Id of the UsagePlanKey resource to be deleted.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteVpcLink(params = {}, callback) ⇒ AWS.Request
Deletes an existing VpcLink of a specified identifier.
Service Reference:
Examples:
Calling the deleteVpcLink operation
var params = {
vpcLinkId: 'STRING_VALUE' /* required */
};
apigateway.deleteVpcLink(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
vpcLinkId
— (String
)[Required] The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
flushStageAuthorizersCache(params = {}, callback) ⇒ AWS.Request
Flushes all authorizer cache entries on a stage.
Service Reference:
Examples:
Calling the flushStageAuthorizersCache operation
var params = {
restApiId: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE' /* required */
};
apigateway.flushStageAuthorizersCache(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)The string identifier of the associated RestApi.
stageName
— (String
)The name of the stage to flush.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
flushStageCache(params = {}, callback) ⇒ AWS.Request
Flushes a stage's cache.
Service Reference:
Examples:
Calling the flushStageCache operation
var params = {
restApiId: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE' /* required */
};
apigateway.flushStageCache(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
stageName
— (String
)[Required] The name of the stage to flush its cache.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
generateClientCertificate(params = {}, callback) ⇒ AWS.Request
Generates a ClientCertificate resource.
Service Reference:
Examples:
Calling the generateClientCertificate operation
var params = {
description: 'STRING_VALUE'
};
apigateway.generateClientCertificate(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
description
— (String
)The description of the ClientCertificate.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:clientCertificateId
— (String
)The identifier of the client certificate.
description
— (String
)The description of the client certificate.
pemEncodedCertificate
— (String
)The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
createdDate
— (Date
)The timestamp when the client certificate was created.
expirationDate
— (Date
)The timestamp when the client certificate will expire.
-
(AWS.Response)
—
Returns:
getAccount(params = {}, callback) ⇒ AWS.Request
Gets information about the current Account resource.
Service Reference:
Examples:
Calling the getAccount operation
var params = {
};
apigateway.getAccount(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {})
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:cloudwatchRoleArn
— (String
)The ARN of an Amazon CloudWatch role for the current Account.
throttleSettings
— (map
)Specifies the API request limits configured for the current Account.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
features
— (Array<String>
)A list of features supported for the account. When usage plans are enabled, the features list will include an entry of
"UsagePlans"
.apiKeyVersion
— (String
)The version of the API keys used for the account.
-
(AWS.Response)
—
Returns:
getApiKey(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getApiKey operation
var params = {
apiKey: 'STRING_VALUE', /* required */
includeValue: true || false
};
apigateway.getApiKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
apiKey
— (String
)[Required] The identifier of the ApiKey resource.
includeValue
— (Boolean
)A boolean flag to specify whether (
true
) or not (false
) the result contains the key value.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of the API Key.
value
— (String
)The value of the API Key.
name
— (String
)The name of the API Key.
customerId
— (String
)An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description
— (String
)The description of the API Key.
enabled
— (Boolean
)Specifies whether the API Key can be used by callers.
createdDate
— (Date
)The timestamp when the API Key was created.
lastUpdatedDate
— (Date
)The timestamp when the API Key was last updated.
stageKeys
— (Array<String>
)A list of Stage resources that are associated with the ApiKey resource.
-
(AWS.Response)
—
Returns:
getApiKeys(params = {}, callback) ⇒ AWS.Request
Gets information about the current ApiKeys resource.
Service Reference:
Examples:
Calling the getApiKeys operation
var params = {
customerId: 'STRING_VALUE',
includeValues: true || false,
limit: 'NUMBER_VALUE',
nameQuery: 'STRING_VALUE',
position: 'STRING_VALUE'
};
apigateway.getApiKeys(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
nameQuery
— (String
)The name of queried API keys.
customerId
— (String
)The identifier of a customer in AWS Marketplace or an external system, such as a developer portal.
includeValues
— (Boolean
)A boolean flag to specify whether (
true
) or not (false
) the result contains key values.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:warnings
— (Array<String>
)A list of warning messages logged during the import of API keys when the
failOnWarnings
option is set to true.position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier of the API Key.
value
— (String
)The value of the API Key.
name
— (String
)The name of the API Key.
customerId
— (String
)An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description
— (String
)The description of the API Key.
enabled
— (Boolean
)Specifies whether the API Key can be used by callers.
createdDate
— (Date
)The timestamp when the API Key was created.
lastUpdatedDate
— (Date
)The timestamp when the API Key was last updated.
stageKeys
— (Array<String>
)A list of Stage resources that are associated with the ApiKey resource.
-
(AWS.Response)
—
Returns:
getAuthorizer(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getAuthorizer operation
var params = {
authorizerId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getAuthorizer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
authorizerId
— (String
)[Required] The identifier of the Authorizer resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the authorizer resource.
name
— (String
)[Required] The name of the authorizer.
type
— (String
)The authorizer type. Valid values are
Possible values include:TOKEN
for a Lambda function using a single authorization token submitted in a custom header,REQUEST
for a Lambda function using incoming request parameters, andCOGNITO_USER_POOLS
for using an Amazon Cognito user pool."TOKEN"
"REQUEST"
"COGNITO_USER_POOLS"
providerARNs
— (Array<String>
)A list of the Amazon Cognito user pool ARNs for the
COGNITO_USER_POOLS
authorizer. Each element is of this format:arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For aTOKEN
orREQUEST
authorizer, this is not defined.authType
— (String
)Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri
— (String
)Specifies the authorizer's Uniform Resource Identifier (URI). For
TOKEN
orREQUEST
authorizers, this must be a well-formed Lambda function URI, for example,arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this formarn:aws:apigateway:{region}:lambda:path/{service_api}
, where{region}
is the same as the region hosting the Lambda function,path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial/
. For Lambda functions, this is usually of the form/2015-03-31/functions/[FunctionARN]/invocations
.authorizerCredentials
— (String
)Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource
— (String
)The identity source for which authorization is requested.
- For a
TOKEN
orCOGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name isAuth
, the header mapping expression ismethod.request.header.Auth
. - For the
REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if anAuth
header, aName
query string parameter are defined as identity sources, this value ismethod.request.header.Auth, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of theREQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
- For a
identityValidationExpression
— (String
)A validation expression for the incoming identity token. For
TOKEN
authorizers, this value is a regular expression. API Gateway will match theaud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to theREQUEST
authorizer.authorizerResultTtlInSeconds
— (Integer
)The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
-
(AWS.Response)
—
Returns:
getAuthorizers(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getAuthorizers operation
var params = {
restApiId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getAuthorizers(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier for the authorizer resource.
name
— (String
)[Required] The name of the authorizer.
type
— (String
)The authorizer type. Valid values are
Possible values include:TOKEN
for a Lambda function using a single authorization token submitted in a custom header,REQUEST
for a Lambda function using incoming request parameters, andCOGNITO_USER_POOLS
for using an Amazon Cognito user pool."TOKEN"
"REQUEST"
"COGNITO_USER_POOLS"
providerARNs
— (Array<String>
)A list of the Amazon Cognito user pool ARNs for the
COGNITO_USER_POOLS
authorizer. Each element is of this format:arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For aTOKEN
orREQUEST
authorizer, this is not defined.authType
— (String
)Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri
— (String
)Specifies the authorizer's Uniform Resource Identifier (URI). For
TOKEN
orREQUEST
authorizers, this must be a well-formed Lambda function URI, for example,arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this formarn:aws:apigateway:{region}:lambda:path/{service_api}
, where{region}
is the same as the region hosting the Lambda function,path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial/
. For Lambda functions, this is usually of the form/2015-03-31/functions/[FunctionARN]/invocations
.authorizerCredentials
— (String
)Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource
— (String
)The identity source for which authorization is requested.
- For a
TOKEN
orCOGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name isAuth
, the header mapping expression ismethod.request.header.Auth
. - For the
REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if anAuth
header, aName
query string parameter are defined as identity sources, this value ismethod.request.header.Auth, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of theREQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
- For a
identityValidationExpression
— (String
)A validation expression for the incoming identity token. For
TOKEN
authorizers, this value is a regular expression. API Gateway will match theaud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to theREQUEST
authorizer.authorizerResultTtlInSeconds
— (Integer
)The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
-
(AWS.Response)
—
Returns:
getBasePathMapping(params = {}, callback) ⇒ AWS.Request
Describe a BasePathMapping resource.
Service Reference:
Examples:
Calling the getBasePathMapping operation
var params = {
basePath: 'STRING_VALUE', /* required */
domainName: 'STRING_VALUE' /* required */
};
apigateway.getBasePathMapping(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The domain name of the BasePathMapping resource to be described.
basePath
— (String
)[Required] The base path name that callers of the API must provide as part of the URL after the domain name. This value must be unique for all of the mappings across a single API. Leave this blank if you do not want callers to specify any base path name after the domain name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:basePath
— (String
)The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId
— (String
)The string identifier of the associated RestApi.
stage
— (String
)The name of the associated stage.
-
(AWS.Response)
—
Returns:
getBasePathMappings(params = {}, callback) ⇒ AWS.Request
Represents a collection of BasePathMapping resources.
Service Reference:
Examples:
Calling the getBasePathMappings operation
var params = {
domainName: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getBasePathMappings(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The domain name of a BasePathMapping resource.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
basePath
— (String
)The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId
— (String
)The string identifier of the associated RestApi.
stage
— (String
)The name of the associated stage.
-
(AWS.Response)
—
Returns:
getClientCertificate(params = {}, callback) ⇒ AWS.Request
Gets information about the current ClientCertificate resource.
Service Reference:
Examples:
Calling the getClientCertificate operation
var params = {
clientCertificateId: 'STRING_VALUE' /* required */
};
apigateway.getClientCertificate(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
clientCertificateId
— (String
)[Required] The identifier of the ClientCertificate resource to be described.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:clientCertificateId
— (String
)The identifier of the client certificate.
description
— (String
)The description of the client certificate.
pemEncodedCertificate
— (String
)The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
createdDate
— (Date
)The timestamp when the client certificate was created.
expirationDate
— (Date
)The timestamp when the client certificate will expire.
-
(AWS.Response)
—
Returns:
getClientCertificates(params = {}, callback) ⇒ AWS.Request
Gets a collection of ClientCertificate resources.
Service Reference:
Examples:
Calling the getClientCertificates operation
var params = {
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getClientCertificates(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
clientCertificateId
— (String
)The identifier of the client certificate.
description
— (String
)The description of the client certificate.
pemEncodedCertificate
— (String
)The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
createdDate
— (Date
)The timestamp when the client certificate was created.
expirationDate
— (Date
)The timestamp when the client certificate will expire.
-
(AWS.Response)
—
Returns:
getDeployment(params = {}, callback) ⇒ AWS.Request
Gets information about a Deployment resource.
Service Reference:
Examples:
Calling the getDeployment operation
var params = {
deploymentId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
embed: [
'STRING_VALUE',
/* more items */
]
};
apigateway.getDeployment(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
deploymentId
— (String
)[Required] The identifier of the Deployment resource to get information about.
embed
— (Array<String>
)A query parameter to retrieve the specified embedded resources of the returned Deployment resource in the response. In a REST API call, this
embed
parameter value is a list of comma-separated strings, as inGET /restapis/{restapi_id}/deployments/{deployment_id}?embed=var1,var2
. The SDK and other platform-dependent libraries might use a different format for the list. Currently, this request supports only retrieval of the embedded API summary this way. Hence, the parameter value must be a single-valued list containing only the"apisummary"
string. For example,GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=apisummary
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the deployment resource.
description
— (String
)The description for the deployment resource.
createdDate
— (Date
)The date and time that the deployment resource was created.
apiSummary
— (map<map<map>>
)A summary of the RestApi at the date and time that the deployment resource was created.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.apiKeyRequired
— (Boolean
)Specifies whether the method requires a valid ApiKey.
-
(AWS.Response)
—
Returns:
getDeployments(params = {}, callback) ⇒ AWS.Request
Gets information about a Deployments collection.
Service Reference:
Examples:
Calling the getDeployments operation
var params = {
restApiId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getDeployments(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier for the deployment resource.
description
— (String
)The description for the deployment resource.
createdDate
— (Date
)The date and time that the deployment resource was created.
apiSummary
— (map<map<map>>
)A summary of the RestApi at the date and time that the deployment resource was created.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.apiKeyRequired
— (Boolean
)Specifies whether the method requires a valid ApiKey.
-
(AWS.Response)
—
Returns:
getDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationPart API operation.
Service Reference:
Examples:
Calling the getDocumentationPart operation
var params = {
documentationPartId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getDocumentationPart(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {}) —
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The DocumentationPart identifier, generated by API Gateway when the
DocumentationPart
is created.location
— (map
)The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type
— required — (String
)[Required] The type of API entity to which the documentation content applies. Valid values are
Possible values include:API
,AUTHORIZER
,MODEL
,RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. Content inheritance does not apply to any entity of theAPI
,AUTHORIZER
,METHOD
,MODEL
,REQUEST_BODY
, orRESOURCE
type."API"
"AUTHORIZER"
"MODEL"
"RESOURCE"
"METHOD"
"PATH_PARAMETER"
"QUERY_PARAMETER"
"REQUEST_HEADER"
"REQUEST_BODY"
"RESPONSE"
"RESPONSE_HEADER"
"RESPONSE_BODY"
path
— (String
)The URL path of the target. It is a valid field for the API entity types of
RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is/
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the otherlocation
attributes, the child entity'spath
attribute must match that of the parent entity as a prefix.method
— (String
)The HTTP verb of a method. It is a valid field for the API entity types of
METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'smethod
attribute must match that of the parent entity exactly.statusCode
— (String
)The HTTP status code of a response. It is a valid field for the API entity types of
RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'sstatusCode
attribute must match that of the parent entity exactly.name
— (String
)The name of the targeted API entity. It is a valid and required field for the API entity types of
AUTHORIZER
,MODEL
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
andRESPONSE_HEADER
. It is an invalid field for any other entity type.
properties
— (String
)A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g.,
"{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from theproperties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension ofx-amazon-apigateway-documentation
.
-
(AWS.Response)
—
Returns:
getDocumentationParts(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationParts API operation.
Service Reference:
Examples:
Calling the getDocumentationParts operation
var params = {
restApiId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
locationStatus: DOCUMENTED | UNDOCUMENTED,
nameQuery: 'STRING_VALUE',
path: 'STRING_VALUE',
position: 'STRING_VALUE',
type: API | AUTHORIZER | MODEL | RESOURCE | METHOD | PATH_PARAMETER | QUERY_PARAMETER | REQUEST_HEADER | REQUEST_BODY | RESPONSE | RESPONSE_HEADER | RESPONSE_BODY
};
apigateway.getDocumentationParts(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
type
— (String
)The type of API entities of the to-be-retrieved documentation parts.
Possible values include:"API"
"AUTHORIZER"
"MODEL"
"RESOURCE"
"METHOD"
"PATH_PARAMETER"
"QUERY_PARAMETER"
"REQUEST_HEADER"
"REQUEST_BODY"
"RESPONSE"
"RESPONSE_HEADER"
"RESPONSE_BODY"
nameQuery
— (String
)The name of API entities of the to-be-retrieved documentation parts.
path
— (String
)The path of API entities of the to-be-retrieved documentation parts.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
locationStatus
— (String
)The status of the API documentation parts to retrieve. Valid values are
Possible values include:DOCUMENTED
for retrieving DocumentationPart resources with content andUNDOCUMENTED
for DocumentationPart resources without content."DOCUMENTED"
"UNDOCUMENTED"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The DocumentationPart identifier, generated by API Gateway when the
DocumentationPart
is created.location
— (map
)The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type
— required — (String
)[Required] The type of API entity to which the documentation content applies. Valid values are
Possible values include:API
,AUTHORIZER
,MODEL
,RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. Content inheritance does not apply to any entity of theAPI
,AUTHORIZER
,METHOD
,MODEL
,REQUEST_BODY
, orRESOURCE
type."API"
"AUTHORIZER"
"MODEL"
"RESOURCE"
"METHOD"
"PATH_PARAMETER"
"QUERY_PARAMETER"
"REQUEST_HEADER"
"REQUEST_BODY"
"RESPONSE"
"RESPONSE_HEADER"
"RESPONSE_BODY"
path
— (String
)The URL path of the target. It is a valid field for the API entity types of
RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is/
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the otherlocation
attributes, the child entity'spath
attribute must match that of the parent entity as a prefix.method
— (String
)The HTTP verb of a method. It is a valid field for the API entity types of
METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'smethod
attribute must match that of the parent entity exactly.statusCode
— (String
)The HTTP status code of a response. It is a valid field for the API entity types of
RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'sstatusCode
attribute must match that of the parent entity exactly.name
— (String
)The name of the targeted API entity. It is a valid and required field for the API entity types of
AUTHORIZER
,MODEL
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
andRESPONSE_HEADER
. It is an invalid field for any other entity type.
properties
— (String
)A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g.,
"{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from theproperties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension ofx-amazon-apigateway-documentation
.
-
(AWS.Response)
—
Returns:
getDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationVersion API operation.
Service Reference:
Examples:
Calling the getDocumentationVersion operation
var params = {
documentationVersion: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getDocumentationVersion(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
documentationVersion
— (String
)[Required] The version identifier of the to-be-retrieved documentation snapshot.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:version
— (String
)The version identifier of the API documentation snapshot.
createdDate
— (Date
)The date when the API documentation snapshot is created.
description
— (String
)The description of the API documentation snapshot.
-
(AWS.Response)
—
Returns:
getDocumentationVersions(params = {}, callback) ⇒ AWS.Request
Calls the GetDocumentationVersions API operation.
Service Reference:
Examples:
Calling the getDocumentationVersions operation
var params = {
restApiId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getDocumentationVersions(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
version
— (String
)The version identifier of the API documentation snapshot.
createdDate
— (Date
)The date when the API documentation snapshot is created.
description
— (String
)The description of the API documentation snapshot.
-
(AWS.Response)
—
Returns:
getDomainName(params = {}, callback) ⇒ AWS.Request
Represents a domain name that is contained in a simpler, more intuitive URL that can be called.
Service Reference:
Examples:
Calling the getDomainName operation
var params = {
domainName: 'STRING_VALUE' /* required */
};
apigateway.getDomainName(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The name of the DomainName resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:domainName
— (String
)The custom domain name as an API host name, for example,
my-api.example.com
.certificateName
— (String
)The name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateArn
— (String
)The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
certificateUploadDate
— (Date
)The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
regionalDomainName
— (String
)The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regionalHostedZoneId
— (String
)The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
regionalCertificateName
— (String
)The name of the certificate that will be used for validating the regional domain name.
regionalCertificateArn
— (String
)The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
distributionDomainName
— (String
)The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
distributionHostedZoneId
— (String
)The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.endpointConfiguration
— (map
)The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
-
(AWS.Response)
—
Returns:
getDomainNames(params = {}, callback) ⇒ AWS.Request
Represents a collection of DomainName resources.
Service Reference:
Examples:
Calling the getDomainNames operation
var params = {
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getDomainNames(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
domainName
— (String
)The custom domain name as an API host name, for example,
my-api.example.com
.certificateName
— (String
)The name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateArn
— (String
)The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
certificateUploadDate
— (Date
)The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
regionalDomainName
— (String
)The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regionalHostedZoneId
— (String
)The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
regionalCertificateName
— (String
)The name of the certificate that will be used for validating the regional domain name.
regionalCertificateArn
— (String
)The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
distributionDomainName
— (String
)The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
distributionHostedZoneId
— (String
)The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.endpointConfiguration
— (map
)The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
-
(AWS.Response)
—
Returns:
getExport(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getExport operation
var params = {
exportType: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE', /* required */
accepts: 'STRING_VALUE',
parameters: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.getExport(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
stageName
— (String
)[Required] The name of the Stage that will be exported.
exportType
— (String
)[Required] The type of export. Acceptable values are 'oas30' for OpenAPI 3.0.x and 'swagger' for Swagger/OpenAPI 2.0.
parameters
— (map<String>
)A key-value map of query string parameters that specify properties of the export, depending on the requested
exportType
. ForexportType
oas30
andswagger
, any combination of the following parameters are supported:extensions='integrations'
orextensions='apigateway'
will export the API with x-amazon-apigateway-integration extensions.extensions='authorizers'
will export the API with x-amazon-apigateway-authorizer extensions.postman
will export the API with Postman extensions, allowing for import to the Postman toolaccepts
— (String
)The content-type of the export, for example
application/json
. Currentlyapplication/json
andapplication/yaml
are supported forexportType
ofoas30
andswagger
. This should be specified in theAccept
header for direct API requests.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:contentType
— (String
)The content-type header value in the HTTP response. This will correspond to a valid 'accept' type in the request.
contentDisposition
— (String
)The content-disposition header value in the HTTP response.
body
— (Buffer(Node.js), Typed Array(Browser)
)The binary blob response to GetExport, which contains the export.
-
(AWS.Response)
—
Returns:
getGatewayResponse(params = {}, callback) ⇒ AWS.Request
Gets a GatewayResponse of a specified response type on the given RestApi.
Service Reference:
Examples:
Calling the getGatewayResponse operation
var params = {
responseType: DEFAULT_4XX | DEFAULT_5XX | RESOURCE_NOT_FOUND | UNAUTHORIZED | INVALID_API_KEY | ACCESS_DENIED | AUTHORIZER_FAILURE | AUTHORIZER_CONFIGURATION_ERROR | INVALID_SIGNATURE | EXPIRED_TOKEN | MISSING_AUTHENTICATION_TOKEN | INTEGRATION_FAILURE | INTEGRATION_TIMEOUT | API_CONFIGURATION_ERROR | UNSUPPORTED_MEDIA_TYPE | BAD_REQUEST_PARAMETERS | BAD_REQUEST_BODY | REQUEST_TOO_LARGE | THROTTLED | QUOTA_EXCEEDED, /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getGatewayResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
responseType
— (String
)[Required]
The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:responseType
— (String
)The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
statusCode
— (String
)The HTTP status code for this GatewayResponse.
responseParameters
— (map<String>
)Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates
— (map<String>
)Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse
— (Boolean
)A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
-
(AWS.Response)
—
Returns:
getGatewayResponses(params = {}, callback) ⇒ AWS.Request
Gets the GatewayResponses collection on the given RestApi. If an API developer has not added any definitions for gateway responses, the result will be the API Gateway-generated default GatewayResponses collection for the supported response types.
Service Reference:
Examples:
Calling the getGatewayResponses operation
var params = {
restApiId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getGatewayResponses(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
position
— (String
)The current pagination position in the paged result set. The GatewayResponse collection does not support pagination and the position does not apply here.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500. The GatewayResponses collection does not support pagination and the limit does not apply here.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)Returns the entire collection, because of no pagination support.
responseType
— (String
)The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
statusCode
— (String
)The HTTP status code for this GatewayResponse.
responseParameters
— (map<String>
)Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates
— (map<String>
)Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse
— (Boolean
)A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
-
(AWS.Response)
—
Returns:
getIntegration(params = {}, callback) ⇒ AWS.Request
Get the integration settings.
Service Reference:
Examples:
Calling the getIntegration operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getIntegration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies a get integration request's resource identifier
httpMethod
— (String
)[Required] Specifies a get integration request's HTTP method.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
-
(AWS.Response)
—
Returns:
getIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents a get integration response.
Service Reference:
Examples:
Calling the getIntegrationResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE' /* required */
};
apigateway.getIntegrationResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies a get integration response request's resource identifier.
httpMethod
— (String
)[Required] Specifies a get integration response request's HTTP method.
statusCode
— (String
)[Required] Specifies a get integration response request's status code.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
-
(AWS.Response)
—
Returns:
getMethod(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getMethod operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getMethod(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {}) —
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:httpMethod
— (String
)The method's HTTP verb.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)The identifier of an Authorizer to use on this method. The
authorizationType
must beCUSTOM
.apiKeyRequired
— (Boolean
)A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId
— (String
)The identifier of a RequestValidator for request validation.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.requestModels
— (map<String>
)A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses
— (map<map>
)Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
Example: Get a 200 OK response of a GET method
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" }
statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration
— (map
)Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
Example:
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } }
type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
-
(AWS.Response)
—
Returns:
getMethodResponse(params = {}, callback) ⇒ AWS.Request
Describes a MethodResponse resource.
Service Reference:
Examples:
Calling the getMethodResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE' /* required */
};
apigateway.getMethodResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] The Resource identifier for the MethodResponse resource.
httpMethod
— (String
)[Required] The HTTP verb of the Method resource.
statusCode
— (String
)[Required] The status code for the MethodResponse resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
-
(AWS.Response)
—
Returns:
getModel(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getModel operation
var params = {
modelName: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
flatten: true || false
};
apigateway.getModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The RestApi identifier under which the Model exists.
modelName
— (String
)[Required] The name of the model as an identifier.
flatten
— (Boolean
)A query parameter of a Boolean value to resolve (
true
) all external model references and returns a flattened model schema or not (false
) The default isfalse
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the model resource.
name
— (String
)The name of the model. Must be an alphanumeric string.
description
— (String
)The description of the model.
schema
— (String
)The schema for the model. For
application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.contentType
— (String
)The content-type for the model.
-
(AWS.Response)
—
Returns:
getModels(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getModels operation
var params = {
restApiId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getModels(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier for the model resource.
name
— (String
)The name of the model. Must be an alphanumeric string.
description
— (String
)The description of the model.
schema
— (String
)The schema for the model. For
application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.contentType
— (String
)The content-type for the model.
-
(AWS.Response)
—
Returns:
getModelTemplate(params = {}, callback) ⇒ AWS.Request
Generates a sample mapping template that can be used to transform a payload into the structure of a model.
Service Reference:
Examples:
Calling the getModelTemplate operation
var params = {
modelName: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getModelTemplate(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
modelName
— (String
)[Required] The name of the model for which to generate a template.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:value
— (String
)The Apache Velocity Template Language (VTL) template content used for the template resource.
-
(AWS.Response)
—
Returns:
getRequestValidator(params = {}, callback) ⇒ AWS.Request
Gets a RequestValidator of a given RestApi.
Service Reference:
Examples:
Calling the getRequestValidator operation
var params = {
requestValidatorId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getRequestValidator(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
requestValidatorId
— (String
)[Required] The identifier of the RequestValidator to be retrieved.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of this RequestValidator.
name
— (String
)The name of this RequestValidator
validateRequestBody
— (Boolean
)A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters
— (Boolean
)A Boolean flag to indicate whether to validate request parameters (
true
) or not (false
).
-
(AWS.Response)
—
Returns:
getRequestValidators(params = {}, callback) ⇒ AWS.Request
Gets the RequestValidators collection of a given RestApi.
Service Reference:
Examples:
Calling the getRequestValidators operation
var params = {
restApiId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getRequestValidators(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier of this RequestValidator.
name
— (String
)The name of this RequestValidator
validateRequestBody
— (Boolean
)A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters
— (Boolean
)A Boolean flag to indicate whether to validate request parameters (
true
) or not (false
).
-
(AWS.Response)
—
Returns:
getResource(params = {}, callback) ⇒ AWS.Request
Lists information about a resource.
Service Reference:
Examples:
Calling the getResource operation
var params = {
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
embed: [
'STRING_VALUE',
/* more items */
]
};
apigateway.getResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] The identifier for the Resource resource.
embed
— (Array<String>
)A query parameter to retrieve the specified resources embedded in the returned Resource representation 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/{resource_id}?embed=methods
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The resource's identifier.
parentId
— (String
)The parent resource's identifier.
pathPart
— (String
)The last path segment for this resource.
path
— (String
)The full path for this resource.
resourceMethods
— (map<map>
)Gets an API resource's method of a given HTTP verb.
The resource methods are a map of methods indexed by methods' HTTP verbs enabled on the resource. This method map is included in the
200 OK
response of theGET /restapis/{restapi_id}/resources/{resource_id}
orGET /restapis/{restapi_id}/resources/{resource_id}?embed=methods
request.Example: Get the GET method of an API resource
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20170223T031827Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20170223/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html", "name": "method", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true } ], "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET", "name": "GET", "title": "GET" }, "integration:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "method:integration": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "method:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "methodresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/{status_code}", "templated": true } }, "apiKeyRequired": false, "authorizationType": "NONE", "httpMethod": "GET", "_embedded": { "method:integration": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "3kzxbg5sa2", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestParameters": { "integration.request.header.Content-Type": "'application/x-amz-json-1.1'" }, "requestTemplates": { "application/json": "{\n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-east-1:kinesis:action/ListStreams", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" } } }, "method:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.Content-Type": false }, "statusCode": "200" } } }
If the
OPTIONS
is enabled on the resource, you can follow the example here to get that method. Just replace theGET
of the last path segment in the request URL withOPTIONS
.httpMethod
— (String
)The method's HTTP verb.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)The identifier of an Authorizer to use on this method. The
authorizationType
must beCUSTOM
.apiKeyRequired
— (Boolean
)A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId
— (String
)The identifier of a RequestValidator for request validation.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.requestModels
— (map<String>
)A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses
— (map<map>
)Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
Example: Get a 200 OK response of a GET method
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" }
statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration
— (map
)Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
Example:
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } }
type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
-
(AWS.Response)
—
Returns:
getResources(params = {}, callback) ⇒ AWS.Request
Lists information about a collection of Resource resources.
Service Reference:
Examples:
Calling the getResources operation
var params = {
restApiId: 'STRING_VALUE', /* required */
embed: [
'STRING_VALUE',
/* more items */
],
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getResources(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
embed
— (Array<String>
)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
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The resource's identifier.
parentId
— (String
)The parent resource's identifier.
pathPart
— (String
)The last path segment for this resource.
path
— (String
)The full path for this resource.
resourceMethods
— (map<map>
)Gets an API resource's method of a given HTTP verb.
The resource methods are a map of methods indexed by methods' HTTP verbs enabled on the resource. This method map is included in the
200 OK
response of theGET /restapis/{restapi_id}/resources/{resource_id}
orGET /restapis/{restapi_id}/resources/{resource_id}?embed=methods
request.Example: Get the GET method of an API resource
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20170223T031827Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20170223/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html", "name": "method", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true } ], "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET", "name": "GET", "title": "GET" }, "integration:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "method:integration": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "method:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "methodresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/{status_code}", "templated": true } }, "apiKeyRequired": false, "authorizationType": "NONE", "httpMethod": "GET", "_embedded": { "method:integration": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "3kzxbg5sa2", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestParameters": { "integration.request.header.Content-Type": "'application/x-amz-json-1.1'" }, "requestTemplates": { "application/json": "{\n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-east-1:kinesis:action/ListStreams", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" } } }, "method:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.Content-Type": false }, "statusCode": "200" } } }
If the
OPTIONS
is enabled on the resource, you can follow the example here to get that method. Just replace theGET
of the last path segment in the request URL withOPTIONS
.httpMethod
— (String
)The method's HTTP verb.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)The identifier of an Authorizer to use on this method. The
authorizationType
must beCUSTOM
.apiKeyRequired
— (Boolean
)A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId
— (String
)The identifier of a RequestValidator for request validation.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.requestModels
— (map<String>
)A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses
— (map<map>
)Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
Example: Get a 200 OK response of a GET method
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" }
statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration
— (map
)Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
Example:
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } }
type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
-
(AWS.Response)
—
Returns:
getRestApi(params = {}, callback) ⇒ AWS.Request
Lists the RestApi resource in the collection.
Service Reference:
Examples:
Calling the getRestApi operation
var params = {
restApiId: 'STRING_VALUE' /* required */
};
apigateway.getRestApi(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name
— (String
)The API's name.
description
— (String
)The API's description.
createdDate
— (Date
)The timestamp when the API was created.
version
— (String
)A version identifier for the API.
warnings
— (Array<String>
)The warning messages reported when
failonwarnings
is turned on during API import.binaryMediaTypes
— (Array<String>
)The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize
— (Integer
)A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource
— (String
)The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.
"HEADER"
"AUTHORIZER"
endpointConfiguration
— (map
)The endpoint configuration of this RestApi showing the endpoint types of the API.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
policy
— (String
) A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
-
(AWS.Response)
—
Returns:
getRestApis(params = {}, callback) ⇒ AWS.Request
Lists the RestApis resources for your collection.
Service Reference:
Examples:
Calling the getRestApis operation
var params = {
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getRestApis(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name
— (String
)The API's name.
description
— (String
)The API's description.
createdDate
— (Date
)The timestamp when the API was created.
version
— (String
)A version identifier for the API.
warnings
— (Array<String>
)The warning messages reported when
failonwarnings
is turned on during API import.binaryMediaTypes
— (Array<String>
)The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize
— (Integer
)A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource
— (String
)The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.
"HEADER"
"AUTHORIZER"
endpointConfiguration
— (map
)The endpoint configuration of this RestApi showing the endpoint types of the API.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
policy
— (String
) A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
-
(AWS.Response)
—
Returns:
getSdk(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getSdk operation
var params = {
restApiId: 'STRING_VALUE', /* required */
sdkType: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE', /* required */
parameters: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.getSdk(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
stageName
— (String
)[Required] The name of the Stage that the SDK will use.
sdkType
— (String
)[Required] The language for the generated SDK. Currently
java
,javascript
,android
,objectivec
(for iOS),swift
(for iOS), andruby
are supported.parameters
— (map<String>
)A string-to-string key-value map of query parameters
sdkType
-dependent properties of the SDK. ForsdkType
ofobjectivec
orswift
, a parameter namedclassPrefix
is required. ForsdkType
ofandroid
, parameters namedgroupId
,artifactId
,artifactVersion
, andinvokerPackage
are required. ForsdkType
ofjava
, parameters namedserviceName
andjavaPackageName
are required.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:contentType
— (String
)The content-type header value in the HTTP response.
contentDisposition
— (String
)The content-disposition header value in the HTTP response.
body
— (Buffer(Node.js), Typed Array(Browser)
)The binary blob response to GetSdk, which contains the generated SDK.
-
(AWS.Response)
—
Returns:
getSdkType(params = {}, callback) ⇒ AWS.Request
Calls the GetSdkType API operation.
Service Reference:
Examples:
Calling the getSdkType operation
var params = {
id: 'STRING_VALUE' /* required */
};
apigateway.getSdkType(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
id
— (String
)[Required] The identifier of the queried SdkType instance.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of an SdkType instance.
friendlyName
— (String
)The user-friendly name of an SdkType instance.
description
— (String
)The description of an SdkType.
configurationProperties
— (Array<map>
)A list of configuration properties of an SdkType.
name
— (String
)The name of a an SdkType configuration property.
friendlyName
— (String
)The user-friendly name of an SdkType configuration property.
description
— (String
)The description of an SdkType configuration property.
required
— (Boolean
)A boolean flag of an SdkType configuration property to indicate if the associated SDK configuration property is required (
true
) or not (false
).defaultValue
— (String
)The default value of an SdkType configuration property.
-
(AWS.Response)
—
Returns:
getSdkTypes(params = {}, callback) ⇒ AWS.Request
Calls the GetSdkTypes API operation.
Service Reference:
Examples:
Calling the getSdkTypes operation
var params = {
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getSdkTypes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier of an SdkType instance.
friendlyName
— (String
)The user-friendly name of an SdkType instance.
description
— (String
)The description of an SdkType.
configurationProperties
— (Array<map>
)A list of configuration properties of an SdkType.
name
— (String
)The name of a an SdkType configuration property.
friendlyName
— (String
)The user-friendly name of an SdkType configuration property.
description
— (String
)The description of an SdkType configuration property.
required
— (Boolean
)A boolean flag of an SdkType configuration property to indicate if the associated SDK configuration property is required (
true
) or not (false
).defaultValue
— (String
)The default value of an SdkType configuration property.
-
(AWS.Response)
—
Returns:
getStage(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getStage operation
var params = {
restApiId: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE' /* required */
};
apigateway.getStage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
- params (Object) (defaults to: {}) —
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:deploymentId
— (String
)The identifier of the Deployment that the stage points to.
clientCertificateId
— (String
)The identifier of a client certificate for an API stage.
stageName
— (String
)The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway.
description
— (String
)The stage's description.
cacheClusterEnabled
— (Boolean
)Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize
— (String
)The size of the cache cluster for the stage, if enabled.
Possible values include:"0.5"
"1.6"
"6.1"
"13.5"
"28.4"
"58.2"
"118"
"237"
cacheClusterStatus
— (String
)The status of the cache cluster for the stage, if enabled.
Possible values include:"CREATE_IN_PROGRESS"
"AVAILABLE"
"DELETE_IN_PROGRESS"
"NOT_AVAILABLE"
"FLUSH_IN_PROGRESS"
methodSettings
— (map<map>
)A map that defines the method settings for a Stage resource. Keys (designated as
/{method_setting_key
below) are method paths defined as{resource_path}/{http_method}
for an individual method override, or/*/*
for overriding all methods in the stage.metricsEnabled
— (Boolean
)Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is
/{method_setting_key}/metrics/enabled
, and the value is a Boolean.loggingLevel
— (String
)Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/loglevel
, and the available levels areOFF
,ERROR
, andINFO
.dataTraceEnabled
— (Boolean
)Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/dataTrace
, and the value is a Boolean.throttlingBurstLimit
— (Integer
)Specifies the throttling burst limit. The PATCH path for this setting is
/{method_setting_key}/throttling/burstLimit
, and the value is an integer.throttlingRateLimit
— (Float
)Specifies the throttling rate limit. The PATCH path for this setting is
/{method_setting_key}/throttling/rateLimit
, and the value is a double.cachingEnabled
— (Boolean
)Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is
/{method_setting_key}/caching/enabled
, and the value is a Boolean.cacheTtlInSeconds
— (Integer
)Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is
/{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.cacheDataEncrypted
— (Boolean
)Specifies whether the cached responses are encrypted. The PATCH path for this setting is
/{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.requireAuthorizationForCacheControl
— (Boolean
)Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is
/{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.unauthorizedCacheControlHeaderStrategy
— (String
)Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is
Possible values include:/{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values areFAIL_WITH_403
,SUCCEED_WITH_RESPONSE_HEADER
,SUCCEED_WITHOUT_RESPONSE_HEADER
."FAIL_WITH_403"
"SUCCEED_WITH_RESPONSE_HEADER"
"SUCCEED_WITHOUT_RESPONSE_HEADER"
variables
— (map<String>
)A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match
[A-Za-z0-9-._~:/?#&=,]+
.documentationVersion
— (String
)The version of the associated API documentation.
accessLogSettings
— (map
)Settings for logging access in this stage.
format
— (String
)A single line format of the access logs of data, as specified by selected $context variables. The format must include at least
$context.requestId
.destinationArn
— (String
)The ARN of the CloudWatch Logs log group to receive access logs.
canarySettings
— (map
)Settings for the canary deployment in this stage.
percentTraffic
— (Float
)The percent (0-100) of traffic diverted to a canary deployment.
deploymentId
— (String
)The ID of the canary deployment.
stageVariableOverrides
— (map<String>
)Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache
— (Boolean
)A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled
— (Boolean
)Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn
— (String
)The ARN of the WebAcl associated with the Stage.
tags
— (map<String>
)The collection of tags. Each tag element is associated with a given resource.
createdDate
— (Date
)The timestamp when the stage was created.
lastUpdatedDate
— (Date
)The timestamp when the stage last updated.
-
(AWS.Response)
—
Returns:
getStages(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getStages operation
var params = {
restApiId: 'STRING_VALUE', /* required */
deploymentId: 'STRING_VALUE'
};
apigateway.getStages(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
deploymentId
— (String
)The stages' deployment identifiers.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:item
— (Array<map>
)The current page of elements from this collection.
deploymentId
— (String
)The identifier of the Deployment that the stage points to.
clientCertificateId
— (String
)The identifier of a client certificate for an API stage.
stageName
— (String
)The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway.
description
— (String
)The stage's description.
cacheClusterEnabled
— (Boolean
)Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize
— (String
)The size of the cache cluster for the stage, if enabled.
Possible values include:"0.5"
"1.6"
"6.1"
"13.5"
"28.4"
"58.2"
"118"
"237"
cacheClusterStatus
— (String
)The status of the cache cluster for the stage, if enabled.
Possible values include:"CREATE_IN_PROGRESS"
"AVAILABLE"
"DELETE_IN_PROGRESS"
"NOT_AVAILABLE"
"FLUSH_IN_PROGRESS"
methodSettings
— (map<map>
)A map that defines the method settings for a Stage resource. Keys (designated as
/{method_setting_key
below) are method paths defined as{resource_path}/{http_method}
for an individual method override, or/*/*
for overriding all methods in the stage.metricsEnabled
— (Boolean
)Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is
/{method_setting_key}/metrics/enabled
, and the value is a Boolean.loggingLevel
— (String
)Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/loglevel
, and the available levels areOFF
,ERROR
, andINFO
.dataTraceEnabled
— (Boolean
)Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/dataTrace
, and the value is a Boolean.throttlingBurstLimit
— (Integer
)Specifies the throttling burst limit. The PATCH path for this setting is
/{method_setting_key}/throttling/burstLimit
, and the value is an integer.throttlingRateLimit
— (Float
)Specifies the throttling rate limit. The PATCH path for this setting is
/{method_setting_key}/throttling/rateLimit
, and the value is a double.cachingEnabled
— (Boolean
)Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is
/{method_setting_key}/caching/enabled
, and the value is a Boolean.cacheTtlInSeconds
— (Integer
)Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is
/{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.cacheDataEncrypted
— (Boolean
)Specifies whether the cached responses are encrypted. The PATCH path for this setting is
/{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.requireAuthorizationForCacheControl
— (Boolean
)Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is
/{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.unauthorizedCacheControlHeaderStrategy
— (String
)Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is
Possible values include:/{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values areFAIL_WITH_403
,SUCCEED_WITH_RESPONSE_HEADER
,SUCCEED_WITHOUT_RESPONSE_HEADER
."FAIL_WITH_403"
"SUCCEED_WITH_RESPONSE_HEADER"
"SUCCEED_WITHOUT_RESPONSE_HEADER"
variables
— (map<String>
)A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match
[A-Za-z0-9-._~:/?#&=,]+
.documentationVersion
— (String
)The version of the associated API documentation.
accessLogSettings
— (map
)Settings for logging access in this stage.
format
— (String
)A single line format of the access logs of data, as specified by selected $context variables. The format must include at least
$context.requestId
.destinationArn
— (String
)The ARN of the CloudWatch Logs log group to receive access logs.
canarySettings
— (map
)Settings for the canary deployment in this stage.
percentTraffic
— (Float
)The percent (0-100) of traffic diverted to a canary deployment.
deploymentId
— (String
)The ID of the canary deployment.
stageVariableOverrides
— (map<String>
)Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache
— (Boolean
)A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled
— (Boolean
)Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn
— (String
)The ARN of the WebAcl associated with the Stage.
tags
— (map<String>
)The collection of tags. Each tag element is associated with a given resource.
createdDate
— (Date
)The timestamp when the stage was created.
lastUpdatedDate
— (Date
)The timestamp when the stage last updated.
-
(AWS.Response)
—
Returns:
getTags(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getTags operation
var params = {
resourceArn: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getTags(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)[Required] The ARN of a resource that can be tagged. The resource ARN must be URL-encoded. At present, Stage is the only taggable resource.
position
— (String
)(Not currently supported) The current pagination position in the paged result set.
limit
— (Integer
)(Not currently supported) The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:tags
— (map<String>
)The collection of tags. Each tag element is associated with a given resource.
-
(AWS.Response)
—
Returns:
getUsage(params = {}, callback) ⇒ AWS.Request
Gets the usage data of a usage plan in a specified time interval.
Service Reference:
Examples:
Calling the getUsage operation
var params = {
endDate: 'STRING_VALUE', /* required */
startDate: 'STRING_VALUE', /* required */
usagePlanId: 'STRING_VALUE', /* required */
keyId: 'STRING_VALUE',
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getUsage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the usage plan associated with the usage data.
keyId
— (String
)The Id of the API key associated with the resultant usage data.
startDate
— (String
)[Required] The starting date (e.g., 2016-01-01) of the usage data.
endDate
— (String
)[Required] The ending date (e.g., 2016-12-31) of the usage data.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:usagePlanId
— (String
)The plan Id associated with this usage data.
startDate
— (String
)The starting date of the usage data.
endDate
— (String
)The ending date of the usage data.
position
— (String
)items
— (map<Array<Array<Integer>>>
)The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example,
{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}
, where{api_key}
stands for an API key value and the daily log entry is of the format[used quota, remaining quota]
.
-
(AWS.Response)
—
Returns:
getUsagePlan(params = {}, callback) ⇒ AWS.Request
Gets a usage plan of a given plan identifier.
Service Reference:
Examples:
Calling the getUsagePlan operation
var params = {
usagePlanId: 'STRING_VALUE' /* required */
};
apigateway.getUsagePlan(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The identifier of the UsagePlan resource to be retrieved.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of a UsagePlan resource.
name
— (String
)The name of a usage plan.
description
— (String
)The description of a usage plan.
apiStages
— (Array<map>
)The associated API stages of a usage plan.
apiId
— (String
)API Id of the associated API stage in a usage plan.
stage
— (String
)API stage name of the associated API stage in a usage plan.
throttle
— (map<map>
)Map containing method level throttling information for API stage in a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
throttle
— (map
)The request throttle limits of a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
quota
— (map
)The maximum number of permitted requests per a given unit time interval.
limit
— (Integer
)The maximum number of requests that can be made in a given time period.
offset
— (Integer
)The number of requests subtracted from the given limit in the initial time period.
period
— (String
)The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
Possible values include:"DAY"
"WEEK"
"MONTH"
productCode
— (String
)The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
-
(AWS.Response)
—
Returns:
getUsagePlanKey(params = {}, callback) ⇒ AWS.Request
Gets a usage plan key of a given key identifier.
Service Reference:
Examples:
Calling the getUsagePlanKey operation
var params = {
keyId: 'STRING_VALUE', /* required */
usagePlanId: 'STRING_VALUE' /* required */
};
apigateway.getUsagePlanKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.
keyId
— (String
)[Required] The key Id of the to-be-retrieved UsagePlanKey resource representing a plan customer.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The Id of a usage plan key.
type
— (String
)The type of a usage plan key. Currently, the valid key type is
API_KEY
.value
— (String
)The value of a usage plan key.
name
— (String
)The name of a usage plan key.
-
(AWS.Response)
—
Returns:
getUsagePlanKeys(params = {}, callback) ⇒ AWS.Request
Gets all the usage plan keys representing the API keys added to a specified usage plan.
Service Reference:
Examples:
Calling the getUsagePlanKeys operation
var params = {
usagePlanId: 'STRING_VALUE', /* required */
limit: 'NUMBER_VALUE',
nameQuery: 'STRING_VALUE',
position: 'STRING_VALUE'
};
apigateway.getUsagePlanKeys(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the UsagePlan resource representing the usage plan containing the to-be-retrieved UsagePlanKey resource representing a plan customer.
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
nameQuery
— (String
)A query parameter specifying the name of the to-be-returned usage plan keys.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The Id of a usage plan key.
type
— (String
)The type of a usage plan key. Currently, the valid key type is
API_KEY
.value
— (String
)The value of a usage plan key.
name
— (String
)The name of a usage plan key.
-
(AWS.Response)
—
Returns:
getUsagePlans(params = {}, callback) ⇒ AWS.Request
Gets all the usage plans of the caller's account.
Service Reference:
Examples:
Calling the getUsagePlans operation
var params = {
keyId: 'STRING_VALUE',
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getUsagePlans(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
position
— (String
)The current pagination position in the paged result set.
keyId
— (String
)The identifier of the API key associated with the usage plans.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier of a UsagePlan resource.
name
— (String
)The name of a usage plan.
description
— (String
)The description of a usage plan.
apiStages
— (Array<map>
)The associated API stages of a usage plan.
apiId
— (String
)API Id of the associated API stage in a usage plan.
stage
— (String
)API stage name of the associated API stage in a usage plan.
throttle
— (map<map>
)Map containing method level throttling information for API stage in a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
throttle
— (map
)The request throttle limits of a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
quota
— (map
)The maximum number of permitted requests per a given unit time interval.
limit
— (Integer
)The maximum number of requests that can be made in a given time period.
offset
— (Integer
)The number of requests subtracted from the given limit in the initial time period.
period
— (String
)The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
Possible values include:"DAY"
"WEEK"
"MONTH"
productCode
— (String
)The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
-
(AWS.Response)
—
Returns:
getVpcLink(params = {}, callback) ⇒ AWS.Request
Gets a specified VPC link under the caller's account in a region.
Service Reference:
Examples:
Calling the getVpcLink operation
var params = {
vpcLinkId: 'STRING_VALUE' /* required */
};
apigateway.getVpcLink(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
vpcLinkId
— (String
)[Required] The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
name
— (String
)The name used to label and identify the VPC link.
description
— (String
)The description of the VPC link.
targetArns
— (Array<String>
)The ARNs of network load balancers of the VPC targeted by the VPC link. The network load balancers must be owned by the same AWS account of the API owner.
status
— (String
)The status of the VPC link. The valid values are
Possible values include:AVAILABLE
,PENDING
,DELETING
, orFAILED
. Deploying an API will wait if the status isPENDING
and will fail if the status isDELETING
."AVAILABLE"
"PENDING"
"DELETING"
"FAILED"
statusMessage
— (String
)A description about the VPC link status.
-
(AWS.Response)
—
Returns:
getVpcLinks(params = {}, callback) ⇒ AWS.Request
Gets the VpcLinks collection under the caller's account in a selected region.
Service Reference:
Examples:
Calling the getVpcLinks operation
var params = {
limit: 'NUMBER_VALUE',
position: 'STRING_VALUE'
};
apigateway.getVpcLinks(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
position
— (String
)The current pagination position in the paged result set.
limit
— (Integer
)The maximum number of returned results per page. The default value is 25 and the maximum value is 500.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:position
— (String
)items
— (Array<map>
)The current page of elements from this collection.
id
— (String
)The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
name
— (String
)The name used to label and identify the VPC link.
description
— (String
)The description of the VPC link.
targetArns
— (Array<String>
)The ARNs of network load balancers of the VPC targeted by the VPC link. The network load balancers must be owned by the same AWS account of the API owner.
status
— (String
)The status of the VPC link. The valid values are
Possible values include:AVAILABLE
,PENDING
,DELETING
, orFAILED
. Deploying an API will wait if the status isPENDING
and will fail if the status isDELETING
."AVAILABLE"
"PENDING"
"DELETING"
"FAILED"
statusMessage
— (String
)A description about the VPC link status.
-
(AWS.Response)
—
Returns:
importApiKeys(params = {}, callback) ⇒ AWS.Request
Import API keys from an external source, such as a CSV-formatted file.
Service Reference:
Examples:
Calling the importApiKeys operation
var params = {
body: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, /* required */
format: csv, /* required */
failOnWarnings: true || false
};
apigateway.importApiKeys(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
body
— (Buffer, Typed Array, Blob, String
)The payload of the POST request to import API keys. For the payload format, see API Key File Format.
format
— (String
)A query parameter to specify the input format to imported API keys. Currently, only the
Possible values include:csv
format is supported."csv"
failOnWarnings
— (Boolean
)A query parameter to indicate whether to rollback ApiKey importation (
true
) or not (false
) when error is encountered.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ids
— (Array<String>
)A list of all the ApiKey identifiers.
warnings
— (Array<String>
)A list of warning messages.
-
(AWS.Response)
—
Returns:
importDocumentationParts(params = {}, callback) ⇒ AWS.Request
Calls the ImportDocumentationParts API operation.
Service Reference:
Examples:
Calling the importDocumentationParts operation
var params = {
body: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, /* required */
restApiId: 'STRING_VALUE', /* required */
failOnWarnings: true || false,
mode: merge | overwrite
};
apigateway.importDocumentationParts(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
mode
— (String
)A query parameter to indicate whether to overwrite (
Possible values include:OVERWRITE
) any existing DocumentationParts definition or to merge (MERGE
) the new definition into the existing one. The default value isMERGE
."merge"
"overwrite"
failOnWarnings
— (Boolean
)A query parameter to specify whether to rollback the documentation importation (
true
) or not (false
) when a warning is encountered. The default value isfalse
.body
— (Buffer, Typed Array, Blob, String
)[Required] Raw byte array representing the to-be-imported documentation parts. To import from an OpenAPI file, this is a JSON object.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ids
— (Array<String>
)A list of the returned documentation part identifiers.
warnings
— (Array<String>
)A list of warning messages reported during import of documentation parts.
-
(AWS.Response)
—
Returns:
importRestApi(params = {}, callback) ⇒ AWS.Request
A feature of the API Gateway control service for creating a new API from an external API definition file.
Service Reference:
Examples:
Calling the importRestApi operation
var params = {
body: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, /* required */
failOnWarnings: true || false,
parameters: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.importRestApi(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
failOnWarnings
— (Boolean
)A query parameter to indicate whether to rollback the API creation (
true
) or not (false
) when a warning is encountered. The default value isfalse
.parameters
— (map<String>
)A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.
To exclude DocumentationParts from the import, set
parameters
asignore=documentation
.To configure the endpoint type, set
parameters
asendpointConfigurationTypes=EDGE
,endpointConfigurationTypes=REGIONAL
, orendpointConfigurationTypes=PRIVATE
. The default endpoint type isEDGE
.To handle imported
basePath
, setparameters
asbasePath=ignore
,basePath=prepend
orbasePath=split
.For example, the AWS CLI command to exclude documentation from the imported API is:
aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
The AWS CLI command to set the regional endpoint on the imported API is:
aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL --body 'file:///path/to/imported-api-body.json'
body
— (Buffer, Typed Array, Blob, String
)[Required] The POST request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 2MB.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name
— (String
)The API's name.
description
— (String
)The API's description.
createdDate
— (Date
)The timestamp when the API was created.
version
— (String
)A version identifier for the API.
warnings
— (Array<String>
)The warning messages reported when
failonwarnings
is turned on during API import.binaryMediaTypes
— (Array<String>
)The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize
— (Integer
)A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource
— (String
)The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.
"HEADER"
"AUTHORIZER"
endpointConfiguration
— (map
)The endpoint configuration of this RestApi showing the endpoint types of the API.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
policy
— (String
) A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
-
(AWS.Response)
—
Returns:
putGatewayResponse(params = {}, callback) ⇒ AWS.Request
Creates a customization of a GatewayResponse of a specified response type and status code on the given RestApi.
Service Reference:
Examples:
Calling the putGatewayResponse operation
var params = {
responseType: DEFAULT_4XX | DEFAULT_5XX | RESOURCE_NOT_FOUND | UNAUTHORIZED | INVALID_API_KEY | ACCESS_DENIED | AUTHORIZER_FAILURE | AUTHORIZER_CONFIGURATION_ERROR | INVALID_SIGNATURE | EXPIRED_TOKEN | MISSING_AUTHENTICATION_TOKEN | INTEGRATION_FAILURE | INTEGRATION_TIMEOUT | API_CONFIGURATION_ERROR | UNSUPPORTED_MEDIA_TYPE | BAD_REQUEST_PARAMETERS | BAD_REQUEST_BODY | REQUEST_TOO_LARGE | THROTTLED | QUOTA_EXCEEDED, /* required */
restApiId: 'STRING_VALUE', /* required */
responseParameters: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
responseTemplates: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
statusCode: 'STRING_VALUE'
};
apigateway.putGatewayResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
responseType
— (String
)[Required]
The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
statusCode
— (String
) The HTTP status code of the GatewayResponse.responseParameters
— (map<String>
)Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates
— (map<String>
)Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:responseType
— (String
)The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
statusCode
— (String
)The HTTP status code for this GatewayResponse.
responseParameters
— (map<String>
)Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates
— (map<String>
)Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse
— (Boolean
)A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
-
(AWS.Response)
—
Returns:
putIntegration(params = {}, callback) ⇒ AWS.Request
Sets up a method's integration.
Service Reference:
Examples:
Calling the putIntegration operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
type: HTTP | AWS | MOCK | HTTP_PROXY | AWS_PROXY, /* required */
cacheKeyParameters: [
'STRING_VALUE',
/* more items */
],
cacheNamespace: 'STRING_VALUE',
connectionId: 'STRING_VALUE',
connectionType: INTERNET | VPC_LINK,
contentHandling: CONVERT_TO_BINARY | CONVERT_TO_TEXT,
credentials: 'STRING_VALUE',
integrationHttpMethod: 'STRING_VALUE',
passthroughBehavior: 'STRING_VALUE',
requestParameters: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
requestTemplates: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
timeoutInMillis: 'NUMBER_VALUE',
uri: 'STRING_VALUE'
};
apigateway.putIntegration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies a put integration request's resource ID.
httpMethod
— (String
)[Required] Specifies a put integration request's HTTP method.
type
— (String
)[Required] Specifies a put integration input's type.
Possible values include:"HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
integrationHttpMethod
— (String
)Specifies a put integration HTTP method. When the integration type is HTTP or AWS, this field is required.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies whether credentials are required for a put integration.
requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the
requestTemplates
property on the Integration resource. There are three valid values:WHEN_NO_MATCH
,WHEN_NO_TEMPLATES
, andNEVER
.WHEN_NO_MATCH
passes the request body for unmapped content types through to the integration back end without transformation.NEVER
rejects unmapped content types with an HTTP 415 'Unsupported Media Type' response.WHEN_NO_TEMPLATES
allows pass-through when the integration has NO content types mapped to templates. However if there is at least one content type defined, unmapped content types will be rejected with the same 415 response.
cacheNamespace
— (String
)Specifies a put integration input's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies a put integration input's cache key parameters.
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
-
(AWS.Response)
—
Returns:
putIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents a put integration.
Service Reference:
Examples:
Calling the putIntegrationResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE', /* required */
contentHandling: CONVERT_TO_BINARY | CONVERT_TO_TEXT,
responseParameters: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
responseTemplates: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
selectionPattern: 'STRING_VALUE'
};
apigateway.putIntegrationResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies a put integration response request's resource identifier.
httpMethod
— (String
)[Required] Specifies a put integration response request's HTTP method.
statusCode
— (String
)[Required] Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the selection pattern of a put integration response.
responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
must be a valid and unique response header name andJSON-expression
a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies a put integration response's templates.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
-
(AWS.Response)
—
Returns:
putMethod(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the putMethod operation
var params = {
authorizationType: 'STRING_VALUE', /* required */
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
apiKeyRequired: true || false,
authorizationScopes: [
'STRING_VALUE',
/* more items */
],
authorizerId: 'STRING_VALUE',
operationName: 'STRING_VALUE',
requestModels: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
requestParameters: {
'<String>': true || false,
/* '<String>': ... */
},
requestValidatorId: 'STRING_VALUE'
};
apigateway.putMethod(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] The Resource identifier for the new Method resource.
httpMethod
— (String
)[Required] Specifies the method request's HTTP method type.
authorizationType
— (String
)[Required] The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)Specifies the identifier of an Authorizer to use on this Method, if the type is CUSTOM or COGNITO_USER_POOLS. The authorizer identifier is generated by API Gateway when you created the authorizer.
apiKeyRequired
— (Boolean
)Specifies whether the method required a valid ApiKey.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key defines a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or body-mapping templates.requestModels
— (map<String>
)Specifies the Model resources used for the request's content type. Request models are represented as a key/value map, with a content type as the key and a Model name as the value.
requestValidatorId
— (String
)The identifier of a RequestValidator for validating the method request.
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:httpMethod
— (String
)The method's HTTP verb.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)The identifier of an Authorizer to use on this method. The
authorizationType
must beCUSTOM
.apiKeyRequired
— (Boolean
)A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId
— (String
)The identifier of a RequestValidator for request validation.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.requestModels
— (map<String>
)A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses
— (map<map>
)Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
Example: Get a 200 OK response of a GET method
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" }
statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration
— (map
)Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
Example:
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } }
type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
-
(AWS.Response)
—
Returns:
putMethodResponse(params = {}, callback) ⇒ AWS.Request
Adds a MethodResponse to an existing Method resource.
Service Reference:
Examples:
Calling the putMethodResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE', /* required */
responseModels: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
responseParameters: {
'<String>': true || false,
/* '<String>': ... */
}
};
apigateway.putMethodResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)httpMethod
— (String
)[Required] The HTTP verb of the Method resource.
statusCode
— (String
)[Required] The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header name and the associated value is a Boolean flag indicating whether the method response parameter is required or not. The method response header names must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The response parameter names defined here are available in the integration response to be mapped from an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content type. Response models are represented as a key/value map, with a content type as the key and a Model name as the value.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
-
(AWS.Response)
—
Returns:
putRestApi(params = {}, callback) ⇒ AWS.Request
A feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API.
Service Reference:
Examples:
Calling the putRestApi operation
var params = {
body: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, /* required */
restApiId: 'STRING_VALUE', /* required */
failOnWarnings: true || false,
mode: merge | overwrite,
parameters: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.putRestApi(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
mode
— (String
)The
Possible values include:mode
query parameter to specify the update mode. Valid values are "merge" and "overwrite". By default, the update mode is "merge"."merge"
"overwrite"
failOnWarnings
— (Boolean
)A query parameter to indicate whether to rollback the API update (
true
) or not (false
) when a warning is encountered. The default value isfalse
.parameters
— (map<String>
)Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set
ignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
.body
— (Buffer, Typed Array, Blob, String
)[Required] The PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 2MB.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name
— (String
)The API's name.
description
— (String
)The API's description.
createdDate
— (Date
)The timestamp when the API was created.
version
— (String
)A version identifier for the API.
warnings
— (Array<String>
)The warning messages reported when
failonwarnings
is turned on during API import.binaryMediaTypes
— (Array<String>
)The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize
— (Integer
)A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource
— (String
)The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.
"HEADER"
"AUTHORIZER"
endpointConfiguration
— (map
)The endpoint configuration of this RestApi showing the endpoint types of the API.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
policy
— (String
) A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
-
(AWS.Response)
—
Returns:
tagResource(params = {}, callback) ⇒ AWS.Request
Adds or updates a tag on a given resource.
Service Reference:
Examples:
Calling the tagResource operation
var params = {
resourceArn: 'STRING_VALUE', /* required */
tags: { /* required */
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.tagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)[Required] The ARN of a resource that can be tagged. The resource ARN must be URL-encoded. At present, Stage is the only taggable resource.
tags
— (map<String>
)[Required] The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with
aws:
. The tag value can be up to 256 characters.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
testInvokeAuthorizer(params = {}, callback) ⇒ AWS.Request
Simulate the execution of an Authorizer in your RestApi with headers, parameters, and an incoming request body.
Service Reference:
Examples:
Calling the testInvokeAuthorizer operation
var params = {
authorizerId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
additionalContext: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
body: 'STRING_VALUE',
headers: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
multiValueHeaders: {
'<String>': [
'STRING_VALUE',
/* more items */
],
/* '<String>': ... */
},
pathWithQueryString: 'STRING_VALUE',
stageVariables: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.testInvokeAuthorizer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
authorizerId
— (String
)[Required] Specifies a test invoke authorizer request's Authorizer ID.
headers
— (map<String>
)[Required] A key-value map of headers to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, should be specified.
multiValueHeaders
— (map<Array<String>>
)[Optional] The headers as a map from string to list of values to simulate an incoming invocation request. This is where the incoming authorization token, or identity source, may be specified.
pathWithQueryString
— (String
)[Optional] The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.
body
— (String
)[Optional] The simulated request body of an incoming invocation request.
stageVariables
— (map<String>
)A key-value map of stage variables to simulate an invocation on a deployed Stage.
additionalContext
— (map<String>
)[Optional] A key-value map of additional context variables.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:clientStatus
— (Integer
)The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
log
— (String
)The API Gateway execution log for the test authorizer request.
latency
— (Integer
)The execution latency of the test authorizer request.
principalId
— (String
)The principal identity returned by the Authorizer
policy
— (String
)The JSON policy document returned by the Authorizer
authorization
— (map<Array<String>>
)claims
— (map<String>
)The open identity claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
-
(AWS.Response)
—
Returns:
testInvokeMethod(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the testInvokeMethod operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
body: 'STRING_VALUE',
clientCertificateId: 'STRING_VALUE',
headers: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
},
multiValueHeaders: {
'<String>': [
'STRING_VALUE',
/* more items */
],
/* '<String>': ... */
},
pathWithQueryString: 'STRING_VALUE',
stageVariables: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
apigateway.testInvokeMethod(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies a test invoke method request's resource ID.
httpMethod
— (String
)[Required] Specifies a test invoke method request's HTTP method.
pathWithQueryString
— (String
)The URI path, including query string, of the simulated invocation request. Use this to specify path parameters and query string parameters.
body
— (String
)The simulated request body of an incoming invocation request.
headers
— (map<String>
)A key-value map of headers to simulate an incoming invocation request.
multiValueHeaders
— (map<Array<String>>
)The headers as a map from string to list of values to simulate an incoming invocation request.
clientCertificateId
— (String
)A ClientCertificate identifier to use in the test invocation. API Gateway will use the certificate when making the HTTPS request to the defined back-end endpoint.
stageVariables
— (map<String>
)A key-value map of stage variables to simulate an invocation on a deployed Stage.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:status
— (Integer
)The HTTP status code.
body
— (String
)The body of the HTTP response.
headers
— (map<String>
)The headers of the HTTP response.
multiValueHeaders
— (map<Array<String>>
)The headers of the HTTP response as a map from string to list of values.
log
— (String
)The API Gateway execution log for the test invoke request.
latency
— (Integer
)The execution latency of the test invoke request.
-
(AWS.Response)
—
Returns:
untagResource(params = {}, callback) ⇒ AWS.Request
Removes a tag from a given resource.
Service Reference:
Examples:
Calling the untagResource operation
var params = {
resourceArn: 'STRING_VALUE', /* required */
tagKeys: [ /* required */
'STRING_VALUE',
/* more items */
]
};
apigateway.untagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)[Required] The ARN of a resource that can be tagged. The resource ARN must be URL-encoded. At present, Stage is the only taggable resource.
tagKeys
— (Array<String>
)[Required] The Tag keys to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateAccount(params = {}, callback) ⇒ AWS.Request
Changes information about the current Account resource.
Service Reference:
Examples:
Calling the updateAccount operation
var params = {
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateAccount(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:cloudwatchRoleArn
— (String
)The ARN of an Amazon CloudWatch role for the current Account.
throttleSettings
— (map
)Specifies the API request limits configured for the current Account.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
features
— (Array<String>
)A list of features supported for the account. When usage plans are enabled, the features list will include an entry of
"UsagePlans"
.apiKeyVersion
— (String
)The version of the API keys used for the account.
-
(AWS.Response)
—
Returns:
updateApiKey(params = {}, callback) ⇒ AWS.Request
Changes information about an ApiKey resource.
Service Reference:
Examples:
Calling the updateApiKey operation
var params = {
apiKey: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateApiKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
apiKey
— (String
)[Required] The identifier of the ApiKey resource to be updated.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of the API Key.
value
— (String
)The value of the API Key.
name
— (String
)The name of the API Key.
customerId
— (String
)An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
description
— (String
)The description of the API Key.
enabled
— (Boolean
)Specifies whether the API Key can be used by callers.
createdDate
— (Date
)The timestamp when the API Key was created.
lastUpdatedDate
— (Date
)The timestamp when the API Key was last updated.
stageKeys
— (Array<String>
)A list of Stage resources that are associated with the ApiKey resource.
-
(AWS.Response)
—
Returns:
updateAuthorizer(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the updateAuthorizer operation
var params = {
authorizerId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateAuthorizer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
authorizerId
— (String
)[Required] The identifier of the Authorizer resource.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the authorizer resource.
name
— (String
)[Required] The name of the authorizer.
type
— (String
)The authorizer type. Valid values are
Possible values include:TOKEN
for a Lambda function using a single authorization token submitted in a custom header,REQUEST
for a Lambda function using incoming request parameters, andCOGNITO_USER_POOLS
for using an Amazon Cognito user pool."TOKEN"
"REQUEST"
"COGNITO_USER_POOLS"
providerARNs
— (Array<String>
)A list of the Amazon Cognito user pool ARNs for the
COGNITO_USER_POOLS
authorizer. Each element is of this format:arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}
. For aTOKEN
orREQUEST
authorizer, this is not defined.authType
— (String
)Optional customer-defined field, used in OpenAPI imports and exports without functional impact.
authorizerUri
— (String
)Specifies the authorizer's Uniform Resource Identifier (URI). For
TOKEN
orREQUEST
authorizers, this must be a well-formed Lambda function URI, for example,arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations
. In general, the URI has this formarn:aws:apigateway:{region}:lambda:path/{service_api}
, where{region}
is the same as the region hosting the Lambda function,path
indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial/
. For Lambda functions, this is usually of the form/2015-03-31/functions/[FunctionARN]/invocations
.authorizerCredentials
— (String
)Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
identitySource
— (String
)The identity source for which authorization is requested.
- For a
TOKEN
orCOGNITO_USER_POOLS
authorizer, this is required and specifies the request header mapping expression for the custom header holding the authorization token submitted by the client. For example, if the token header name isAuth
, the header mapping expression ismethod.request.header.Auth
. - For the
REQUEST
authorizer, this is required when authorization caching is enabled. The value is a comma-separated string of one or more mapping expressions of the specified request parameters. For example, if anAuth
header, aName
query string parameter are defined as identity sources, this value ismethod.request.header.Auth, method.request.querystring.Name
. These parameters will be used to derive the authorization caching key and to perform runtime validation of theREQUEST
authorizer by verifying all of the identity-related request parameters are present, not null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function, otherwise, it returns a 401 Unauthorized response without calling the Lambda function. The valid value is a string of comma-separated mapping expressions of the specified request parameters. When the authorization caching is not enabled, this property is optional.
- For a
identityValidationExpression
— (String
)A validation expression for the incoming identity token. For
TOKEN
authorizers, this value is a regular expression. API Gateway will match theaud
field of the incoming token from the client against the specified regular expression. It will invoke the authorizer's Lambda function when there is a match. Otherwise, it will return a 401 Unauthorized response without calling the Lambda function. The validation expression does not apply to theREQUEST
authorizer.authorizerResultTtlInSeconds
— (Integer
)The TTL in seconds of cached authorizer results. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
-
(AWS.Response)
—
Returns:
updateBasePathMapping(params = {}, callback) ⇒ AWS.Request
Changes information about the BasePathMapping resource.
Service Reference:
Examples:
Calling the updateBasePathMapping operation
var params = {
basePath: 'STRING_VALUE', /* required */
domainName: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateBasePathMapping(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The domain name of the BasePathMapping resource to change.
basePath
— (String
)[Required] The base path of the BasePathMapping resource to change.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:basePath
— (String
)The base path name that callers of the API must provide as part of the URL after the domain name.
restApiId
— (String
)The string identifier of the associated RestApi.
stage
— (String
)The name of the associated stage.
-
(AWS.Response)
—
Returns:
updateClientCertificate(params = {}, callback) ⇒ AWS.Request
Changes information about an ClientCertificate resource.
Service Reference:
Examples:
Calling the updateClientCertificate operation
var params = {
clientCertificateId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateClientCertificate(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
clientCertificateId
— (String
)[Required] The identifier of the ClientCertificate resource to be updated.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:clientCertificateId
— (String
)The identifier of the client certificate.
description
— (String
)The description of the client certificate.
pemEncodedCertificate
— (String
)The PEM-encoded public key of the client certificate, which can be used to configure certificate authentication in the integration endpoint .
createdDate
— (Date
)The timestamp when the client certificate was created.
expirationDate
— (Date
)The timestamp when the client certificate will expire.
-
(AWS.Response)
—
Returns:
updateDeployment(params = {}, callback) ⇒ AWS.Request
Changes information about a Deployment resource.
Service Reference:
Examples:
Calling the updateDeployment operation
var params = {
deploymentId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateDeployment(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
deploymentId
— (String
)The replacement identifier for the Deployment resource to change information about.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the deployment resource.
description
— (String
)The description for the deployment resource.
createdDate
— (Date
)The date and time that the deployment resource was created.
apiSummary
— (map<map<map>>
)A summary of the RestApi at the date and time that the deployment resource was created.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.apiKeyRequired
— (Boolean
)Specifies whether the method requires a valid ApiKey.
-
(AWS.Response)
—
Returns:
updateDocumentationPart(params = {}, callback) ⇒ AWS.Request
Calls the UpdateDocumentationPart API operation.
Service Reference:
Examples:
Calling the updateDocumentationPart operation
var params = {
documentationPartId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateDocumentationPart(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
documentationPartId
— (String
)[Required] The identifier of the to-be-updated documentation part.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The DocumentationPart identifier, generated by API Gateway when the
DocumentationPart
is created.location
— (map
)The location of the API entity to which the documentation applies. Valid fields depend on the targeted API entity type. All the valid location fields are not required. If not explicitly specified, a valid location field is treated as a wildcard and associated documentation content may be inherited by matching entities, unless overridden.
type
— required — (String
)[Required] The type of API entity to which the documentation content applies. Valid values are
Possible values include:API
,AUTHORIZER
,MODEL
,RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. Content inheritance does not apply to any entity of theAPI
,AUTHORIZER
,METHOD
,MODEL
,REQUEST_BODY
, orRESOURCE
type."API"
"AUTHORIZER"
"MODEL"
"RESOURCE"
"METHOD"
"PATH_PARAMETER"
"QUERY_PARAMETER"
"REQUEST_HEADER"
"REQUEST_BODY"
"RESPONSE"
"RESPONSE_HEADER"
"RESPONSE_BODY"
path
— (String
)The URL path of the target. It is a valid field for the API entity types of
RESOURCE
,METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is/
for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the otherlocation
attributes, the child entity'spath
attribute must match that of the parent entity as a prefix.method
— (String
)The HTTP verb of a method. It is a valid field for the API entity types of
METHOD
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
,RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'smethod
attribute must match that of the parent entity exactly.statusCode
— (String
)The HTTP status code of a response. It is a valid field for the API entity types of
RESPONSE
,RESPONSE_HEADER
, andRESPONSE_BODY
. The default value is*
for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the otherlocation
attributes, the child entity'sstatusCode
attribute must match that of the parent entity exactly.name
— (String
)The name of the targeted API entity. It is a valid and required field for the API entity types of
AUTHORIZER
,MODEL
,PATH_PARAMETER
,QUERY_PARAMETER
,REQUEST_HEADER
,REQUEST_BODY
andRESPONSE_HEADER
. It is an invalid field for any other entity type.
properties
— (String
)A content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g.,
"{ \"description\": \"The API does ...\" }"
. Only OpenAPI-compliant documentation-related fields from theproperties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension ofx-amazon-apigateway-documentation
.
-
(AWS.Response)
—
Returns:
updateDocumentationVersion(params = {}, callback) ⇒ AWS.Request
Calls the UpdateDocumentationVersion API operation.
Service Reference:
Examples:
Calling the updateDocumentationVersion operation
var params = {
documentationVersion: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateDocumentationVersion(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi..
documentationVersion
— (String
)[Required] The version identifier of the to-be-updated documentation version.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:version
— (String
)The version identifier of the API documentation snapshot.
createdDate
— (Date
)The date when the API documentation snapshot is created.
description
— (String
)The description of the API documentation snapshot.
-
(AWS.Response)
—
Returns:
updateDomainName(params = {}, callback) ⇒ AWS.Request
Changes information about the DomainName resource.
Service Reference:
Examples:
Calling the updateDomainName operation
var params = {
domainName: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateDomainName(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
domainName
— (String
)[Required] The name of the DomainName resource to be changed.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:domainName
— (String
)The custom domain name as an API host name, for example,
my-api.example.com
.certificateName
— (String
)The name of the certificate that will be used by edge-optimized endpoint for this domain name.
certificateArn
— (String
)The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.
certificateUploadDate
— (Date
)The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
regionalDomainName
— (String
)The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.
regionalHostedZoneId
— (String
)The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
regionalCertificateName
— (String
)The name of the certificate that will be used for validating the regional domain name.
regionalCertificateArn
— (String
)The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.
distributionDomainName
— (String
)The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.
distributionHostedZoneId
— (String
)The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.endpointConfiguration
— (map
)The endpoint configuration of this DomainName showing the endpoint types of the domain name.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
-
(AWS.Response)
—
Returns:
updateGatewayResponse(params = {}, callback) ⇒ AWS.Request
Updates a GatewayResponse of a specified response type on the given RestApi.
Service Reference:
Examples:
Calling the updateGatewayResponse operation
var params = {
responseType: DEFAULT_4XX | DEFAULT_5XX | RESOURCE_NOT_FOUND | UNAUTHORIZED | INVALID_API_KEY | ACCESS_DENIED | AUTHORIZER_FAILURE | AUTHORIZER_CONFIGURATION_ERROR | INVALID_SIGNATURE | EXPIRED_TOKEN | MISSING_AUTHENTICATION_TOKEN | INTEGRATION_FAILURE | INTEGRATION_TIMEOUT | API_CONFIGURATION_ERROR | UNSUPPORTED_MEDIA_TYPE | BAD_REQUEST_PARAMETERS | BAD_REQUEST_BODY | REQUEST_TOO_LARGE | THROTTLED | QUOTA_EXCEEDED, /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateGatewayResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
responseType
— (String
)[Required]
The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:responseType
— (String
)The response type of the associated GatewayResponse. Valid values are
- ACCESS_DENIED
- API_CONFIGURATION_ERROR
- AUTHORIZER_FAILURE
- AUTHORIZER_CONFIGURATION_ERROR
- BAD_REQUEST_PARAMETERS
- BAD_REQUEST_BODY
- DEFAULT_4XX
- DEFAULT_5XX
- EXPIRED_TOKEN
- INVALID_SIGNATURE
- INTEGRATION_FAILURE
- INTEGRATION_TIMEOUT
- INVALID_API_KEY
- MISSING_AUTHENTICATION_TOKEN
- QUOTA_EXCEEDED
- REQUEST_TOO_LARGE
- RESOURCE_NOT_FOUND
- THROTTLED
- UNAUTHORIZED
- UNSUPPORTED_MEDIA_TYPE
"DEFAULT_4XX"
"DEFAULT_5XX"
"RESOURCE_NOT_FOUND"
"UNAUTHORIZED"
"INVALID_API_KEY"
"ACCESS_DENIED"
"AUTHORIZER_FAILURE"
"AUTHORIZER_CONFIGURATION_ERROR"
"INVALID_SIGNATURE"
"EXPIRED_TOKEN"
"MISSING_AUTHENTICATION_TOKEN"
"INTEGRATION_FAILURE"
"INTEGRATION_TIMEOUT"
"API_CONFIGURATION_ERROR"
"UNSUPPORTED_MEDIA_TYPE"
"BAD_REQUEST_PARAMETERS"
"BAD_REQUEST_BODY"
"REQUEST_TOO_LARGE"
"THROTTLED"
"QUOTA_EXCEEDED"
statusCode
— (String
)The HTTP status code for this GatewayResponse.
responseParameters
— (map<String>
)Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates
— (map<String>
)Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
defaultResponse
— (Boolean
)A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false
). A default gateway response is one generated by API Gateway without any customization by an API developer.
-
(AWS.Response)
—
Returns:
updateIntegration(params = {}, callback) ⇒ AWS.Request
Represents an update integration.
Service Reference:
Examples:
Calling the updateIntegration operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateIntegration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Represents an update integration request's resource identifier.
httpMethod
— (String
)[Required] Represents an update integration request's HTTP method.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
-
(AWS.Response)
—
Returns:
updateIntegrationResponse(params = {}, callback) ⇒ AWS.Request
Represents an update integration response.
Service Reference:
Examples:
Calling the updateIntegrationResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateIntegrationResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] Specifies an update integration response request's resource identifier.
httpMethod
— (String
)[Required] Specifies an update integration response request's HTTP method.
statusCode
— (String
)[Required] Specifies an update integration response request's status code.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
-
(AWS.Response)
—
Returns:
updateMethod(params = {}, callback) ⇒ AWS.Request
Updates an existing Method resource.
Service Reference:
Examples:
Calling the updateMethod operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateMethod(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)httpMethod
— (String
)[Required] The HTTP verb of the Method resource.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:httpMethod
— (String
)The method's HTTP verb.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)The identifier of an Authorizer to use on this method. The
authorizationType
must beCUSTOM
.apiKeyRequired
— (Boolean
)A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId
— (String
)The identifier of a RequestValidator for request validation.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.requestModels
— (map<String>
)A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses
— (map<map>
)Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
Example: Get a 200 OK response of a GET method
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" }
statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration
— (map
)Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
Example:
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } }
type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
-
(AWS.Response)
—
Returns:
updateMethodResponse(params = {}, callback) ⇒ AWS.Request
Updates an existing MethodResponse resource.
Service Reference:
Examples:
Calling the updateMethodResponse operation
var params = {
httpMethod: 'STRING_VALUE', /* required */
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
statusCode: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateMethodResponse(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] The Resource identifier for the MethodResponse resource.
httpMethod
— (String
)[Required] The HTTP verb of the Method resource.
statusCode
— (String
)[Required] The status code for the MethodResponse resource.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
-
(AWS.Response)
—
Returns:
updateModel(params = {}, callback) ⇒ AWS.Request
Changes information about a model.
Service Reference:
Examples:
Calling the updateModel operation
var params = {
modelName: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateModel(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
modelName
— (String
)[Required] The name of the model to update.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier for the model resource.
name
— (String
)The name of the model. Must be an alphanumeric string.
description
— (String
)The description of the model.
schema
— (String
)The schema for the model. For
application/json
models, this should be JSON schema draft 4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.contentType
— (String
)The content-type for the model.
-
(AWS.Response)
—
Returns:
updateRequestValidator(params = {}, callback) ⇒ AWS.Request
Updates a RequestValidator of a given RestApi.
Service Reference:
Examples:
Calling the updateRequestValidator operation
var params = {
requestValidatorId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateRequestValidator(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
requestValidatorId
— (String
)[Required] The identifier of RequestValidator to be updated.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of this RequestValidator.
name
— (String
)The name of this RequestValidator
validateRequestBody
— (Boolean
)A Boolean flag to indicate whether to validate a request body according to the configured Model schema.
validateRequestParameters
— (Boolean
)A Boolean flag to indicate whether to validate request parameters (
true
) or not (false
).
-
(AWS.Response)
—
Returns:
updateResource(params = {}, callback) ⇒ AWS.Request
Changes information about a Resource resource.
Service Reference:
Examples:
Calling the updateResource operation
var params = {
resourceId: 'STRING_VALUE', /* required */
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
resourceId
— (String
)[Required] The identifier of the Resource resource.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The resource's identifier.
parentId
— (String
)The parent resource's identifier.
pathPart
— (String
)The last path segment for this resource.
path
— (String
)The full path for this resource.
resourceMethods
— (map<map>
)Gets an API resource's method of a given HTTP verb.
The resource methods are a map of methods indexed by methods' HTTP verbs enabled on the resource. This method map is included in the
200 OK
response of theGET /restapis/{restapi_id}/resources/{resource_id}
orGET /restapis/{restapi_id}/resources/{resource_id}?embed=methods
request.Example: Get the GET method of an API resource
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20170223T031827Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20170223/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-{rel}.html", "name": "method", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true } ], "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET", "name": "GET", "title": "GET" }, "integration:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "method:integration": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "method:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "method:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET" }, "methodresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/{status_code}", "templated": true } }, "apiKeyRequired": false, "authorizationType": "NONE", "httpMethod": "GET", "_embedded": { "method:integration": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integration:responses": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "3kzxbg5sa2", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestParameters": { "integration.request.header.Content-Type": "'application/x-amz-json-1.1'" }, "requestTemplates": { "application/json": "{\n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-east-1:kinesis:action/ListStreams", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" } } }, "method:responses": { "_links": { "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200", "name": "200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.Content-Type": false }, "statusCode": "200" } } }
If the
OPTIONS
is enabled on the resource, you can follow the example here to get that method. Just replace theGET
of the last path segment in the request URL withOPTIONS
.httpMethod
— (String
)The method's HTTP verb.
authorizationType
— (String
)The method's authorization type. Valid values are
NONE
for open access,AWS_IAM
for using AWS IAM permissions,CUSTOM
for using a custom authorizer, orCOGNITO_USER_POOLS
for using a Cognito user pool.authorizerId
— (String
)The identifier of an Authorizer to use on this method. The
authorizationType
must beCUSTOM
.apiKeyRequired
— (Boolean
)A boolean flag specifying whether a valid ApiKey is required to invoke this method.
requestValidatorId
— (String
)The identifier of a RequestValidator for request validation.
operationName
— (String
)A human-friendly operation identifier for the method. For example, you can assign the
operationName
ofListPets
for theGET /pets
method in PetStore example.requestParameters
— (map<Boolean>
)A key-value map defining required or optional method request parameters that can be accepted by API Gateway. A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.requestModels
— (map<String>
)A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).
methodResponses
— (map<map>
)Gets a method response associated with a given HTTP status code.
The collection of method responses are encapsulated in a key-value map, where the key is a response's HTTP status code and the value is a MethodResponse resource that specifies the response returned to the caller from the back end through the integration response.
Example: Get a 200 OK response of a GET method
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T215008Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-method-response-{rel}.html", "name": "methodresponse", "templated": true }, "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200", "title": "200" }, "methodresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" }, "methodresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/responses/200" } }, "responseModels": { "application/json": "Empty" }, "responseParameters": { "method.response.header.operator": false, "method.response.header.operand_2": false, "method.response.header.operand_1": false }, "statusCode": "200" }
statusCode
— (String
)The method response's status code.
responseParameters
— (map<Boolean>
)A key-value map specifying required or optional response parameters that API Gateway can send back to the caller. A key defines a method response header and the value specifies whether the associated method response header is required or not. The expression of the key must match the pattern
method.response.header.{name}
, wherename
is a valid and unique header name. API Gateway passes certain integration response data to the method response headers specified here according to the mapping you prescribe in the API's IntegrationResponse. The integration response data that can be mapped include an integration response header expressed inintegration.response.header.{name}
, a static value enclosed within a pair of single quotes (e.g.,'application/json'
), or a JSON expression from the back-end response payload in the form ofintegration.response.body.{JSON-expression}
, whereJSON-expression
is a valid JSON expression without the$
prefix.)responseModels
— (map<String>
)Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
methodIntegration
— (map
)Gets the method's integration responsible for passing the client-submitted request to the back end and performing necessary transformations to make the request compliant with the back end.
Example:
Request
GET /restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com Content-Length: 117 X-Amz-Date: 20160613T213210Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160613/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns a
200 OK
status code and a payload similar to the following:{ "_links": { "curies": [ { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-{rel}.html", "name": "integration", "templated": true }, { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true } ], "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integration:responses": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integration:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration" }, "integrationresponse:put": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/{status_code}", "templated": true } }, "cacheKeyParameters": [], "cacheNamespace": "0cjtch", "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod": "POST", "passthroughBehavior": "WHEN_NO_MATCH", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "_embedded": { "integration:responses": { "_links": { "self": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200", "name": "200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/uojnr9hd57/resources/0cjtch/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { "application/json": "#set($res = $input.path('$'))\n{\n \"result\": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" }, "selectionPattern": "", "statusCode": "200" } } }
type
— (String
)Specifies an API method integration type. The valid value is one of the following:
AWS
: for integrating the API method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.AWS_PROXY
: for integrating the API method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as the Lambda proxy integration.HTTP
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC. This integration is also referred to as the HTTP custom integration.HTTP_PROXY
: for integrating the API method request with an HTTP endpoint, including a private HTTP endpoint within a VPC, with the client request passed through as-is. This is also referred to as the HTTP proxy integration.MOCK
: for integrating the API method request with API Gateway as a "loop-back" endpoint without invoking any backend.
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (
Possible values include:http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with aconnectionType
ofVPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC."HTTP"
"AWS"
"MOCK"
"HTTP_PROXY"
"AWS_PROXY"
httpMethod
— (String
)Specifies the integration's HTTP method type.
uri
— (String
)Specifies Uniform Resource Identifier (URI) of the integration endpoint.
For
HTTP
orHTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, whereconnectionType
is notVPC_LINK
, or private integration, whereconnectionType
isVPC_LINK
. For a private HTTP integration, the URI is not used for routing.For
AWS
orAWS_PROXY
integrations, the URI is of the formarn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}
. Here,{Region}
is the API Gateway region (e.g.,us-east-1
);{service}
is the name of the integrated AWS service (e.g.,s3
); and{subdomain}
is a designated subdomain supported by certain AWS service for fast host-name lookup.action
can be used for an AWS service action-based API, using anAction={name}&{p1}={v1}&p2={v2}...
query string. The ensuing{service_api}
refers to a supported action{name}
plus any required input parameters. Alternatively,path
can be used for an AWS service path-based API. The ensuingservice_api
refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API ofGetObject
, theuri
can be eitherarn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
orarn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
connectionType
— (String
)The type of the network connection to the integration endpoint. The valid value is
Possible values include:INTERNET
for connections through the public routable internet orVPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET
."INTERNET"
"VPC_LINK"
connectionId
— (String
)The (
id
) of the VpcLink used for the integration whenconnectionType=VPC_LINK
and undefined, otherwise.credentials
— (String
)Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. To use resource-based permissions on supported AWS services, specify null.requestParameters
— (map<String>
)A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
must be a valid and unique method request parameter name.requestTemplates
— (map<String>
)Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
passthroughBehavior
— (String
)Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in
requestTemplates
. The valid value is one of the following:-
WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. -
WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP415 Unsupported Media Type
response. -
NEVER
: rejects the method request with an HTTP415 Unsupported Media Type
response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
-
contentHandling
— (String
)Specifies how to handle request payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a request payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a request payload from a binary blob to a Base64-encoded string.
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the
Possible values include:passthroughBehaviors
is configured to support payload pass-through."CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
timeoutInMillis
— (Integer
)Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
cacheNamespace
— (String
)Specifies the integration's cache namespace.
cacheKeyParameters
— (Array<String>
)Specifies the integration's cache key parameters.
integrationResponses
— (map<map>
)Specifies the integration's responses.
Example: Get integration responses of a method
Request
GET /restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200 HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160607T191449Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160607/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash}
Response
The successful response returns
200 OK
status and a payload as follows:{ "_links": { "curies": { "href": "https://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-integration-response-{rel}.html", "name": "integrationresponse", "templated": true }, "self": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200", "title": "200" }, "integrationresponse:delete": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" }, "integrationresponse:update": { "href": "/restapis/fugvjdxtri/resources/3kzxbg5sa2/methods/GET/integration/responses/200" } }, "responseParameters": { "method.response.header.Content-Type": "'application/xml'" }, "responseTemplates": { "application/json": "$util.urlDecode(\"%3CkinesisStreams%3E#foreach($stream in $input.path('$.StreamNames'))%3Cstream%3E%3Cname%3E$stream%3C/name%3E%3C/stream%3E#end%3C/kinesisStreams%3E\")\n" }, "statusCode": "200" }
statusCode
— (String
)Specifies the status code that is used to map the integration response to an existing MethodResponse.
selectionPattern
— (String
)Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the
.+
regex to match error response. However, make sure that the error response does not contain any newline (\n
) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.responseParameters
— (map<String>
)A key-value map specifying response parameters that are passed to the method response from the back end. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of
method.response.header.{name}
, wherename
is a valid and unique header name. The mapped non-static value must match the pattern ofintegration.response.header.{name}
orintegration.response.body.{JSON-expression}
, wherename
is a valid and unique response header name andJSON-expression
is a valid JSON expression without the$
prefix.responseTemplates
— (map<String>
)Specifies the templates used to transform the integration response body. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.
contentHandling
— (String
)Specifies how to handle response payload content type conversions. Supported values are
CONVERT_TO_BINARY
andCONVERT_TO_TEXT
, with the following behaviors:CONVERT_TO_BINARY
: Converts a response payload from a Base64-encoded string to the corresponding binary blob.CONVERT_TO_TEXT
: Converts a response payload from a binary blob to a Base64-encoded string.
If this property is not defined, the response payload will be passed through from the integration response to the method response without modification.
Possible values include:"CONVERT_TO_BINARY"
"CONVERT_TO_TEXT"
authorizationScopes
— (Array<String>
)A list of authorization scopes configured on the method. The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.
-
(AWS.Response)
—
Returns:
updateRestApi(params = {}, callback) ⇒ AWS.Request
Changes information about the specified API.
Service Reference:
Examples:
Calling the updateRestApi operation
var params = {
restApiId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateRestApi(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The API's identifier. This identifier is unique across all of your APIs in API Gateway.
name
— (String
)The API's name.
description
— (String
)The API's description.
createdDate
— (Date
)The timestamp when the API was created.
version
— (String
)A version identifier for the API.
warnings
— (Array<String>
)The warning messages reported when
failonwarnings
is turned on during API import.binaryMediaTypes
— (Array<String>
)The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimumCompressionSize
— (Integer
)A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
apiKeySource
— (String
)The source of the API key for metering requests according to a usage plan. Valid values are:
HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.
"HEADER"
"AUTHORIZER"
endpointConfiguration
— (map
)The endpoint configuration of this RestApi showing the endpoint types of the API.
types
— (Array<String>
)A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is
"EDGE"
. For a regional API and its custom domain name, the endpoint type isREGIONAL
. For a private API, the endpoint type isPRIVATE
.
policy
— (String
) A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
-
(AWS.Response)
—
Returns:
updateStage(params = {}, callback) ⇒ AWS.Request
Changes information about a Stage resource.
Service Reference:
Examples:
Calling the updateStage operation
var params = {
restApiId: 'STRING_VALUE', /* required */
stageName: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateStage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
restApiId
— (String
)[Required] The string identifier of the associated RestApi.
stageName
— (String
)[Required] The name of the Stage resource to change information about.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:deploymentId
— (String
)The identifier of the Deployment that the stage points to.
clientCertificateId
— (String
)The identifier of a client certificate for an API stage.
stageName
— (String
)The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway.
description
— (String
)The stage's description.
cacheClusterEnabled
— (Boolean
)Specifies whether a cache cluster is enabled for the stage.
cacheClusterSize
— (String
)The size of the cache cluster for the stage, if enabled.
Possible values include:"0.5"
"1.6"
"6.1"
"13.5"
"28.4"
"58.2"
"118"
"237"
cacheClusterStatus
— (String
)The status of the cache cluster for the stage, if enabled.
Possible values include:"CREATE_IN_PROGRESS"
"AVAILABLE"
"DELETE_IN_PROGRESS"
"NOT_AVAILABLE"
"FLUSH_IN_PROGRESS"
methodSettings
— (map<map>
)A map that defines the method settings for a Stage resource. Keys (designated as
/{method_setting_key
below) are method paths defined as{resource_path}/{http_method}
for an individual method override, or/*/*
for overriding all methods in the stage.metricsEnabled
— (Boolean
)Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is
/{method_setting_key}/metrics/enabled
, and the value is a Boolean.loggingLevel
— (String
)Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/loglevel
, and the available levels areOFF
,ERROR
, andINFO
.dataTraceEnabled
— (Boolean
)Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is
/{method_setting_key}/logging/dataTrace
, and the value is a Boolean.throttlingBurstLimit
— (Integer
)Specifies the throttling burst limit. The PATCH path for this setting is
/{method_setting_key}/throttling/burstLimit
, and the value is an integer.throttlingRateLimit
— (Float
)Specifies the throttling rate limit. The PATCH path for this setting is
/{method_setting_key}/throttling/rateLimit
, and the value is a double.cachingEnabled
— (Boolean
)Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is
/{method_setting_key}/caching/enabled
, and the value is a Boolean.cacheTtlInSeconds
— (Integer
)Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is
/{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.cacheDataEncrypted
— (Boolean
)Specifies whether the cached responses are encrypted. The PATCH path for this setting is
/{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.requireAuthorizationForCacheControl
— (Boolean
)Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is
/{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.unauthorizedCacheControlHeaderStrategy
— (String
)Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is
Possible values include:/{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values areFAIL_WITH_403
,SUCCEED_WITH_RESPONSE_HEADER
,SUCCEED_WITHOUT_RESPONSE_HEADER
."FAIL_WITH_403"
"SUCCEED_WITH_RESPONSE_HEADER"
"SUCCEED_WITHOUT_RESPONSE_HEADER"
variables
— (map<String>
)A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match
[A-Za-z0-9-._~:/?#&=,]+
.documentationVersion
— (String
)The version of the associated API documentation.
accessLogSettings
— (map
)Settings for logging access in this stage.
format
— (String
)A single line format of the access logs of data, as specified by selected $context variables. The format must include at least
$context.requestId
.destinationArn
— (String
)The ARN of the CloudWatch Logs log group to receive access logs.
canarySettings
— (map
)Settings for the canary deployment in this stage.
percentTraffic
— (Float
)The percent (0-100) of traffic diverted to a canary deployment.
deploymentId
— (String
)The ID of the canary deployment.
stageVariableOverrides
— (map<String>
)Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.
useStageCache
— (Boolean
)A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
tracingEnabled
— (Boolean
)Specifies whether active tracing with X-ray is enabled for the Stage.
webAclArn
— (String
)The ARN of the WebAcl associated with the Stage.
tags
— (map<String>
)The collection of tags. Each tag element is associated with a given resource.
createdDate
— (Date
)The timestamp when the stage was created.
lastUpdatedDate
— (Date
)The timestamp when the stage last updated.
-
(AWS.Response)
—
Returns:
updateUsage(params = {}, callback) ⇒ AWS.Request
Grants a temporary extension to the remaining quota of a usage plan associated with a specified API key.
Service Reference:
Examples:
Calling the updateUsage operation
var params = {
keyId: 'STRING_VALUE', /* required */
usagePlanId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateUsage(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the usage plan associated with the usage data.
keyId
— (String
)[Required] The identifier of the API key associated with the usage plan in which a temporary extension is granted to the remaining quota.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:usagePlanId
— (String
)The plan Id associated with this usage data.
startDate
— (String
)The starting date of the usage data.
endDate
— (String
)The ending date of the usage data.
position
— (String
)items
— (map<Array<Array<Integer>>>
)The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example,
{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}
, where{api_key}
stands for an API key value and the daily log entry is of the format[used quota, remaining quota]
.
-
(AWS.Response)
—
Returns:
updateUsagePlan(params = {}, callback) ⇒ AWS.Request
Updates a usage plan of a given plan Id.
Service Reference:
Examples:
Calling the updateUsagePlan operation
var params = {
usagePlanId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateUsagePlan(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
usagePlanId
— (String
)[Required] The Id of the to-be-updated usage plan.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of a UsagePlan resource.
name
— (String
)The name of a usage plan.
description
— (String
)The description of a usage plan.
apiStages
— (Array<map>
)The associated API stages of a usage plan.
apiId
— (String
)API Id of the associated API stage in a usage plan.
stage
— (String
)API stage name of the associated API stage in a usage plan.
throttle
— (map<map>
)Map containing method level throttling information for API stage in a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
throttle
— (map
)The request throttle limits of a usage plan.
burstLimit
— (Integer
)The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity.
rateLimit
— (Float
)The API request steady-state rate limit.
quota
— (map
)The maximum number of permitted requests per a given unit time interval.
limit
— (Integer
)The maximum number of requests that can be made in a given time period.
offset
— (Integer
)The number of requests subtracted from the given limit in the initial time period.
period
— (String
)The time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH".
Possible values include:"DAY"
"WEEK"
"MONTH"
productCode
— (String
)The AWS Markeplace product identifier to associate with the usage plan as a SaaS product on AWS Marketplace.
-
(AWS.Response)
—
Returns:
updateVpcLink(params = {}, callback) ⇒ AWS.Request
Updates an existing VpcLink of a specified identifier.
Service Reference:
Examples:
Calling the updateVpcLink operation
var params = {
vpcLinkId: 'STRING_VALUE', /* required */
patchOperations: [
{
from: 'STRING_VALUE',
op: add | remove | replace | move | copy | test,
path: 'STRING_VALUE',
value: 'STRING_VALUE'
},
/* more items */
]
};
apigateway.updateVpcLink(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
vpcLinkId
— (String
)[Required] The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
patchOperations
— (Array<map>
)A list of update operations to be applied to the specified resource and in the order specified in this list.
op
— (String
)An update operation to be performed with this PATCH request. The valid value can be
Possible values include:add
,remove
,replace
orcopy
. Not all valid operations are supported for a given resource. Support of the operations depends on specific operational contexts. Attempts to apply an unsupported operation on a resource will return an error message."add"
"remove"
"replace"
"move"
"copy"
"test"
path
— (String
)The
op
operation's target, as identified by a JSON Pointer value that references a location within the targeted resource. For example, if the target resource has an updateable property of{"name":"value"}
, the path for this property is/name
. If thename
property value is a JSON object (e.g.,{"name": {"child/name": "child-value"}}
), the path for thechild/name
property will be/name/child~1name
. Any slash ("/") character appearing in path names must be escaped with "~1", as shown in the example above. Eachop
operation can have only onepath
associated with it.value
— (String
)The new target value of the update operation. It is applicable for the
add
orreplace
operation. When using AWS CLI to update a property of a JSON value, enclose the JSON object with a pair of single quotes in a Linux shell, e.g., '...'. In a Windows shell, see Using JSON for Parameters.from
— (String
)The
copy
update operation's source as identified by aJSON-Pointer
value referencing the location within the targeted resource to copy the value from. For example, to promote a canary deployment, you copy the canary deployment ID to the affiliated deployment ID by calling a PATCH request on a Stage resource with"op":"copy"
,"from":"/canarySettings/deploymentId"
and"path":"/deploymentId"
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.
name
— (String
)The name used to label and identify the VPC link.
description
— (String
)The description of the VPC link.
targetArns
— (Array<String>
)The ARNs of network load balancers of the VPC targeted by the VPC link. The network load balancers must be owned by the same AWS account of the API owner.
status
— (String
)The status of the VPC link. The valid values are
Possible values include:AVAILABLE
,PENDING
,DELETING
, orFAILED
. Deploying an API will wait if the status isPENDING
and will fail if the status isDELETING
."AVAILABLE"
"PENDING"
"DELETING"
"FAILED"
statusMessage
— (String
)A description about the VPC link status.
-
(AWS.Response)
—
Returns: