createComponent method

Future<void> createComponent({
  1. required String componentName,
  2. required String resourceGroupName,
  3. required List<String> resourceList,
})

Creates a custom component by grouping similar standalone instances to monitor.

May throw InternalServerException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter componentName : The name of the component.

Parameter resourceGroupName : The name of the resource group.

Parameter resourceList : The list of resource ARNs that belong to the component.

Implementation

Future<void> createComponent({
  required String componentName,
  required String resourceGroupName,
  required List<String> resourceList,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'EC2WindowsBarleyService.CreateComponent'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ComponentName': componentName,
      'ResourceGroupName': resourceGroupName,
      'ResourceList': resourceList,
    },
  );
}