CloudDirectory.Client.
batch_write
(**kwargs)¶Performs all the write operations in a batch. Either all the operations succeed or none.
See also: AWS API Documentation
Request Syntax
response = client.batch_write(
DirectoryArn='string',
Operations=[
{
'CreateObject': {
'SchemaFacet': [
{
'SchemaArn': 'string',
'FacetName': 'string'
},
],
'ObjectAttributeList': [
{
'Key': {
'SchemaArn': 'string',
'FacetName': 'string',
'Name': 'string'
},
'Value': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
},
],
'ParentReference': {
'Selector': 'string'
},
'LinkName': 'string',
'BatchReferenceName': 'string'
},
'AttachObject': {
'ParentReference': {
'Selector': 'string'
},
'ChildReference': {
'Selector': 'string'
},
'LinkName': 'string'
},
'DetachObject': {
'ParentReference': {
'Selector': 'string'
},
'LinkName': 'string',
'BatchReferenceName': 'string'
},
'UpdateObjectAttributes': {
'ObjectReference': {
'Selector': 'string'
},
'AttributeUpdates': [
{
'ObjectAttributeKey': {
'SchemaArn': 'string',
'FacetName': 'string',
'Name': 'string'
},
'ObjectAttributeAction': {
'ObjectAttributeActionType': 'CREATE_OR_UPDATE'|'DELETE',
'ObjectAttributeUpdateValue': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
}
},
]
},
'DeleteObject': {
'ObjectReference': {
'Selector': 'string'
}
},
'AddFacetToObject': {
'SchemaFacet': {
'SchemaArn': 'string',
'FacetName': 'string'
},
'ObjectAttributeList': [
{
'Key': {
'SchemaArn': 'string',
'FacetName': 'string',
'Name': 'string'
},
'Value': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
},
],
'ObjectReference': {
'Selector': 'string'
}
},
'RemoveFacetFromObject': {
'SchemaFacet': {
'SchemaArn': 'string',
'FacetName': 'string'
},
'ObjectReference': {
'Selector': 'string'
}
},
'AttachPolicy': {
'PolicyReference': {
'Selector': 'string'
},
'ObjectReference': {
'Selector': 'string'
}
},
'DetachPolicy': {
'PolicyReference': {
'Selector': 'string'
},
'ObjectReference': {
'Selector': 'string'
}
},
'CreateIndex': {
'OrderedIndexedAttributeList': [
{
'SchemaArn': 'string',
'FacetName': 'string',
'Name': 'string'
},
],
'IsUnique': True|False,
'ParentReference': {
'Selector': 'string'
},
'LinkName': 'string',
'BatchReferenceName': 'string'
},
'AttachToIndex': {
'IndexReference': {
'Selector': 'string'
},
'TargetReference': {
'Selector': 'string'
}
},
'DetachFromIndex': {
'IndexReference': {
'Selector': 'string'
},
'TargetReference': {
'Selector': 'string'
}
},
'AttachTypedLink': {
'SourceObjectReference': {
'Selector': 'string'
},
'TargetObjectReference': {
'Selector': 'string'
},
'TypedLinkFacet': {
'SchemaArn': 'string',
'TypedLinkName': 'string'
},
'Attributes': [
{
'AttributeName': 'string',
'Value': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
},
]
},
'DetachTypedLink': {
'TypedLinkSpecifier': {
'TypedLinkFacet': {
'SchemaArn': 'string',
'TypedLinkName': 'string'
},
'SourceObjectReference': {
'Selector': 'string'
},
'TargetObjectReference': {
'Selector': 'string'
},
'IdentityAttributeValues': [
{
'AttributeName': 'string',
'Value': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
},
]
}
},
'UpdateLinkAttributes': {
'TypedLinkSpecifier': {
'TypedLinkFacet': {
'SchemaArn': 'string',
'TypedLinkName': 'string'
},
'SourceObjectReference': {
'Selector': 'string'
},
'TargetObjectReference': {
'Selector': 'string'
},
'IdentityAttributeValues': [
{
'AttributeName': 'string',
'Value': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
},
]
},
'AttributeUpdates': [
{
'AttributeKey': {
'SchemaArn': 'string',
'FacetName': 'string',
'Name': 'string'
},
'AttributeAction': {
'AttributeActionType': 'CREATE_OR_UPDATE'|'DELETE',
'AttributeUpdateValue': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
}
},
]
}
},
]
)
[REQUIRED]
The Amazon Resource Name (ARN) that is associated with the Directory. For more information, see arns.
[REQUIRED]
A list of operations that are part of the batch.
Represents the output of a BatchWrite
operation.
Creates an object.
A list of FacetArns
that will be associated with the object. For more information, see arns.
A facet.
The ARN of the schema that contains the facet with no minor component. See arns and In-Place Schema Upgrade for a description of when to provide minor versions. If this value is set, FacetName must also be set.
The name of the facet. If this value is set, SchemaArn must also be set.
An attribute map, which contains an attribute ARN as the key and attribute value as the map value.
The combination of an attribute key and an attribute value.
The key of the attribute.
The Amazon Resource Name (ARN) of the schema that contains the facet and attribute.
The name of the facet that the attribute exists within.
The name of the attribute.
The value of the attribute.
A string data value.
A binary data value.
A Boolean data value.
A number data value.
A date and time value.
If specified, the parent reference to which this object will be attached.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
The name of the link.
The batch reference name. See Transaction Support for more information.
Attaches an object to a Directory.
The parent object reference.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
The child object reference that is to be attached to the object.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
The name of the link.
Detaches an object from a Directory.
Parent reference from which the object with the specified link name is detached.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
The name of the link.
The batch reference name. See Transaction Support for more information.
Updates a given object's attributes.
Reference that identifies the object.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Attributes update structure.
Structure that contains attribute update information.
The key of the attribute being updated.
The Amazon Resource Name (ARN) of the schema that contains the facet and attribute.
The name of the facet that the attribute exists within.
The name of the attribute.
The action to perform as part of the attribute update.
A type that can be either Update
or Delete
.
The value that you want to update to.
A string data value.
A binary data value.
A Boolean data value.
A number data value.
A date and time value.
Deletes an object in a Directory.
The reference that identifies the object.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
A batch operation that adds a facet to an object.
Represents the facet being added to the object.
The ARN of the schema that contains the facet with no minor component. See arns and In-Place Schema Upgrade for a description of when to provide minor versions. If this value is set, FacetName must also be set.
The name of the facet. If this value is set, SchemaArn must also be set.
The attributes to set on the object.
The combination of an attribute key and an attribute value.
The key of the attribute.
The Amazon Resource Name (ARN) of the schema that contains the facet and attribute.
The name of the facet that the attribute exists within.
The name of the attribute.
The value of the attribute.
A string data value.
A binary data value.
A Boolean data value.
A number data value.
A date and time value.
A reference to the object being mutated.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
A batch operation that removes a facet from an object.
The facet to remove from the object.
The ARN of the schema that contains the facet with no minor component. See arns and In-Place Schema Upgrade for a description of when to provide minor versions. If this value is set, FacetName must also be set.
The name of the facet. If this value is set, SchemaArn must also be set.
A reference to the object whose facet will be removed.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Attaches a policy object to a regular object. An object can have a limited number of attached policies.
The reference that is associated with the policy object.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
The reference that identifies the object to which the policy will be attached.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Detaches a policy from a Directory.
Reference that identifies the policy object.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Reference that identifies the object whose policy object will be detached.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Creates an index object. See Indexing and search for more information.
Specifies the attributes that should be indexed on. Currently only a single attribute is supported.
A unique identifier for an attribute.
The Amazon Resource Name (ARN) of the schema that contains the facet and attribute.
The name of the facet that the attribute exists within.
The name of the attribute.
Indicates whether the attribute that is being indexed has unique values or not.
A reference to the parent object that contains the index object.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
The name of the link between the parent object and the index object.
The batch reference name. See Transaction Support for more information.
Attaches the specified object to the specified index.
A reference to the index that you are attaching the object to.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
A reference to the object that you are attaching to the index.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Detaches the specified object from the specified index.
A reference to the index object.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
A reference to the object being detached from the index.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Attaches a typed link to a specified source and target object. For more information, see Typed Links.
Identifies the source object that the typed link will attach to.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Identifies the target object that the typed link will attach to.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Identifies the typed link facet that is associated with the typed link.
The Amazon Resource Name (ARN) that is associated with the schema. For more information, see arns.
The unique name of the typed link facet.
A set of attributes that are associated with the typed link.
Identifies the attribute name and value for a typed link.
The attribute name of the typed link.
The value for the typed link.
A string data value.
A binary data value.
A Boolean data value.
A number data value.
A date and time value.
Detaches a typed link from a specified source and target object. For more information, see Typed Links.
Used to accept a typed link specifier as input.
Identifies the typed link facet that is associated with the typed link.
The Amazon Resource Name (ARN) that is associated with the schema. For more information, see arns.
The unique name of the typed link facet.
Identifies the source object that the typed link will attach to.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Identifies the target object that the typed link will attach to.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Identifies the attribute value to update.
Identifies the attribute name and value for a typed link.
The attribute name of the typed link.
The value for the typed link.
A string data value.
A binary data value.
A Boolean data value.
A number data value.
A date and time value.
Updates a given object's attributes.
Allows a typed link specifier to be accepted as input.
Identifies the typed link facet that is associated with the typed link.
The Amazon Resource Name (ARN) that is associated with the schema. For more information, see arns.
The unique name of the typed link facet.
Identifies the source object that the typed link will attach to.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Identifies the target object that the typed link will attach to.
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
Identifies the attribute value to update.
Identifies the attribute name and value for a typed link.
The attribute name of the typed link.
The value for the typed link.
A string data value.
A binary data value.
A Boolean data value.
A number data value.
A date and time value.
The attributes update structure.
Structure that contains attribute update information.
The key of the attribute being updated.
The Amazon Resource Name (ARN) of the schema that contains the facet and attribute.
The name of the facet that the attribute exists within.
The name of the attribute.
The action to perform as part of the attribute update.
A type that can be either UPDATE_OR_CREATE
or DELETE
.
The value that you want to update to.
A string data value.
A binary data value.
A Boolean data value.
A number data value.
A date and time value.
dict
Response Syntax
{
'Responses': [
{
'CreateObject': {
'ObjectIdentifier': 'string'
},
'AttachObject': {
'attachedObjectIdentifier': 'string'
},
'DetachObject': {
'detachedObjectIdentifier': 'string'
},
'UpdateObjectAttributes': {
'ObjectIdentifier': 'string'
},
'DeleteObject': {},
'AddFacetToObject': {},
'RemoveFacetFromObject': {},
'AttachPolicy': {},
'DetachPolicy': {},
'CreateIndex': {
'ObjectIdentifier': 'string'
},
'AttachToIndex': {
'AttachedObjectIdentifier': 'string'
},
'DetachFromIndex': {
'DetachedObjectIdentifier': 'string'
},
'AttachTypedLink': {
'TypedLinkSpecifier': {
'TypedLinkFacet': {
'SchemaArn': 'string',
'TypedLinkName': 'string'
},
'SourceObjectReference': {
'Selector': 'string'
},
'TargetObjectReference': {
'Selector': 'string'
},
'IdentityAttributeValues': [
{
'AttributeName': 'string',
'Value': {
'StringValue': 'string',
'BinaryValue': b'bytes',
'BooleanValue': True|False,
'NumberValue': 'string',
'DatetimeValue': datetime(2015, 1, 1)
}
},
]
}
},
'DetachTypedLink': {},
'UpdateLinkAttributes': {}
},
]
}
Response Structure
(dict) --
Responses (list) --
A list of all the responses for each batch write.
(dict) --
Represents the output of a BatchWrite
response operation.
CreateObject (dict) --
Creates an object in a Directory.
ObjectIdentifier (string) --
The ID that is associated with the object.
AttachObject (dict) --
Attaches an object to a Directory.
attachedObjectIdentifier (string) --
The ObjectIdentifier
of the object that has been attached.
DetachObject (dict) --
Detaches an object from a Directory.
detachedObjectIdentifier (string) --
The ObjectIdentifier
of the detached object.
UpdateObjectAttributes (dict) --
Updates a given object’s attributes.
ObjectIdentifier (string) --
ID that is associated with the object.
DeleteObject (dict) --
Deletes an object in a Directory.
AddFacetToObject (dict) --
The result of an add facet to object batch operation.
RemoveFacetFromObject (dict) --
The result of a batch remove facet from object operation.
AttachPolicy (dict) --
Attaches a policy object to a regular object. An object can have a limited number of attached policies.
DetachPolicy (dict) --
Detaches a policy from a Directory.
CreateIndex (dict) --
Creates an index object. See Indexing and search for more information.
ObjectIdentifier (string) --
The ObjectIdentifier
of the index created by this operation.
AttachToIndex (dict) --
Attaches the specified object to the specified index.
AttachedObjectIdentifier (string) --
The ObjectIdentifier
of the object that was attached to the index.
DetachFromIndex (dict) --
Detaches the specified object from the specified index.
DetachedObjectIdentifier (string) --
The ObjectIdentifier
of the object that was detached from the index.
AttachTypedLink (dict) --
Attaches a typed link to a specified source and target object. For more information, see Typed Links.
TypedLinkSpecifier (dict) --
Returns a typed link specifier as output.
TypedLinkFacet (dict) --
Identifies the typed link facet that is associated with the typed link.
SchemaArn (string) --
The Amazon Resource Name (ARN) that is associated with the schema. For more information, see arns.
TypedLinkName (string) --
The unique name of the typed link facet.
SourceObjectReference (dict) --
Identifies the source object that the typed link will attach to.
Selector (string) --
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
TargetObjectReference (dict) --
Identifies the target object that the typed link will attach to.
Selector (string) --
A path selector supports easy selection of an object by the parent/child links leading to it from the directory root. Use the link names from each parent/child link to construct the path. Path selectors start with a slash (/) and link names are separated by slashes. For more information about paths, see Access Objects. You can identify an object in one of the following ways:
IdentityAttributeValues (list) --
Identifies the attribute value to update.
(dict) --
Identifies the attribute name and value for a typed link.
AttributeName (string) --
The attribute name of the typed link.
Value (dict) --
The value for the typed link.
StringValue (string) --
A string data value.
BinaryValue (bytes) --
A binary data value.
BooleanValue (boolean) --
A Boolean data value.
NumberValue (string) --
A number data value.
DatetimeValue (datetime) --
A date and time value.
DetachTypedLink (dict) --
Detaches a typed link from a specified source and target object. For more information, see Typed Links.
UpdateLinkAttributes (dict) --
Represents the output of a BatchWrite
response operation.
Exceptions
CloudDirectory.Client.exceptions.InternalServiceException
CloudDirectory.Client.exceptions.InvalidArnException
CloudDirectory.Client.exceptions.RetryableConflictException
CloudDirectory.Client.exceptions.ValidationException
CloudDirectory.Client.exceptions.LimitExceededException
CloudDirectory.Client.exceptions.AccessDeniedException
CloudDirectory.Client.exceptions.DirectoryNotEnabledException
CloudDirectory.Client.exceptions.BatchWriteException