create_facet
¶
create_facet(
schema_arn: Arn,
name: FacetName,
*,
config_overrides: Optional[CloudDirectoryClientConfig] = None,
attributes: Optional[FacetAttributeList] = None,
object_type: Optional[ObjectType] = None,
facet_style: Optional[FacetStyle] = None,
) -> CreateFacetResponse
Creates a new Facet in a schema. Facet creation is allowed only in development or applied schemas.
Parameters:
-
schema_arn(Arn) – -
name(FacetName) –The name of the Facet, which is unique for a given schema.
-
attributes(Optional[FacetAttributeList], default:None) –The attributes that are associated with the Facet.
-
object_type(Optional[ObjectType], default:None) –Specifies whether a given object created from this facet is of type node, leaf node, policy or index.
-
Node: Can have multiple children but one parent.
-
Leaf node: Cannot have children but can have multiple parents.
-
Policy: Allows you to store a policy document and policy type. For more information, see Policies.
-
Index: Can be created with the Index API.
-
-
facet_style(Optional[FacetStyle], default:None) –There are two different styles that you can define on any given facet,
StaticandDynamic. For static facets, all attributes must be defined in the schema. For dynamic facets, attributes can be defined during data plane operations.
Raises:
-
AccessDeniedException–Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling ListDirectories and check your permissions.
-
FacetAlreadyExistsException–A facet with the same name already exists.
-
FacetValidationException–The Facet that you provided was not well formed or could not be validated with the schema.
-
InternalServiceException–Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the AWS Service Health Dashboard site to see if there are any operational issues with the service.
-
InvalidArnException–Indicates that the provided ARN value is not valid.
-
InvalidRuleException–Occurs when any of the rule parameter keys or values are invalid.
-
LimitExceededException–Indicates that limits are exceeded. See Limits for more information.
-
ResourceNotFoundException–The specified resource could not be found.
-
RetryableConflictException–Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.
-
ValidationException–Indicates that your request is malformed in some manner. See the exception message.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a facet
>>> client.create_facet(schema_arn='arn:aws:clouddirectory:us-west-2:45132example:directory/AYb8AOV81kHNgdj8mAO3dNY/schema/org/1', name='node1', object_type='NODE')
Source code in docs_src/capo_clouddirectory/_services/cloud_directory.py
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | |