Skip to main content

documentation_parts

Creates, updates, deletes, gets or lists a documentation_parts resource.

Overview

Namedocumentation_parts
TypeResource
Idaws.apigateway.documentation_parts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe DocumentationPart identifier, generated by API Gateway when the DocumentationPart is created.
locationobjectSpecifies the target API entity to which the documentation applies.
properties_stringA 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 the properties map are exported and, hence, published as part of the API entity definitions, while the original documentation parts are exported in a OpenAPI extension of x-amazon-apigateway-documentation.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_documentation_partselectrestapi_id, part_id, regionGets a documentation part.
get_documentation_partsselectrestapi_id, regiontype, name, path, position, limit, locationStatusGets documentation parts.
create_documentation_partinsertrestapi_id, region, location, propertiesCreates a documentation part.
update_documentation_partupdaterestapi_id, part_id, regionUpdates a documentation part.
delete_documentation_partdeleterestapi_id, part_id, regionDeletes a documentation part
import_documentation_partsexecrestapi_id, region, bodymode, failonwarningsImports documentation parts

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.

NameDatatypeDescription
part_idstringThe identifier of the to-be-deleted documentation part.
regionstringAWS region (default: us-east-1)
restapi_idstringThe string identifier of the associated RestApi.
failonwarningsbooleanA query parameter to specify whether to rollback the documentation importation (true) or not (false) when a warning is encountered. The default value is false.
limitintegerThe maximum number of returned results per page. The default value is 25 and the maximum value is 500.
locationStatusstringThe status of the API documentation parts to retrieve. Valid values are DOCUMENTED for retrieving DocumentationPart resources with content and UNDOCUMENTED for DocumentationPart resources without content.
modestringA query parameter to indicate whether to overwrite (overwrite) any existing DocumentationParts definition or to merge (merge) the new definition into the existing one. The default value is merge.
namestringThe name of API entities of the to-be-retrieved documentation parts.
pathstringThe path of API entities of the to-be-retrieved documentation parts.
positionstringThe current pagination position in the paged result set.
typestringThe type of API entities of the to-be-retrieved documentation parts.

SELECT examples

Gets a documentation part.

SELECT
id,
location,
properties_
FROM aws.apigateway.documentation_parts
WHERE restapi_id = '{{ restapi_id }}' -- required
AND part_id = '{{ part_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a documentation part.

INSERT INTO aws.apigateway.documentation_parts (
location,
properties,
restapi_id,
region
)
SELECT
'{{ location }}' /* required */,
'{{ properties }}' /* required */,
'{{ restapi_id }}',
'{{ region }}'
RETURNING
id,
location,
properties_
;

UPDATE examples

Updates a documentation part.

UPDATE aws.apigateway.documentation_parts
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND part_id = '{{ part_id }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
location,
properties_;

DELETE examples

Deletes a documentation part

DELETE FROM aws.apigateway.documentation_parts
WHERE restapi_id = '{{ restapi_id }}' --required
AND part_id = '{{ part_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Imports documentation parts

EXEC aws.apigateway.documentation_parts.import_documentation_parts
@restapi_id='{{ restapi_id }}' --required,
@region='{{ region }}' --required,
@mode='{{ mode }}',
@failonwarnings={{ failonwarnings }}
@@json=
'{
"body": "{{ body }}"
}'
;