attach_data_source
async
¶
attach_data_source(
id: Id,
data_source_arn: ARN,
*,
config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
workspace_id: Optional[String] = None,
workspace_configuration: Optional[WorkspaceConfigurationInput] = None,
client_token: Optional[ClientToken] = None,
) -> AttachDataSourceResponse
Attaches a data source to an OpenSearch application. The data source must be an Amazon OpenSearch Service domain. If both the application and the data source are active, the attachment completes immediately with a status of ATTACHED. Otherwise, the operation returns PENDING and completes the attachment automatically once both become active. If the attachment cannot be completed, its status becomes FAILED. This operation is idempotent: If the data source is already attached or pending, the operation returns the existing attachment.
Parameters:
-
id(Id) –The unique identifier or name of the OpenSearch application to attach the data source to. This is the same identifier used with
UpdateApplication,GetApplication, andDeleteApplication. -
workspace_id(Optional[String], default:None) –The identifier of an existing workspace to update with the new data source. Mutually exclusive with
workspaceConfiguration. -
workspace_configuration(Optional[WorkspaceConfigurationInput], default:None) –Configuration for creating a new workspace during the attachment. If specified, a workspace is created and linked to the data source after the attachment completes. Mutually exclusive with
workspaceId. -
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure idempotency of the request. If you retry a request with the same client token and the same parameters, the retry succeeds without performing any further actions.
Raises:
-
AccessDeniedException–An error occurred because you don't have permissions to access the resource.
-
ConflictException–An error occurred because the client attempts to remove a resource that is currently in use.
-
DisabledOperationException–An error occured because the client wanted to access an unsupported operation.
-
InternalException–Request processing failed because of an unknown error, exception, or internal failure.
-
ResourceNotFoundException–An exception for accessing or deleting a resource that doesn't exist.
-
ValidationException–An exception for accessing or deleting a resource that doesn't exist.
-
UnknownServiceError–The service returned an error code this client does not model.