Skip to content

list_volumes

list_volumes(
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    gateway_arn: Optional[GatewayARN] = None,
    marker: Optional[Marker] = None,
    limit: Optional[PositiveIntObject] = None,
) -> ListVolumesOutput

Lists the iSCSI stored volumes of a gateway. Results are sorted by volume ARN. The response includes only the volume ARNs. If you want additional volume information, use the DescribeStorediSCSIVolumes or the DescribeCachediSCSIVolumes API.

The operation supports pagination. By default, the operation returns a maximum of up to 100 volumes. You can optionally specify the Limit field in the body to limit the number of volumes in the response. If the number of volumes returned in the response is truncated, the response includes a Marker field. You can use this Marker value in your subsequent request to retrieve the next set of volumes. This operation is only supported in the cached volume and stored volume gateway types.

Parameters:

  • marker (Optional[Marker], default: None ) –

    A string that indicates the position at which to begin the returned list of volumes. Obtain the marker from the response of a previous List iSCSI Volumes request.

  • limit (Optional[PositiveIntObject], default: None ) –

    Specifies that the list of volumes returned be limited to the specified number of items.

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

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

Examples:

To list the iSCSI stored volumes of a gateway Lists the iSCSI stored volumes of a gateway. Results are sorted by volume ARN up to a maximum of 100 volumes.

>>> client.list_volumes(gateway_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B', marker='1', limit=2)
Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
def list_volumes(
    self,
    *,
    config_overrides: Optional[StorageGatewayClientConfig] = None,
    gateway_arn: Optional[
        "capo_storage_gateway.types.gateway_arn.GatewayARN"
    ] = None,
    marker: Optional["capo_storage_gateway.types.marker.Marker"] = None,
    limit: Optional[
        "capo_storage_gateway.types.positive_int_object.PositiveIntObject"
    ] = None,
) -> "capo_storage_gateway.types.list_volumes_output.ListVolumesOutput":
    """<p>Lists the iSCSI stored volumes of a gateway. Results are sorted by volume ARN. The response includes only the volume ARNs. If you want additional volume information, use the <a>DescribeStorediSCSIVolumes</a> or the <a>DescribeCachediSCSIVolumes</a> API.</p> <p>The operation supports pagination. By default, the operation returns a maximum of up to 100 volumes. You can optionally specify the <code>Limit</code> field in the body to limit the number of volumes in the response. If the number of volumes returned in the response is truncated, the response includes a Marker field. You can use this Marker value in your subsequent request to retrieve the next set of volumes. This operation is only supported in the cached volume and stored volume gateway types.</p>

    Args:
        marker: <p>A string that indicates the position at which to begin the returned list of volumes. Obtain the marker from the response of a previous List iSCSI Volumes request.</p>
        limit: <p>Specifies that the list of volumes returned be limited to the specified number of items.</p>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list the iSCSI stored volumes of a gateway
        Lists the iSCSI stored volumes of a gateway. Results are sorted by volume ARN up to a maximum of 100 volumes.

        >>> client.list_volumes(gateway_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B', marker='1', limit=2)
    """

    def _handler(
        req: "OperationRequest[capo_storage_gateway.types.list_volumes_input.ListVolumesInput]",
    ) -> OperationResponse[
        "capo_storage_gateway.types.list_volumes_output.ListVolumesOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.list_volumes

        output, http_response = (
            capo_storage_gateway._operations.storage_gateway_20130630.list_volumes.list_volumes(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListVolumes")
    )
    input_: capo_storage_gateway.types.list_volumes_input.ListVolumesInput = {}
    if gateway_arn is not None:
        input_["gateway_arn"] = gateway_arn
    if marker is not None:
        input_["marker"] = marker
    if limit is not None:
        input_["limit"] = limit

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