create_index
async
¶
create_index(
directory_arn: Arn,
ordered_indexed_attribute_list: AttributeKeyList,
is_unique: Bool,
*,
config_overrides: Optional[AsyncCloudDirectoryClientConfig] = None,
parent_reference: Optional[ObjectReference] = None,
link_name: Optional[LinkName] = None,
) -> CreateIndexResponse
Creates an index object. See Indexing and search for more information.
Parameters:
-
directory_arn(Arn) –The ARN of the directory where the index should be created.
-
ordered_indexed_attribute_list(AttributeKeyList) –Specifies the attributes that should be indexed on. Currently only a single attribute is supported.
-
is_unique(Bool) –Indicates whether the attribute that is being indexed has unique values or not.
-
parent_reference(Optional[ObjectReference], default:None) –A reference to the parent object that contains the index object.
-
link_name(Optional[LinkName], default:None) –The name of the link between the parent object and the index object.
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 index
>>> await client.create_index(directory_arn='arn:aws:clouddirectory:us-west-2:45132example:directory/AXQXDXvdgkOWktRXV4HnRa8', ordered_indexed_attribute_list=[], is_unique=True, parent_reference={}, link_name='Examplelink')
Source code in docs_src/capo_clouddirectory/_services/async_cloud_directory.py
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 | |