Skip to main content

schemas

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

Overview

Nameschemas
TypeResource
Idaws.clouddirectory.schemas

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
create_schemainsertregion, NameCreates a new schema in a development state. A schema can exist in three phases: Development: This is a mutable phase of the schema. All new schemas are in the development phase. Once the schema is finalized, it can be published. Published: Published schemas are immutable and have a version associated with them. Applied: Applied schemas are mutable in a way that allows you to add new schema facets. You can also add new, nonrequired attributes to existing schema facets. You can apply only published schemas to directories.
update_schemaupdatex-amz-data-partition, region, NameUpdates the schema name with a new name. Only development schema names can be updated.
delete_schemadeletex-amz-data-partition, regionDeletes a given schema. Schemas in a development and published state can only be deleted.

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
regionstringAWS region (default: us-east-1)
x-amz-data-partitionstringThe Amazon Resource Name (ARN) of the development schema. For more information, see arns.

INSERT examples

Creates a new schema in a development state. A schema can exist in three phases: Development: This is a mutable phase of the schema. All new schemas are in the development phase. Once the schema is finalized, it can be published. Published: Published schemas are immutable and have a version associated with them. Applied: Applied schemas are mutable in a way that allows you to add new schema facets. You can also add new, nonrequired attributes to existing schema facets. You can apply only published schemas to directories.

INSERT INTO aws.clouddirectory.schemas (
Name,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ region }}'
RETURNING
schema_arn
;

UPDATE examples

Updates the schema name with a new name. Only development schema names can be updated.

UPDATE aws.clouddirectory.schemas
SET
Name = '{{ Name }}'
WHERE
`x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
AND Name = '{{ Name }}' --required
RETURNING
schema_arn;

DELETE examples

Deletes a given schema. Schemas in a development and published state can only be deleted.

DELETE FROM aws.clouddirectory.schemas
WHERE `x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
;