createEnvironmentConnector method
Creates a connector for an Amazon EVS environment. A connector establishes a connection to a VCF appliance, such as vCenter, using a fully qualified domain name and an Amazon Web Services Secrets Manager secret that stores the appliance credentials.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter applianceFqdn :
The fully qualified domain name (FQDN) of the VCF appliance that the
connector targets.
Parameter environmentId :
A unique ID for the environment to create the connector in.
Parameter secretIdentifier :
The ARN or name of the Amazon Web Services Secrets Manager secret that
stores the credentials for the VCF appliance.
Parameter type :
The type of connector to create.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the connector creation request. If you do not specify a
client token, a randomly generated token is used for the request to ensure
idempotency.
Implementation
Future<CreateEnvironmentConnectorResponse> createEnvironmentConnector({
required String applianceFqdn,
required String environmentId,
required String secretIdentifier,
required ConnectorType type,
String? clientToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AmazonElasticVMwareService.CreateEnvironmentConnector'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'applianceFqdn': applianceFqdn,
'environmentId': environmentId,
'secretIdentifier': secretIdentifier,
'type': type.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
},
);
return CreateEnvironmentConnectorResponse.fromJson(jsonResponse.body);
}