listServiceOperations method

Future<ListServiceOperationsOutput> listServiceOperations({
  1. required DateTime endTime,
  2. required Map<String, String> keyAttributes,
  3. required DateTime startTime,
  4. int? maxResults,
  5. String? nextToken,
})

Returns a list of the operations of this service that have been discovered by Application Signals. Only the operations that were invoked during the specified time range are returned.

May throw ThrottlingException. May throw ValidationException.

Parameter endTime : The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: 1698778057

Your requested end time will be rounded to the nearest hour.

Parameter keyAttributes : Use this field to specify which service you want to retrieve information for. You must specify at least the Type, Name, and Environment attributes.

This is a string-to-string map. It can include the following fields.

  • Type designates the type of object this is.
  • ResourceType specifies the type of the resource. This field is used only when the value of the Type field is Resource or AWS::Resource.
  • Name specifies the name of the object. This is used only if the value of the Type field is Service, RemoteService, or AWS::Service.
  • Identifier identifies the resource objects of this resource. This is used only if the value of the Type field is Resource or AWS::Resource.
  • Environment specifies the location where this object is hosted, or what it belongs to.

Parameter startTime : The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: 1698778057

Your requested start time will be rounded to the nearest hour.

Parameter maxResults : The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.

Parameter nextToken : Include this value, if it was returned by the previous operation, to get the next set of service operations.

Implementation

Future<ListServiceOperationsOutput> listServiceOperations({
  required DateTime endTime,
  required Map<String, String> keyAttributes,
  required DateTime startTime,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    'EndTime': [_s.iso8601ToJson(endTime).toString()],
    'StartTime': [_s.iso8601ToJson(startTime).toString()],
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
  };
  final $payload = <String, dynamic>{
    'KeyAttributes': keyAttributes,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/service-operations',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListServiceOperationsOutput.fromJson(response);
}