getOpsItem method
Get information about an OpsItem by using the ID. You must have permission in Identity and Access Management (IAM) to view information about an OpsItem. For more information, see Set up OpsCenter in the Amazon Web Services Systems Manager User Guide.
Operations engineers and IT professionals use Amazon Web Services Systems Manager OpsCenter to view, investigate, and remediate operational issues impacting the performance and health of their Amazon Web Services resources. For more information, see Amazon Web Services Systems Manager OpsCenter in the Amazon Web Services Systems Manager User Guide.
May throw InternalServerError.
May throw OpsItemAccessDeniedException.
May throw OpsItemNotFoundException.
Parameter opsItemId :
The ID of the OpsItem that you want to get.
Parameter opsItemArn :
The OpsItem Amazon Resource Name (ARN).
Implementation
Future<GetOpsItemResponse> getOpsItem({
required String opsItemId,
String? opsItemArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.GetOpsItem'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'OpsItemId': opsItemId,
if (opsItemArn != null) 'OpsItemArn': opsItemArn,
},
);
return GetOpsItemResponse.fromJson(jsonResponse.body);
}