getService method

Future<GetServiceOutput> getService({
  1. required DateTime endTime,
  2. required Map<String, String> keyAttributes,
  3. required DateTime startTime,
})

Returns information about a service discovered by Application Signals.

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 start 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.

Implementation

Future<GetServiceOutput> getService({
  required DateTime endTime,
  required Map<String, String> keyAttributes,
  required DateTime startTime,
}) async {
  final $query = <String, List<String>>{
    'EndTime': [_s.iso8601ToJson(endTime).toString()],
    'StartTime': [_s.iso8601ToJson(startTime).toString()],
  };
  final $payload = <String, dynamic>{
    'KeyAttributes': keyAttributes,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/service',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetServiceOutput.fromJson(response);
}