Skip to content

update_volume async

update_volume(
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    volume_id: Optional[VolumeId] = None,
    ontap_configuration: Optional[UpdateOntapVolumeConfiguration] = None,
    name: Optional[VolumeName] = None,
    open_zfs_configuration: Optional[UpdateOpenZFSVolumeConfiguration] = None,
) -> UpdateVolumeResponse

Updates the configuration of an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.

Parameters:

  • volume_id (Optional[VolumeId], default: None ) –

    The ID of the volume that you want to update, in the format fsvol-0123456789abcdef0.

  • ontap_configuration (Optional[UpdateOntapVolumeConfiguration], default: None ) –

    The configuration of the ONTAP volume that you are updating.

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

    The name of the OpenZFS volume. OpenZFS root volumes are automatically named FSX. Child volume names must be unique among their parent volume's children. The name of the volume is part of the mount string for the OpenZFS volume.

  • open_zfs_configuration (Optional[UpdateOpenZFSVolumeConfiguration], default: None ) –

    The configuration of the OpenZFS volume that you are updating.

Raises:

  • BadRequest –

    A generic error indicating a failure with a client request.

  • IncompatibleParameterError –

    The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.

  • InternalServerError –

    A generic error indicating a server-side failure.

  • MissingVolumeConfiguration –

    A volume configuration is required for this operation.

  • VolumeNotFound –

    No Amazon FSx volumes were found based upon the supplied parameters.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fsx/_services/async_f_sx.py
async def update_volume(
    self,
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
    volume_id: Optional["capo_fsx.types.volume_id.VolumeId"] = None,
    ontap_configuration: Optional[
        "capo_fsx.types.update_ontap_volume_configuration.UpdateOntapVolumeConfiguration"
    ] = None,
    name: Optional["capo_fsx.types.volume_name.VolumeName"] = None,
    open_zfs_configuration: Optional[
        "capo_fsx.types.update_open_zfs_volume_configuration.UpdateOpenZFSVolumeConfiguration"
    ] = None,
) -> "capo_fsx.types.update_volume_response.UpdateVolumeResponse":
    """<p>Updates the configuration of an Amazon FSx for NetApp ONTAP or Amazon FSx for OpenZFS volume.</p>

    Args:
        volume_id: <p>The ID of the volume that you want to update, in the format <code>fsvol-0123456789abcdef0</code>.</p>
        ontap_configuration: <p>The configuration of the ONTAP volume that you are updating.</p>
        name: <p>The name of the OpenZFS volume. OpenZFS root volumes are automatically named <code>FSX</code>. Child volume names must be unique among their parent volume's children. The name of the volume is part of the mount string for the OpenZFS volume. </p>
        open_zfs_configuration: <p>The configuration of the OpenZFS volume that you are updating.</p>

    Raises:
        capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
        capo_fsx.errors.incompatible_parameter_error.IncompatibleParameterError: <p>The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.</p>
        capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
        capo_fsx.errors.missing_volume_configuration.MissingVolumeConfiguration: <p>A volume configuration is required for this operation.</p>
        capo_fsx.errors.volume_not_found.VolumeNotFound: <p>No Amazon FSx volumes were found based upon the supplied parameters.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fsx.types.update_volume_request.UpdateVolumeRequest]",
    ) -> AsyncOperationResponse[
        "capo_fsx.types.update_volume_response.UpdateVolumeResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.update_volume

        (
            output,
            http_response,
        ) = await capo_fsx._operations.aws_simba_api_service_v20180301.update_volume.async_update_volume(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_fsx.types.update_volume_response.UpdateVolumeResponse",
    ) -> dict[str, Any]:
        import capo_fsx.types.update_volume_response

        return capo_fsx.types.update_volume_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateVolume", redact_output=_redact_output),
    )
    input_: capo_fsx.types.update_volume_request.UpdateVolumeRequest = {}
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if volume_id is not None:
        input_["volume_id"] = volume_id
    if ontap_configuration is not None:
        input_["ontap_configuration"] = ontap_configuration
    if name is not None:
        input_["name"] = name
    if open_zfs_configuration is not None:
        input_["open_zfs_configuration"] = open_zfs_configuration

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