Skip to content

update_agent async

update_agent(
    agent_arn: AgentArn,
    *,
    config_overrides: Optional[AsyncDataSyncClientConfig] = None,
    name: Optional[TagValue] = None,
) -> UpdateAgentResponse

Updates the name of an DataSync agent.

Parameters:

  • agent_arn (AgentArn) –

    The Amazon Resource Name (ARN) of the agent to update.

  • name (Optional[TagValue], default: None ) –

    The name that you want to use to configure the agent.

Raises:

Source code in docs_src/capo_datasync/_services/async_data_sync.py
async def update_agent(
    self,
    agent_arn: "capo_datasync.types.agent_arn.AgentArn",
    *,
    config_overrides: Optional[AsyncDataSyncClientConfig] = None,
    name: Optional["capo_datasync.types.tag_value.TagValue"] = None,
) -> "capo_datasync.types.update_agent_response.UpdateAgentResponse":
    """<p>Updates the name of an DataSync agent.</p>

    Args:
        agent_arn: <p>The Amazon Resource Name (ARN) of the agent to update.</p>
        name: <p>The name that you want to use to configure the agent.</p>

    Raises:
        capo_datasync.errors.internal_exception.InternalException: <p>This exception is thrown when an error occurs in the DataSync service.</p>
        capo_datasync.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_datasync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datasync.types.update_agent_request.UpdateAgentRequest]",
    ) -> AsyncOperationResponse[
        "capo_datasync.types.update_agent_response.UpdateAgentResponse"
    ]:
        import capo_datasync._operations.fmrs_service.update_agent

        (
            output,
            http_response,
        ) = await capo_datasync._operations.fmrs_service.update_agent.async_update_agent(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAgent")
    )
    input_: capo_datasync.types.update_agent_request.UpdateAgentRequest = {
        "agent_arn": agent_arn
    }
    if name is not None:
        input_["name"] = name

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output