importHypervisorConfiguration method

Future<ImportHypervisorConfigurationOutput> importHypervisorConfiguration({
  1. required String host,
  2. required String name,
  3. String? kmsKeyArn,
  4. String? password,
  5. List<Tag>? tags,
  6. String? username,
})

Connect to a hypervisor by importing its configuration.

May throw AccessDeniedException. May throw ConflictException.

Parameter host : The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).

Parameter name : The name of the hypervisor.

Parameter kmsKeyArn : The Key Management Service for the hypervisor.

Parameter password : The password for the hypervisor.

Parameter tags : The tags of the hypervisor configuration to import.

Parameter username : The username for the hypervisor.

Implementation

Future<ImportHypervisorConfigurationOutput> importHypervisorConfiguration({
  required String host,
  required String name,
  String? kmsKeyArn,
  String? password,
  List<Tag>? tags,
  String? username,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'BackupOnPremises_v20210101.ImportHypervisorConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Host': host,
      'Name': name,
      if (kmsKeyArn != null) 'KmsKeyArn': kmsKeyArn,
      if (password != null) 'Password': password,
      if (tags != null) 'Tags': tags,
      if (username != null) 'Username': username,
    },
  );

  return ImportHypervisorConfigurationOutput.fromJson(jsonResponse.body);
}