Activates or deactivates an agentic connector for your account. Your account setup must be READY first. The change is asynchronous. To track it, check the connector's ActivationStatus. You can repeat the same change safely. An account can have up to 25 activated connectors. If activating a connector 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 – Activating a connector
The following example activates a connector so that it can be associated with WorkSpaces and persona configurations.
>>> await client.update_agentic_connector_activation_status(agentic_connector_id='wsacn-github', activation_status='ACTIVATED')
Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
| async def update_agentic_connector_activation_status(
self,
agentic_connector_id: "capo_workspaces.types.agentic_connector_id.AgenticConnectorId",
activation_status: "capo_workspaces.types.agentic_connector_target_activation_status.AgenticConnectorTargetActivationStatus",
*,
config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.update_agentic_connector_activation_status_result.UpdateAgenticConnectorActivationStatusResult":
"""<p>Activates or deactivates an agentic connector for your account. Your account setup must be <code>READY</code> first. The change is asynchronous. To track it, check the connector's <code>ActivationStatus</code>. You can repeat the same change safely. An account can have up to 25 activated connectors. If activating a connector would exceed this limit, the operation returns <code>ServiceQuotaExceededException</code>.</p>
Args:
agentic_connector_id: <p>The identifier of the connector.</p>
activation_status: <p>The activation status to set:</p> <ul> <li> <p> <code>ACTIVATED</code> – You activated the connector.</p> </li> <li> <p> <code>DEACTIVATED</code> – You deactivated the connector.</p> </li> </ul>
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 – Activating a connector
The following example activates a connector so that it can be associated with WorkSpaces and persona configurations.
>>> await client.update_agentic_connector_activation_status(agentic_connector_id='wsacn-github', activation_status='ACTIVATED')
"""
async def _handler(
req: "AsyncOperationRequest[capo_workspaces.types.update_agentic_connector_activation_status_request.UpdateAgenticConnectorActivationStatusRequest]",
) -> AsyncOperationResponse[
"capo_workspaces.types.update_agentic_connector_activation_status_result.UpdateAgenticConnectorActivationStatusResult"
]:
if req.options.protocol == "awsJson1_1":
import capo_workspaces._operations.workspaces_service.aws_json1_1.update_agentic_connector_activation_status
(
output,
http_response,
) = await capo_workspaces._operations.workspaces_service.aws_json1_1.update_agentic_connector_activation_status.async_update_agentic_connector_activation_status(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_workspaces._operations.workspaces_service.rpcv2_cbor.update_agentic_connector_activation_status
(
output,
http_response,
) = await capo_workspaces._operations.workspaces_service.rpcv2_cbor.update_agentic_connector_activation_status.async_update_agentic_connector_activation_status(
req.options, req.input
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateAgenticConnectorActivationStatus")
)
input_: capo_workspaces.types.update_agentic_connector_activation_status_request.UpdateAgenticConnectorActivationStatusRequest = {
"agentic_connector_id": agentic_connector_id,
"activation_status": activation_status,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|