Skip to main content

methods

Creates, updates, deletes or gets a method resource or lists methods in a region

Overview

Namemethods
TypeResource
DescriptionThe AWS::ApiGateway::Method resource creates API Gateway methods that define the parameters and body that clients must send in their requests.
Idawscc.apigateway.methods

Fields

NameDatatypeDescription
integrationobjectIntegration is a property of the AWS::ApiGateway::Method resource that specifies information about the target backend that a method calls.
operation_namestring
request_modelsobject
rest_api_idstring
authorization_scopesarray
request_validator_idstring
request_parametersobject
method_responsesarray
authorizer_idstring
resource_idstring
api_key_requiredboolean
authorization_typestring
The method's authorization type. This parameter is required. For valid values, see Method in the API Gateway API Reference.If you specify the AuthorizerId property, specify CUSTOM or COGNITO_USER_POOLS for this property.
http_methodstring
regionstringAWS region.

For more information, see AWS::ApiGateway::Method.

Methods

NameAccessible byRequired Params
create_resourceINSERTRestApiId, ResourceId, HttpMethod, region
delete_resourceDELETEIdentifier, region
update_resourceUPDATEIdentifier, PatchDocument, region
get_resourceSELECTIdentifier, region

SELECT examples

Gets all properties from an individual method.

SELECT
region,
integration,
operation_name,
request_models,
rest_api_id,
authorization_scopes,
request_validator_id,
request_parameters,
method_responses,
authorizer_id,
resource_id,
api_key_required,
authorization_type,
http_method
FROM awscc.apigateway.methods
WHERE
region = '{{ region }}' AND
Identifier = '{{ rest_api_id }}|{{ resource_id }}|{{ http_method }}';

INSERT example

Use the following StackQL query and manifest file to create a new method resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.apigateway.methods (
RestApiId,
ResourceId,
HttpMethod,
region
)
SELECT
'{{ rest_api_id }}',
'{{ resource_id }}',
'{{ http_method }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a method resource, using stack-deploy.

/*+ update */
UPDATE awscc.apigateway.methods
SET PatchDocument = string('{{ {
"Integration": integration,
"OperationName": operation_name,
"RequestModels": request_models,
"AuthorizationScopes": authorization_scopes,
"RequestValidatorId": request_validator_id,
"RequestParameters": request_parameters,
"MethodResponses": method_responses,
"AuthorizerId": authorizer_id,
"ApiKeyRequired": api_key_required,
"AuthorizationType": authorization_type
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ rest_api_id }}|{{ resource_id }}|{{ http_method }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.apigateway.methods
WHERE
Identifier = '{{ rest_api_id }}|{{ resource_id }}|{{ http_method }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the methods resource, the following permissions are required:

apigateway:GET