You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::CloudDirectory::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CloudDirectory::Client
- Defined in:
- (unknown)
Overview
An API client for Amazon CloudDirectory. To construct a client, you need to configure a :region
and :credentials
.
clouddirectory = Aws::CloudDirectory::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::CloudDirectory::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::CloudDirectory::Client
constructor
Constructs an API client.
API Operations collapse
-
#add_facet_to_object(options = {}) ⇒ Struct
Adds a new Facet to an object.
-
#apply_schema(options = {}) ⇒ Types::ApplySchemaResponse
Copies the input published schema, at the specified version, into the Directory with the same name and version as that of the published schema.
.
-
#attach_object(options = {}) ⇒ Types::AttachObjectResponse
Attaches an existing object to another object.
-
#attach_policy(options = {}) ⇒ Struct
Attaches a policy object to a regular object.
-
#attach_to_index(options = {}) ⇒ Types::AttachToIndexResponse
Attaches the specified object to the specified index.
.
-
#attach_typed_link(options = {}) ⇒ Types::AttachTypedLinkResponse
Attaches a typed link to a specified source and target object.
-
#batch_read(options = {}) ⇒ Types::BatchReadResponse
Performs all the read operations in a batch.
-
#batch_write(options = {}) ⇒ Types::BatchWriteResponse
Performs all the write operations in a batch.
-
#create_directory(options = {}) ⇒ Types::CreateDirectoryResponse
Creates a Directory by copying the published schema into the directory.
-
#create_facet(options = {}) ⇒ Struct
Creates a new Facet in a schema.
-
#create_index(options = {}) ⇒ Types::CreateIndexResponse
Creates an index object.
-
#create_object(options = {}) ⇒ Types::CreateObjectResponse
Creates an object in a Directory.
-
#create_schema(options = {}) ⇒ Types::CreateSchemaResponse
Creates a new schema in a development state.
-
#create_typed_link_facet(options = {}) ⇒ Struct
Creates a TypedLinkFacet.
-
#delete_directory(options = {}) ⇒ Types::DeleteDirectoryResponse
Deletes a directory.
-
#delete_facet(options = {}) ⇒ Struct
Deletes a given Facet.
-
#delete_object(options = {}) ⇒ Struct
Deletes an object and its associated attributes.
-
#delete_schema(options = {}) ⇒ Types::DeleteSchemaResponse
Deletes a given schema.
-
#delete_typed_link_facet(options = {}) ⇒ Struct
Deletes a TypedLinkFacet.
-
#detach_from_index(options = {}) ⇒ Types::DetachFromIndexResponse
Detaches the specified object from the specified index.
.
-
#detach_object(options = {}) ⇒ Types::DetachObjectResponse
Detaches a given object from the parent object.
-
#detach_policy(options = {}) ⇒ Struct
Detaches a policy from an object.
.
-
#detach_typed_link(options = {}) ⇒ Struct
Detaches a typed link from a specified source and target object.
-
#disable_directory(options = {}) ⇒ Types::DisableDirectoryResponse
Disables the specified directory.
-
#enable_directory(options = {}) ⇒ Types::EnableDirectoryResponse
Enables the specified directory.
-
#get_applied_schema_version(options = {}) ⇒ Types::GetAppliedSchemaVersionResponse
Returns current applied schema version ARN, including the minor version in use.
.
-
#get_directory(options = {}) ⇒ Types::GetDirectoryResponse
Retrieves metadata about a directory.
.
- #get_facet(options = {}) ⇒ Types::GetFacetResponse
-
#get_link_attributes(options = {}) ⇒ Types::GetLinkAttributesResponse
Retrieves attributes that are associated with a typed link.
.
-
#get_object_attributes(options = {}) ⇒ Types::GetObjectAttributesResponse
Retrieves attributes within a facet that are associated with an object.
.
-
#get_object_information(options = {}) ⇒ Types::GetObjectInformationResponse
Retrieves metadata about an object.
.
-
#get_schema_as_json(options = {}) ⇒ Types::GetSchemaAsJsonResponse
Retrieves a JSON representation of the schema.
-
#get_typed_link_facet_information(options = {}) ⇒ Types::GetTypedLinkFacetInformationResponse
Returns the identity attribute order for a specific TypedLinkFacet.
-
#list_applied_schema_arns(options = {}) ⇒ Types::ListAppliedSchemaArnsResponse
Lists schema major versions applied to a directory.
-
#list_attached_indices(options = {}) ⇒ Types::ListAttachedIndicesResponse
Lists indices attached to the specified object.
.
-
#list_development_schema_arns(options = {}) ⇒ Types::ListDevelopmentSchemaArnsResponse
Retrieves each Amazon Resource Name (ARN) of schemas in the development state.
.
-
#list_directories(options = {}) ⇒ Types::ListDirectoriesResponse
Lists directories created within an account.
.
-
#list_facet_attributes(options = {}) ⇒ Types::ListFacetAttributesResponse
Retrieves attributes attached to the facet.
.
-
#list_facet_names(options = {}) ⇒ Types::ListFacetNamesResponse
Retrieves the names of facets that exist in a schema.
.
-
#list_incoming_typed_links(options = {}) ⇒ Types::ListIncomingTypedLinksResponse
Returns a paginated list of all the incoming TypedLinkSpecifier information for an object.
-
#list_index(options = {}) ⇒ Types::ListIndexResponse
Lists objects attached to the specified index.
.
-
#list_managed_schema_arns(options = {}) ⇒ Types::ListManagedSchemaArnsResponse
Lists the major version families of each managed schema.
-
#list_object_attributes(options = {}) ⇒ Types::ListObjectAttributesResponse
Lists all attributes that are associated with an object.
-
#list_object_children(options = {}) ⇒ Types::ListObjectChildrenResponse
Returns a paginated list of child objects that are associated with a given object.
.
-
#list_object_parent_paths(options = {}) ⇒ Types::ListObjectParentPathsResponse
Retrieves all available parent paths for any object type such as node, leaf node, policy node, and index node objects.
-
#list_object_parents(options = {}) ⇒ Types::ListObjectParentsResponse
Lists parent objects that are associated with a given object in pagination fashion.
.
-
#list_object_policies(options = {}) ⇒ Types::ListObjectPoliciesResponse
Returns policies attached to an object in pagination fashion.
.
-
#list_outgoing_typed_links(options = {}) ⇒ Types::ListOutgoingTypedLinksResponse
Returns a paginated list of all the outgoing TypedLinkSpecifier information for an object.
-
#list_policy_attachments(options = {}) ⇒ Types::ListPolicyAttachmentsResponse
Returns all of the
ObjectIdentifiers
to which a given policy is attached..
-
#list_published_schema_arns(options = {}) ⇒ Types::ListPublishedSchemaArnsResponse
Lists the major version families of each published schema.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Returns tags for a resource.
-
#list_typed_link_facet_attributes(options = {}) ⇒ Types::ListTypedLinkFacetAttributesResponse
Returns a paginated list of all attribute definitions for a particular TypedLinkFacet.
-
#list_typed_link_facet_names(options = {}) ⇒ Types::ListTypedLinkFacetNamesResponse
Returns a paginated list of
TypedLink
facet names for a particular schema. -
#lookup_policy(options = {}) ⇒ Types::LookupPolicyResponse
Lists all policies from the root of the Directory to the object specified.
-
#publish_schema(options = {}) ⇒ Types::PublishSchemaResponse
Publishes a development schema with a major version and a recommended minor version.
.
-
#put_schema_from_json(options = {}) ⇒ Types::PutSchemaFromJsonResponse
Allows a schema to be updated using JSON upload.
-
#remove_facet_from_object(options = {}) ⇒ Struct
Removes the specified facet from the specified object.
.
-
#tag_resource(options = {}) ⇒ Struct
An API operation for adding tags to a resource.
.
-
#untag_resource(options = {}) ⇒ Struct
An API operation for removing tags from a resource.
.
-
#update_facet(options = {}) ⇒ Struct
Does the following:
-
Adds new
Attributes
,Rules
, orObjectTypes
. -
Updates existing
Attributes
,Rules
, orObjectTypes
. -
Deletes existing
Attributes
,Rules
, orObjectTypes
.
-
-
#update_link_attributes(options = {}) ⇒ Struct
Updates a given typed link’s attributes.
-
#update_object_attributes(options = {}) ⇒ Types::UpdateObjectAttributesResponse
Updates a given object's attributes.
.
-
#update_schema(options = {}) ⇒ Types::UpdateSchemaResponse
Updates the schema name with a new name.
-
#update_typed_link_facet(options = {}) ⇒ Struct
Updates a TypedLinkFacet.
-
#upgrade_applied_schema(options = {}) ⇒ Types::UpgradeAppliedSchemaResponse
Upgrades a single directory in-place using the
PublishedSchemaArn
with schema updates found inMinorVersion
. -
#upgrade_published_schema(options = {}) ⇒ Types::UpgradePublishedSchemaResponse
Upgrades a published schema under a new minor version revision using the current contents of
DevelopmentSchemaArn
..
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Methods inherited from Seahorse::Client::Base
add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options = {}) ⇒ Aws::CloudDirectory::Client
Constructs an API client.
Instance Method Details
#add_facet_to_object(options = {}) ⇒ Struct
Adds a new Facet to an object. An object can have more than one facet applied on it.
#apply_schema(options = {}) ⇒ Types::ApplySchemaResponse
Copies the input published schema, at the specified version, into the Directory with the same name and version as that of the published schema.
#attach_object(options = {}) ⇒ Types::AttachObjectResponse
Attaches an existing object to another object. An object can be accessed in two ways:
-
Using the path
-
Using
ObjectIdentifier
#attach_policy(options = {}) ⇒ Struct
Attaches a policy object to a regular object. An object can have a limited number of attached policies.
#attach_to_index(options = {}) ⇒ Types::AttachToIndexResponse
Attaches the specified object to the specified index.
#attach_typed_link(options = {}) ⇒ Types::AttachTypedLinkResponse
Attaches a typed link to a specified source and target object. For more information, see Typed Links.
#batch_read(options = {}) ⇒ Types::BatchReadResponse
Performs all the read operations in a batch.
#batch_write(options = {}) ⇒ Types::BatchWriteResponse
Performs all the write operations in a batch. Either all the operations succeed or none.
#create_directory(options = {}) ⇒ Types::CreateDirectoryResponse
Creates a Directory by copying the published schema into the directory. A directory cannot be created without a schema.
You can also quickly create a directory using a managed schema, called the QuickStartSchema
. For more information, see Managed Schema in the Amazon Cloud Directory Developer Guide.
#create_facet(options = {}) ⇒ Struct
Creates a new Facet in a schema. Facet creation is allowed only in development or applied schemas.
#create_index(options = {}) ⇒ Types::CreateIndexResponse
Creates an index object. See Indexing and search for more information.
#create_object(options = {}) ⇒ Types::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.
#create_schema(options = {}) ⇒ Types::CreateSchemaResponse
Creates a new schema in a development state. A schema can exist in three phases:
-
Development: This is a mutable phase of the schema. All new schemas are in the development phase. Once the schema is finalized, it can be published.
-
Published: Published schemas are immutable and have a version associated with them.
-
Applied: Applied schemas are mutable in a way that allows you to add new schema facets. You can also add new, nonrequired attributes to existing schema facets. You can apply only published schemas to directories.
#create_typed_link_facet(options = {}) ⇒ Struct
Creates a TypedLinkFacet. For more information, see Typed Links.
#delete_directory(options = {}) ⇒ Types::DeleteDirectoryResponse
Deletes a directory. Only disabled directories can be deleted. A deleted directory cannot be undone. Exercise extreme caution when deleting directories.
#delete_facet(options = {}) ⇒ Struct
#delete_object(options = {}) ⇒ Struct
Deletes an object and its associated attributes. Only objects with no children and no parents can be deleted. The maximum number of attributes that can be deleted during an object deletion is 30. For more information, see Amazon Cloud Directory Limits.
#delete_schema(options = {}) ⇒ Types::DeleteSchemaResponse
Deletes a given schema. Schemas in a development and published state can only be deleted.
#delete_typed_link_facet(options = {}) ⇒ Struct
Deletes a TypedLinkFacet. For more information, see Typed Links.
#detach_from_index(options = {}) ⇒ Types::DetachFromIndexResponse
Detaches the specified object from the specified index.
#detach_object(options = {}) ⇒ Types::DetachObjectResponse
Detaches a given object from the parent object. The object that is to be detached from the parent is specified by the link name.
#detach_policy(options = {}) ⇒ Struct
Detaches a policy from an object.
#detach_typed_link(options = {}) ⇒ Struct
Detaches a typed link from a specified source and target object. For more information, see Typed Links.
#disable_directory(options = {}) ⇒ Types::DisableDirectoryResponse
Disables the specified directory. Disabled directories cannot be read or written to. Only enabled directories can be disabled. Disabled directories may be reenabled.
#enable_directory(options = {}) ⇒ Types::EnableDirectoryResponse
Enables the specified directory. Only disabled directories can be enabled. Once enabled, the directory can then be read and written to.
#get_applied_schema_version(options = {}) ⇒ Types::GetAppliedSchemaVersionResponse
Returns current applied schema version ARN, including the minor version in use.
#get_directory(options = {}) ⇒ Types::GetDirectoryResponse
Retrieves metadata about a directory.
#get_facet(options = {}) ⇒ Types::GetFacetResponse
#get_link_attributes(options = {}) ⇒ Types::GetLinkAttributesResponse
Retrieves attributes that are associated with a typed link.
#get_object_attributes(options = {}) ⇒ Types::GetObjectAttributesResponse
Retrieves attributes within a facet that are associated with an object.
#get_object_information(options = {}) ⇒ Types::GetObjectInformationResponse
Retrieves metadata about an object.
#get_schema_as_json(options = {}) ⇒ Types::GetSchemaAsJsonResponse
Retrieves a JSON representation of the schema. See JSON Schema Format for more information.
#get_typed_link_facet_information(options = {}) ⇒ Types::GetTypedLinkFacetInformationResponse
Returns the identity attribute order for a specific TypedLinkFacet. For more information, see Typed Links.
#list_applied_schema_arns(options = {}) ⇒ Types::ListAppliedSchemaArnsResponse
Lists schema major versions applied to a directory. If SchemaArn
is provided, lists the minor version.
#list_attached_indices(options = {}) ⇒ Types::ListAttachedIndicesResponse
Lists indices attached to the specified object.
#list_development_schema_arns(options = {}) ⇒ Types::ListDevelopmentSchemaArnsResponse
Retrieves each Amazon Resource Name (ARN) of schemas in the development state.
#list_directories(options = {}) ⇒ Types::ListDirectoriesResponse
Lists directories created within an account.
#list_facet_attributes(options = {}) ⇒ Types::ListFacetAttributesResponse
Retrieves attributes attached to the facet.
#list_facet_names(options = {}) ⇒ Types::ListFacetNamesResponse
Retrieves the names of facets that exist in a schema.
#list_incoming_typed_links(options = {}) ⇒ Types::ListIncomingTypedLinksResponse
Returns a paginated list of all the incoming TypedLinkSpecifier information for an object. It also supports filtering by typed link facet and identity attributes. For more information, see Typed Links.
#list_index(options = {}) ⇒ Types::ListIndexResponse
Lists objects attached to the specified index.
#list_managed_schema_arns(options = {}) ⇒ Types::ListManagedSchemaArnsResponse
Lists the major version families of each managed schema. If a major version ARN is provided as SchemaArn, the minor version revisions in that family are listed instead.
#list_object_attributes(options = {}) ⇒ Types::ListObjectAttributesResponse
Lists all attributes that are associated with an object.
#list_object_children(options = {}) ⇒ Types::ListObjectChildrenResponse
Returns a paginated list of child objects that are associated with a given object.
#list_object_parent_paths(options = {}) ⇒ Types::ListObjectParentPathsResponse
Retrieves all available parent paths for any object type such as node, leaf node, policy node, and index node objects. For more information about objects, see Directory Structure.
Use this API to evaluate all parents for an object. The call returns all objects from the root of the directory up to the requested object. The API returns the number of paths based on user-defined MaxResults
, in case there are multiple paths to the parent. The order of the paths and nodes returned is consistent among multiple API calls unless the objects are deleted or moved. Paths not leading to the directory root are ignored from the target object.
#list_object_parents(options = {}) ⇒ Types::ListObjectParentsResponse
Lists parent objects that are associated with a given object in pagination fashion.
#list_object_policies(options = {}) ⇒ Types::ListObjectPoliciesResponse
Returns policies attached to an object in pagination fashion.
#list_outgoing_typed_links(options = {}) ⇒ Types::ListOutgoingTypedLinksResponse
Returns a paginated list of all the outgoing TypedLinkSpecifier information for an object. It also supports filtering by typed link facet and identity attributes. For more information, see Typed Links.
#list_policy_attachments(options = {}) ⇒ Types::ListPolicyAttachmentsResponse
Returns all of the ObjectIdentifiers
to which a given policy is attached.
#list_published_schema_arns(options = {}) ⇒ Types::ListPublishedSchemaArnsResponse
Lists the major version families of each published schema. If a major version ARN is provided as SchemaArn
, the minor version revisions in that family are listed instead.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Returns tags for a resource. Tagging is currently supported only for directories with a limit of 50 tags per directory. All 50 tags are returned for a given directory with this API call.
#list_typed_link_facet_attributes(options = {}) ⇒ Types::ListTypedLinkFacetAttributesResponse
Returns a paginated list of all attribute definitions for a particular TypedLinkFacet. For more information, see Typed Links.
#list_typed_link_facet_names(options = {}) ⇒ Types::ListTypedLinkFacetNamesResponse
Returns a paginated list of TypedLink
facet names for a particular schema. For more information, see Typed Links.
#lookup_policy(options = {}) ⇒ Types::LookupPolicyResponse
Lists all policies from the root of the Directory to the object specified. If there are no policies present, an empty list is returned. If policies are present, and if some objects don't have the policies attached, it returns the ObjectIdentifier
for such objects. If policies are present, it returns ObjectIdentifier
, policyId
, and policyType
. Paths that don't lead to the root from the target object are ignored. For more information, see Policies.
#publish_schema(options = {}) ⇒ Types::PublishSchemaResponse
Publishes a development schema with a major version and a recommended minor version.
#put_schema_from_json(options = {}) ⇒ Types::PutSchemaFromJsonResponse
Allows a schema to be updated using JSON upload. Only available for development schemas. See JSON Schema Format for more information.
#remove_facet_from_object(options = {}) ⇒ Struct
Removes the specified facet from the specified object.
#tag_resource(options = {}) ⇒ Struct
An API operation for adding tags to a resource.
#untag_resource(options = {}) ⇒ Struct
An API operation for removing tags from a resource.
#update_facet(options = {}) ⇒ Struct
Does the following:
-
Adds new
Attributes
,Rules
, orObjectTypes
. -
Updates existing
Attributes
,Rules
, orObjectTypes
. -
Deletes existing
Attributes
,Rules
, orObjectTypes
.
#update_link_attributes(options = {}) ⇒ Struct
Updates a given typed link’s attributes. Attributes to be updated must not contribute to the typed link’s identity, as defined by its IdentityAttributeOrder
.
#update_object_attributes(options = {}) ⇒ Types::UpdateObjectAttributesResponse
Updates a given object's attributes.
#update_schema(options = {}) ⇒ Types::UpdateSchemaResponse
Updates the schema name with a new name. Only development schema names can be updated.
#update_typed_link_facet(options = {}) ⇒ Struct
Updates a TypedLinkFacet. For more information, see Typed Links.
#upgrade_applied_schema(options = {}) ⇒ Types::UpgradeAppliedSchemaResponse
Upgrades a single directory in-place using the PublishedSchemaArn
with schema updates found in MinorVersion
. Backwards-compatible minor version upgrades are instantaneously available for readers on all objects in the directory. Note: This is a synchronous API call and upgrades only one schema on a given directory per call. To upgrade multiple directories from one schema, you would need to call this API on each directory.
#upgrade_published_schema(options = {}) ⇒ Types::UpgradePublishedSchemaResponse
Upgrades a published schema under a new minor version revision using the current contents of DevelopmentSchemaArn
.
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|