Associates agentic connectors with the specified WorkSpace. The operation ignores connectors that are already associated with the WorkSpace. The connectors must be activated for your account. To activate a connector, call UpdateAgenticConnectorActivationStatus. A WorkSpace can have up to 25 connectors. If the request would exceed this limit, the operation returns ServiceQuotaExceededException.
Parameters:
Raises:
-
AccessDeniedException
–
The user is not authorized to access a resource.
-
ConflictException
–
The request conflicts with the current state of a resource, for example because a name is already in use or the resource is still in use. Resolve the conflict, and then retry your request.
-
ResourceNotFoundException
–
The resource could not be found.
-
ServiceQuotaExceededException
–
The request would exceed a service quota. Request a quota increase or reduce the number of resources in your request.
-
ThrottlingException
–
The request was throttled. Retry the request with exponential backoff.
-
ValidationException
–
Your request failed validation. Check the error message for the parameter that isn't valid.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Example – Adding a connector to a WorkSpace
The following example adds an activated connector to an agentic WorkSpace.
>>> client.associate_workspace_agentic_connectors(workspace_id='ws-dk1example1', agentic_connector_ids=['wsacn-jira'])
Source code in docs_src/capo_workspaces/_services/work_spaces.py
| def associate_workspace_agentic_connectors(
self,
workspace_id: "capo_workspaces.types.workspace_id.WorkspaceId",
agentic_connector_ids: "capo_workspaces.types.workspace_agentic_connector_id_list.WorkspaceAgenticConnectorIdList",
*,
config_overrides: Optional[WorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.associate_workspace_agentic_connectors_result.AssociateWorkspaceAgenticConnectorsResult":
"""<p>Associates agentic connectors with the specified WorkSpace. The operation ignores connectors that are already associated with the WorkSpace. The connectors must be activated for your account. To activate a connector, call <code>UpdateAgenticConnectorActivationStatus</code>. A WorkSpace can have up to 25 connectors. If the request would exceed this limit, the operation returns <code>ServiceQuotaExceededException</code>.</p>
Args:
workspace_id: <p>The identifier of the WorkSpace.</p>
agentic_connector_ids: <p>The identifiers of the connectors to associate.</p>
Raises:
capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
capo_workspaces.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of a resource, for example because a name is already in use or the resource is still in use. Resolve the conflict, and then retry your request.</p>
capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
capo_workspaces.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota. Request a quota increase or reduce the number of resources in your request.</p>
capo_workspaces.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Retry the request with exponential backoff.</p>
capo_workspaces.errors.validation_exception.ValidationException: <p>Your request failed validation. Check the error message for the parameter that isn't valid.</p>
capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Example – Adding a connector to a WorkSpace
The following example adds an activated connector to an agentic WorkSpace.
>>> client.associate_workspace_agentic_connectors(workspace_id='ws-dk1example1', agentic_connector_ids=['wsacn-jira'])
"""
def _handler(
req: "OperationRequest[capo_workspaces.types.associate_workspace_agentic_connectors_request.AssociateWorkspaceAgenticConnectorsRequest]",
) -> OperationResponse[
"capo_workspaces.types.associate_workspace_agentic_connectors_result.AssociateWorkspaceAgenticConnectorsResult"
]:
if req.options.protocol == "awsJson1_1":
import capo_workspaces._operations.workspaces_service.aws_json1_1.associate_workspace_agentic_connectors
output, http_response = (
capo_workspaces._operations.workspaces_service.aws_json1_1.associate_workspace_agentic_connectors.associate_workspace_agentic_connectors(
req.options, req.input
)
)
elif req.options.protocol == "rpcv2Cbor":
import capo_workspaces._operations.workspaces_service.rpcv2_cbor.associate_workspace_agentic_connectors
output, http_response = (
capo_workspaces._operations.workspaces_service.rpcv2_cbor.associate_workspace_agentic_connectors.associate_workspace_agentic_connectors(
req.options, req.input
)
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateWorkspaceAgenticConnectors")
)
input_: capo_workspaces.types.associate_workspace_agentic_connectors_request.AssociateWorkspaceAgenticConnectorsRequest = {
"workspace_id": workspace_id,
"agentic_connector_ids": agentic_connector_ids,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|