describeSnapshots method

Future<DescribeSnapshotsResponse> describeSnapshots({
  1. String? clusterName,
  2. int? maxResults,
  3. String? nextToken,
  4. bool? showDetail,
  5. String? snapshotName,
  6. String? source,
})

Returns information about cluster snapshots. By default, DescribeSnapshots lists all of your snapshots; it can optionally describe a single snapshot, or just the snapshots associated with a particular cluster.

May throw InvalidParameterCombinationException. May throw InvalidParameterValueException. May throw ServiceLinkedRoleNotFoundFault. May throw SnapshotNotFoundFault.

Parameter clusterName : A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.

Parameter maxResults : The maximum number of records to include in the response. If more records exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

Parameter nextToken : An optional argument to pass in case the total number of records exceeds the value of MaxResults. If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged.

Parameter showDetail : A Boolean value which if true, the shard configuration is included in the snapshot description.

Parameter snapshotName : A user-supplied name of the snapshot. If this parameter is specified, only this named snapshot is described.

Parameter source : If set to system, the output shows snapshots that were automatically created by MemoryDB. If set to user the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.

Implementation

Future<DescribeSnapshotsResponse> describeSnapshots({
  String? clusterName,
  int? maxResults,
  String? nextToken,
  bool? showDetail,
  String? snapshotName,
  String? source,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonMemoryDB.DescribeSnapshots'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (clusterName != null) 'ClusterName': clusterName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (showDetail != null) 'ShowDetail': showDetail,
      if (snapshotName != null) 'SnapshotName': snapshotName,
      if (source != null) 'Source': source,
    },
  );

  return DescribeSnapshotsResponse.fromJson(jsonResponse.body);
}