OpenSearchService / Client / attach_data_source
attach_data_source¶
- OpenSearchService.Client.attach_data_source(**kwargs)¶
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 returnsPENDINGand completes the attachment automatically once both become active. If the attachment cannot be completed, its status becomesFAILED. This operation is idempotent: If the data source is already attached or pending, the operation returns the existing attachment.See also: AWS API Documentation
Request Syntax
response = client.attach_data_source( id='string', dataSourceArn='string', workspaceId='string', workspaceConfiguration={ 'name': 'string', 'workspaceType': 'string' }, clientToken='string' )
- Parameters:
id (string) –
[REQUIRED]
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.dataSourceArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the domain. See Identifiers for IAM Entities in Using Amazon Web Services Identity and Access Management for more information.
workspaceId (string) – The identifier of an existing workspace to update with the new data source. Mutually exclusive with
workspaceConfiguration.workspaceConfiguration (dict) –
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.name (string) – [REQUIRED]
The name of the workspace to create. Must be between 1 and 40 characters and can contain alphanumeric characters, parentheses, brackets, hyphens, underscores, and spaces.
workspaceType (string) – [REQUIRED]
The type of workspace to create, which determines the use-case features enabled for the workspace. Valid values are
OBSERVABILITY,SECURITY_ANALYTICS, andSEARCH.
clientToken (string) – 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.
- Return type:
dict
- Returns:
Response Syntax
{ 'attachmentId': 'string', 'id': 'string', 'arn': 'string', 'dataSourceArn': 'string', 'status': 'PENDING'|'ATTACHED'|'FAILED' }
Response Structure
(dict) –
attachmentId (string) –
The unique identifier assigned to the data source attachment.
id (string) –
The unique identifier of the OpenSearch application.
arn (string) –
The Amazon Resource Name (ARN) of the domain. See Identifiers for IAM Entities in Using Amazon Web Services Identity and Access Management for more information.
dataSourceArn (string) –
The Amazon Resource Name (ARN) of the domain. See Identifiers for IAM Entities in Using Amazon Web Services Identity and Access Management for more information.
status (string) –
The status of the data source attachment. Valid values are
PENDING(waiting for resources to become active),ATTACHED(successfully attached), andFAILED(attachment timed out or encountered a non-retryable error).
Exceptions
OpenSearchService.Client.exceptions.ValidationExceptionOpenSearchService.Client.exceptions.AccessDeniedExceptionOpenSearchService.Client.exceptions.InternalExceptionOpenSearchService.Client.exceptions.ConflictExceptionOpenSearchService.Client.exceptions.ResourceNotFoundExceptionOpenSearchService.Client.exceptions.DisabledOperationException