listVolumes method

Future<ListVolumesOutput> listVolumes({
  1. String? gatewayARN,
  2. int? limit,
  3. String? marker,
})

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.

May throw InvalidGatewayRequestException. May throw InternalServerError.

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

Parameter marker : 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.

Implementation

Future<ListVolumesOutput> listVolumes({
  String? gatewayARN,
  int? limit,
  String? marker,
}) async {
  _s.validateStringLength(
    'gatewayARN',
    gatewayARN,
    50,
    500,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'marker',
    marker,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.ListVolumes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (gatewayARN != null) 'GatewayARN': gatewayARN,
      if (limit != null) 'Limit': limit,
      if (marker != null) 'Marker': marker,
    },
  );

  return ListVolumesOutput.fromJson(jsonResponse.body);
}