resources
Creates, updates, deletes, gets or lists a resources resource.
Overview
| Name | resources |
| Type | Resource |
| Id | aws.apigateway.resources |
Fields
The following fields are returned by SELECT queries:
- get_resource
- get_resources
| Name | Datatype | Description |
|---|---|---|
id | string | The resource's identifier. |
parent_id | string | The parent resource's identifier. |
path | string | The full path for this resource. |
path_part | string | The last path segment for this resource. |
resource_methods | object | Gets an API resource's method of a given HTTP verb. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource's identifier. |
parent_id | string | The parent resource's identifier. |
path | string | The full path for this resource. |
path_part | string | The last path segment for this resource. |
resource_methods | object | Gets an API resource's method of a given HTTP verb. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resource | select | restapi_id, resource_id, region | embed | Lists information about a resource. |
get_resources | select | restapi_id, region | position, limit, embed | Lists information about a collection of Resource resources. |
create_resource | insert | restapi_id, parent_id, region, pathPart | Creates a Resource resource. | |
update_resource | update | restapi_id, resource_id, region | Changes information about a Resource resource. | |
delete_resource | delete | restapi_id, resource_id, region | Deletes a Resource resource. | |
test_invoke_method | exec | restapi_id, resource_id, http_method, region | Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
http_method | string | Specifies a test invoke method request's HTTP method. |
parent_id | string | The parent resource's identifier. |
region | string | AWS region (default: us-east-1) |
resource_id | string | Specifies a test invoke method request's resource ID. |
restapi_id | string | The string identifier of the associated RestApi. |
embed | array | A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This embed parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the "methods" string. For example, GET /restapis/{restapi_id}/resources?embed=methods. |
limit | integer | The maximum number of returned results per page. The default value is 25 and the maximum value is 500. |
position | string | The current pagination position in the paged result set. |
SELECT examples
- get_resource
- get_resources
Lists information about a resource.
SELECT
id,
parent_id,
path,
path_part,
resource_methods
FROM aws.apigateway.resources
WHERE restapi_id = '{{ restapi_id }}' -- required
AND resource_id = '{{ resource_id }}' -- required
AND region = '{{ region }}' -- required
AND embed = '{{ embed }}'
;
Lists information about a collection of Resource resources.
SELECT
id,
parent_id,
path,
path_part,
resource_methods
FROM aws.apigateway.resources
WHERE restapi_id = '{{ restapi_id }}' -- required
AND region = '{{ region }}' -- required
AND position = '{{ position }}'
AND limit = '{{ limit }}'
AND embed = '{{ embed }}'
;
INSERT examples
- create_resource
- Manifest
Creates a Resource resource.
INSERT INTO aws.apigateway.resources (
pathPart,
restapi_id,
parent_id,
region
)
SELECT
'{{ pathPart }}' /* required */,
'{{ restapi_id }}',
'{{ parent_id }}',
'{{ region }}'
RETURNING
id,
parent_id,
path,
path_part,
resource_methods
;
# Description fields are for documentation purposes
- name: resources
props:
- name: restapi_id
value: "{{ restapi_id }}"
description: Required parameter for the resources resource.
- name: parent_id
value: "{{ parent_id }}"
description: Required parameter for the resources resource.
- name: region
value: "{{ region }}"
description: Required parameter for the resources resource.
- name: pathPart
value: "{{ pathPart }}"
UPDATE examples
- update_resource
Changes information about a Resource resource.
UPDATE aws.apigateway.resources
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
parent_id,
path,
path_part,
resource_methods;
DELETE examples
- delete_resource
Deletes a Resource resource.
DELETE FROM aws.apigateway.resources
WHERE restapi_id = '{{ restapi_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- test_invoke_method
Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.
EXEC aws.apigateway.resources.test_invoke_method
@restapi_id='{{ restapi_id }}' --required,
@resource_id='{{ resource_id }}' --required,
@http_method='{{ http_method }}' --required,
@region='{{ region }}' --required
@@json=
'{
"pathWithQueryString": "{{ pathWithQueryString }}",
"body": "{{ body }}",
"headers": "{{ headers }}",
"multiValueHeaders": "{{ multiValueHeaders }}",
"clientCertificateId": "{{ clientCertificateId }}",
"stageVariables": "{{ stageVariables }}"
}'
;