facets
Creates, updates, deletes, gets or lists a facets resource.
Overview
| Name | facets |
| Type | Resource |
| Id | aws.clouddirectory.facets |
Fields
The following fields are returned by SELECT queries:
- get_facet
| Name | Datatype | Description |
|---|---|---|
facet_style | string | There 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) |
name | string | The name of the Facet. (pattern: <code>^[a-zA-Z0-9._-]*$</code>) |
object_type | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_facet | select | x-amz-data-partition, region | 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. | |
create_facet | insert | x-amz-data-partition, region, Name | Creates a new Facet in a schema. Facet creation is allowed only in development or applied schemas. | |
create_typed_link_facet | insert | x-amz-data-partition, region | Creates a TypedLinkFacet. For more information, see Typed Links. | |
update_typed_link_facet | update | x-amz-data-partition, region, Name, AttributeUpdates, IdentityAttributeOrder | Updates a TypedLinkFacet. For more information, see Typed Links. | |
add_facet_to_object | update | x-amz-data-partition, region, SchemaFacet, ObjectReference | Adds a new Facet to an object. An object can have more than one facet applied on it. | |
update_facet | update | x-amz-data-partition, region, Name | Does the following: Adds new Attributes, Rules, or ObjectTypes. Updates existing Attributes, Rules, or ObjectTypes. Deletes existing Attributes, Rules, or ObjectTypes. | |
delete_facet | delete | x-amz-data-partition, region | 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_typed_link_facet | exec | x-amz-data-partition, region, Name | Deletes a TypedLinkFacet. For more information, see Typed Links. | |
remove_facet_from_object | exec | x-amz-data-partition, region, SchemaFacet, ObjectReference | Removes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
x-amz-data-partition | string | The ARN of the directory in which the object resides. |
SELECT examples
- get_facet
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
- create_facet
- create_typed_link_facet
- Manifest
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 }}'
;
Creates a TypedLinkFacet. For more information, see Typed Links.
INSERT INTO aws.clouddirectory.facets (
Facet,
`x-amz-data-partition`,
region
)
SELECT
'{{ Facet }}',
'{{ x-amz-data-partition }}',
'{{ region }}'
;
# Description fields are for documentation purposes
- name: facets
props:
- name: x-amz-data-partition
value: "{{ x-amz-data-partition }}"
description: Required parameter for the facets resource.
- name: region
value: "{{ region }}"
description: Required parameter for the facets resource.
- name: Name
value: "{{ Name }}"
- name: Attributes
value:
- Name: "{{ Name }}"
AttributeDefinition:
Type: "{{ Type }}"
DefaultValue:
StringValue: "{{ StringValue }}"
BinaryValue: "{{ BinaryValue }}"
BooleanValue: {{ BooleanValue }}
NumberValue: "{{ NumberValue }}"
DatetimeValue: "{{ DatetimeValue }}"
IsImmutable: {{ IsImmutable }}
Rules: "{{ Rules }}"
AttributeReference:
TargetFacetName: "{{ TargetFacetName }}"
TargetAttributeName: "{{ TargetAttributeName }}"
RequiredBehavior: "{{ RequiredBehavior }}"
- name: ObjectType
value: "{{ ObjectType }}"
valid_values: ['NODE', 'LEAF_NODE', 'POLICY', 'INDEX']
- name: FacetStyle
value: "{{ FacetStyle }}"
valid_values: ['STATIC', 'DYNAMIC']
- name: Facet
description: |
Defines the typed links structure and its attributes. To create a typed link facet, use the CreateTypedLinkFacet API.
value:
Name: "{{ Name }}"
Attributes:
- Name: "{{ Name }}"
Type: "{{ Type }}"
DefaultValue:
StringValue: "{{ StringValue }}"
BinaryValue: "{{ BinaryValue }}"
BooleanValue: {{ BooleanValue }}
NumberValue: "{{ NumberValue }}"
DatetimeValue: "{{ DatetimeValue }}"
IsImmutable: {{ IsImmutable }}
Rules: "{{ Rules }}"
RequiredBehavior: "{{ RequiredBehavior }}"
IdentityAttributeOrder:
- "{{ IdentityAttributeOrder }}"
UPDATE examples
- update_typed_link_facet
- add_facet_to_object
- update_facet
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;
Adds a new Facet to an object. An object can have more than one facet applied on it.
UPDATE aws.clouddirectory.facets
SET
SchemaFacet = '{{ SchemaFacet }}',
ObjectAttributeList = '{{ ObjectAttributeList }}',
ObjectReference = '{{ ObjectReference }}'
WHERE
`x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
AND SchemaFacet = '{{ SchemaFacet }}' --required
AND ObjectReference = '{{ ObjectReference }}' --required;
Does the following: Adds new Attributes, Rules, or ObjectTypes. Updates existing Attributes, Rules, or ObjectTypes. Deletes existing Attributes, Rules, or ObjectTypes.
UPDATE aws.clouddirectory.facets
SET
Name = '{{ Name }}',
AttributeUpdates = '{{ AttributeUpdates }}',
ObjectType = '{{ ObjectType }}'
WHERE
`x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
AND Name = '{{ Name }}' --required;
DELETE examples
- delete_facet
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
- delete_typed_link_facet
- remove_facet_from_object
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 }}"
}'
;
Removes the specified facet from the specified object.
EXEC aws.clouddirectory.facets.remove_facet_from_object
@x-amz-data-partition='{{ x-amz-data-partition }}' --required,
@region='{{ region }}' --required
@@json=
'{
"SchemaFacet": "{{ SchemaFacet }}",
"ObjectReference": "{{ ObjectReference }}"
}'
;