Skip to main content

facets

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

Overview

Namefacets
TypeResource
Idaws.clouddirectory.facets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
facet_stylestringThere are two different styles that you can define on any given facet, Static and Dynamic. For static facets, all attributes must be defined in the schema. For dynamic facets, attributes can be defined during data plane operations. (STATIC, DYNAMIC)
namestringThe name of the Facet. (pattern: <code>^[a-zA-Z0-9._-]*$</code>)
object_typestringThe object type that is associated with the facet. See CreateFacetRequest$ObjectType for more details. (NODE, LEAF_NODE, POLICY, INDEX)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_facetselectx-amz-data-partition, regionGets details of the Facet, such as facet name, attributes, Rules, or ObjectType. You can call this on all kinds of schema facets -- published, development, or applied.
create_facetinsertx-amz-data-partition, region, NameCreates a new Facet in a schema. Facet creation is allowed only in development or applied schemas.
create_typed_link_facetinsertx-amz-data-partition, regionCreates a TypedLinkFacet. For more information, see Typed Links.
update_typed_link_facetupdatex-amz-data-partition, region, Name, AttributeUpdates, IdentityAttributeOrderUpdates a TypedLinkFacet. For more information, see Typed Links.
add_facet_to_objectupdatex-amz-data-partition, region, SchemaFacet, ObjectReferenceAdds a new Facet to an object. An object can have more than one facet applied on it.
update_facetupdatex-amz-data-partition, region, NameDoes the following: Adds new Attributes, Rules, or ObjectTypes. Updates existing Attributes, Rules, or ObjectTypes. Deletes existing Attributes, Rules, or ObjectTypes.
delete_facetdeletex-amz-data-partition, regionDeletes a given Facet. All attributes and Rules that are associated with the facet will be deleted. Only development schema facets are allowed deletion.
delete_typed_link_facetexecx-amz-data-partition, region, NameDeletes a TypedLinkFacet. For more information, see Typed Links.
remove_facet_from_objectexecx-amz-data-partition, region, SchemaFacet, ObjectReferenceRemoves the specified facet from the specified object.

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 ARN of the directory in which the object resides.

SELECT examples

Gets details of the Facet, such as facet name, attributes, Rules, or ObjectType. You can call this on all kinds of schema facets -- published, development, or applied.

SELECT
facet_style,
name,
object_type
FROM aws.clouddirectory.facets
WHERE `x-amz-data-partition` = '{{ x-amz-data-partition }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new Facet in a schema. Facet creation is allowed only in development or applied schemas.

INSERT INTO aws.clouddirectory.facets (
Name,
Attributes,
ObjectType,
FacetStyle,
`x-amz-data-partition`,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ Attributes }}',
'{{ ObjectType }}',
'{{ FacetStyle }}',
'{{ x-amz-data-partition }}',
'{{ region }}'
;

UPDATE examples

Updates a TypedLinkFacet. For more information, see Typed Links.

UPDATE aws.clouddirectory.facets
SET
Name = '{{ Name }}',
AttributeUpdates = '{{ AttributeUpdates }}',
IdentityAttributeOrder = '{{ IdentityAttributeOrder }}'
WHERE
`x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
AND Name = '{{ Name }}' --required
AND AttributeUpdates = '{{ AttributeUpdates }}' --required
AND IdentityAttributeOrder = '{{ IdentityAttributeOrder }}' --required;

DELETE examples

Deletes a given Facet. All attributes and Rules that are associated with the facet will be deleted. Only development schema facets are allowed deletion.

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

Lifecycle Methods

Deletes a TypedLinkFacet. For more information, see Typed Links.

EXEC aws.clouddirectory.facets.delete_typed_link_facet
@x-amz-data-partition='{{ x-amz-data-partition }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Name": "{{ Name }}"
}'
;