create_object
¶
create_object(
directory_arn: Arn,
schema_facets: SchemaFacetList,
*,
config_overrides: Optional[CloudDirectoryClientConfig] = None,
object_attribute_list: Optional[AttributeKeyAndValueList] = None,
parent_reference: Optional[ObjectReference] = None,
link_name: Optional[LinkName] = None,
) -> CreateObjectResponse
Creates an object in a Directory. Additionally attaches the object to a parent, if a parent reference and LinkName is specified. An object is simply a collection of Facet attributes. You can also use this API call to create a policy object, if the facet from which you create the object is a policy facet.
Parameters:
-
directory_arn(Arn) – -
schema_facets(SchemaFacetList) –A list of schema facets to be associated with the object. Do not provide minor version components. See SchemaFacet for details.
-
object_attribute_list(Optional[AttributeKeyAndValueList], default:None) –The attribute map whose attribute ARN contains the key and attribute value as the map value.
-
parent_reference(Optional[ObjectReference], default:None) –If specified, the parent reference to which this object will be attached.
-
link_name(Optional[LinkName], default:None) –The name of link that is used to attach this object to a parent.
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.
-
DirectoryNotEnabledException–Operations are only permitted on enabled directories.
-
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.
-
LimitExceededException–Indicates that limits are exceeded. See Limits for more information.
-
LinkNameAlreadyInUseException–Indicates that a link could not be created due to a naming conflict. Choose a different name and then try again.
-
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.
-
UnsupportedIndexTypeException–Indicates that the requested index type is not supported.
-
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 an object
>>> client.create_object(directory_arn='arn:aws:clouddirectory:us-west-2:45132example:directory/AXQXDXvdgkOWktRXV4HnRa8', schema_facets=[{'SchemaArn': 'arn:aws:clouddirectory:us-west-2:45132example:directory/AXQXDXvdgkOWktRXV4HnRa8/schema/ExampleOrgPersonSchema/1', 'FacetName': 'Organization_Person'}])
Source code in docs_src/capo_clouddirectory/_services/cloud_directory.py
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 | |