listJobsByConsumableResource method

Future<ListJobsByConsumableResourceResponse> listJobsByConsumableResource({
  1. required String consumableResource,
  2. List<KeyValuesPair>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Returns a list of Batch jobs that require a specific consumable resource.

May throw ClientException. May throw ServerException.

Parameter consumableResource : The name or ARN of the consumable resource.

Parameter filters : The filters to apply to the job list query. If used, only those jobs requiring the specified consumable resource (consumableResource) and that match the value of the filters are listed. The filter names and values can be:

  • name: JOB_STATUS

    values: SUBMITTED | PENDING | RUNNABLE | STARTING | RUNNING | SUCCEEDED | FAILED

  • name: JOB_NAME

    The values are case-insensitive matches for the job name. If a filter value ends with an asterisk (), it matches any job name that begins with the string before the ''.

Parameter maxResults : The maximum number of results returned by ListJobsByConsumableResource in paginated output. When this parameter is used, ListJobsByConsumableResource only returns maxResults results in a single page and a nextToken response element. The remaining results of the initial request can be seen by sending another ListJobsByConsumableResource request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then ListJobsByConsumableResource returns up to 100 results and a nextToken value if applicable.

Parameter nextToken : The nextToken value returned from a previous paginated ListJobsByConsumableResource request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.

Implementation

Future<ListJobsByConsumableResourceResponse> listJobsByConsumableResource({
  required String consumableResource,
  List<KeyValuesPair>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  final $payload = <String, dynamic>{
    'consumableResource': consumableResource,
    if (filters != null) 'filters': filters,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/listjobsbyconsumableresource',
    exceptionFnMap: _exceptionFns,
  );
  return ListJobsByConsumableResourceResponse.fromJson(response);
}