Skip to content

update_location_object_storage

update_location_object_storage(
    location_arn: LocationArn,
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    server_port: Optional[ObjectStorageServerPort] = None,
    server_protocol: Optional[ObjectStorageServerProtocol] = None,
    subdirectory: Optional[S3Subdirectory] = None,
    server_hostname: Optional[ServerHostname] = None,
    access_key: Optional[ObjectStorageAccessKey] = None,
    secret_key: Optional[ObjectStorageSecretKey] = None,
    agent_arns: Optional[AgentArnList] = None,
    server_certificate: Optional[ObjectStorageCertificate] = None,
    cmk_secret_config: Optional[CmkSecretConfig] = None,
    custom_secret_config: Optional[CustomSecretConfig] = None,
) -> UpdateLocationObjectStorageResponse

Modifies the following configuration parameters of the object storage transfer location that you're using with DataSync.

For more information, see Configuring DataSync transfers with an object storage system.

Parameters:

  • location_arn (LocationArn) –

    Specifies the ARN of the object storage system location that you're updating.

  • server_port (Optional[ObjectStorageServerPort], default: None ) –

    Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).

  • server_protocol (Optional[ObjectStorageServerProtocol], default: None ) –

    Specifies the protocol that your object storage server uses to communicate.

  • subdirectory (Optional[S3Subdirectory], default: None ) –

    Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.

  • server_hostname (Optional[ServerHostname], default: None ) –

    Specifies the domain name or IP address (IPv4 or IPv6) of the object storage server that your DataSync agent connects to.

  • access_key (Optional[ObjectStorageAccessKey], default: None ) –

    Specifies the access key (for example, a user name) if credentials are required to authenticate with the object storage server.

  • secret_key (Optional[ObjectStorageSecretKey], default: None ) –

    Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.

    If you provide a secret using SecretKey, but do not provide secret configuration details using CmkSecretConfig or CustomSecretConfig, then DataSync stores the token using your Amazon Web Services account's Secrets Manager secret.

  • agent_arns (Optional[AgentArnList], default: None ) –

    (Optional) Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can connect with your object storage system. If you are setting up an agentless cross-cloud transfer, you do not need to specify a value for this parameter.

    You cannot add or remove agents from a storage location after you initially create it.

  • server_certificate (Optional[ObjectStorageCertificate], default: None ) –

    Specifies a certificate chain for DataSync to authenticate with your object storage system if the system uses a private or self-signed certificate authority (CA). You must specify a single .pem file with a full certificate chain (for example, file:///home/user/.ssh/object_storage_certificates.pem).

    The certificate chain might include:

    • The object storage system's certificate

    • All intermediate certificates (if there are any)

    • The root certificate of the signing CA

    You can concatenate your certificates into a .pem file (which can be up to 32768 bytes before base64 encoding). The following example cat command creates an object_storage_certificates.pem file that includes three certificates:

    cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem

    To use this parameter, configure ServerProtocol to HTTPS.

    Updating this parameter doesn't interfere with tasks that you have in progress.

  • cmk_secret_config (Optional[CmkSecretConfig], default: None ) –

    Specifies configuration information for a DataSync-managed secret, such as an authentication token or set of credentials that DataSync uses to access a specific transfer location, and a customer-managed KMS key.

  • custom_secret_config (Optional[CustomSecretConfig], default: None ) –

    Specifies configuration information for a customer-managed secret, such as an authentication token or set of credentials that DataSync uses to access a specific transfer location, and a customer-managed Identity and Access Management (IAM) role that provides access to the secret.

Raises:

Source code in docs_src/capo_datasync/_services/data_sync.py
def update_location_object_storage(
    self,
    location_arn: "capo_datasync.types.location_arn.LocationArn",
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    server_port: Optional[
        "capo_datasync.types.object_storage_server_port.ObjectStorageServerPort"
    ] = None,
    server_protocol: Optional[
        "capo_datasync.types.object_storage_server_protocol.ObjectStorageServerProtocol"
    ] = None,
    subdirectory: Optional[
        "capo_datasync.types.s3_subdirectory.S3Subdirectory"
    ] = None,
    server_hostname: Optional[
        "capo_datasync.types.server_hostname.ServerHostname"
    ] = None,
    access_key: Optional[
        "capo_datasync.types.object_storage_access_key.ObjectStorageAccessKey"
    ] = None,
    secret_key: Optional[
        "capo_datasync.types.object_storage_secret_key.ObjectStorageSecretKey"
    ] = None,
    agent_arns: Optional["capo_datasync.types.agent_arn_list.AgentArnList"] = None,
    server_certificate: Optional[
        "capo_datasync.types.object_storage_certificate.ObjectStorageCertificate"
    ] = None,
    cmk_secret_config: Optional[
        "capo_datasync.types.cmk_secret_config.CmkSecretConfig"
    ] = None,
    custom_secret_config: Optional[
        "capo_datasync.types.custom_secret_config.CustomSecretConfig"
    ] = None,
) -> "capo_datasync.types.update_location_object_storage_response.UpdateLocationObjectStorageResponse":
    """<p>Modifies the following configuration parameters of the object storage transfer location that you're using with DataSync.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-object-location.html">Configuring DataSync transfers with an object storage system</a>.</p>

    Args:
        location_arn: <p>Specifies the ARN of the object storage system location that you're updating.</p>
        server_port: <p>Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).</p>
        server_protocol: <p>Specifies the protocol that your object storage server uses to communicate.</p>
        subdirectory: <p>Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.</p>
        server_hostname: <p>Specifies the domain name or IP address (IPv4 or IPv6) of the object storage server that your DataSync agent connects to.</p>
        access_key: <p>Specifies the access key (for example, a user name) if credentials are required to authenticate with the object storage server.</p>
        secret_key: <p>Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.</p> <note> <p>If you provide a secret using <code>SecretKey</code>, but do not provide secret configuration details using <code>CmkSecretConfig</code> or <code>CustomSecretConfig</code>, then DataSync stores the token using your Amazon Web Services account's Secrets Manager secret.</p> </note>
        agent_arns: <p>(Optional) Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can connect with your object storage system. If you are setting up an agentless cross-cloud transfer, you do not need to specify a value for this parameter.</p> <note> <p>You cannot add or remove agents from a storage location after you initially create it.</p> </note>
        server_certificate: <p>Specifies a certificate chain for DataSync to authenticate with your object storage system if the system uses a private or self-signed certificate authority (CA). You must specify a single <code>.pem</code> file with a full certificate chain (for example, <code>file:///home/user/.ssh/object_storage_certificates.pem</code>).</p> <p>The certificate chain might include:</p> <ul> <li> <p>The object storage system's certificate</p> </li> <li> <p>All intermediate certificates (if there are any)</p> </li> <li> <p>The root certificate of the signing CA</p> </li> </ul> <p>You can concatenate your certificates into a <code>.pem</code> file (which can be up to 32768 bytes before base64 encoding). The following example <code>cat</code> command creates an <code>object_storage_certificates.pem</code> file that includes three certificates:</p> <p> <code>cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pem</code> </p> <p>To use this parameter, configure <code>ServerProtocol</code> to <code>HTTPS</code>.</p> <p>Updating this parameter doesn't interfere with tasks that you have in progress.</p>
        cmk_secret_config: <p>Specifies configuration information for a DataSync-managed secret, such as an authentication token or set of credentials that DataSync uses to access a specific transfer location, and a customer-managed KMS key.</p>
        custom_secret_config: <p>Specifies configuration information for a customer-managed secret, such as an authentication token or set of credentials that DataSync uses to access a specific transfer location, and a customer-managed Identity and Access Management (IAM) role that provides access to the secret.</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.
    """

    def _handler(
        req: "OperationRequest[capo_datasync.types.update_location_object_storage_request.UpdateLocationObjectStorageRequest]",
    ) -> OperationResponse[
        "capo_datasync.types.update_location_object_storage_response.UpdateLocationObjectStorageResponse"
    ]:
        import capo_datasync._operations.fmrs_service.update_location_object_storage

        output, http_response = (
            capo_datasync._operations.fmrs_service.update_location_object_storage.update_location_object_storage(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datasync.types.update_location_object_storage_request.UpdateLocationObjectStorageRequest",
    ) -> dict[str, Any]:
        import capo_datasync.types.update_location_object_storage_request

        return capo_datasync.types.update_location_object_storage_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateLocationObjectStorage", redact_input=_redact_input),
    )
    input_: capo_datasync.types.update_location_object_storage_request.UpdateLocationObjectStorageRequest = {
        "location_arn": location_arn
    }
    if server_port is not None:
        input_["server_port"] = server_port
    if server_protocol is not None:
        input_["server_protocol"] = server_protocol
    if subdirectory is not None:
        input_["subdirectory"] = subdirectory
    if server_hostname is not None:
        input_["server_hostname"] = server_hostname
    if access_key is not None:
        input_["access_key"] = access_key
    if secret_key is not None:
        input_["secret_key"] = secret_key
    if agent_arns is not None:
        input_["agent_arns"] = agent_arns
    if server_certificate is not None:
        input_["server_certificate"] = server_certificate
    if cmk_secret_config is not None:
        input_["cmk_secret_config"] = cmk_secret_config
    if custom_secret_config is not None:
        input_["custom_secret_config"] = custom_secret_config

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output