associateConnectPeer method
Associates a core network Connect peer with a device and optionally, with a link.
If you specify a link, it must be associated with the specified device. You can only associate core network Connect peers that have been created on a core network Connect attachment on a core network.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter connectPeerId :
The ID of the Connect peer.
Parameter deviceId :
The ID of the device.
Parameter globalNetworkId :
The ID of your global network.
Parameter linkId :
The ID of the link.
Implementation
Future<AssociateConnectPeerResponse> associateConnectPeer({
required String connectPeerId,
required String deviceId,
required String globalNetworkId,
String? linkId,
}) async {
final $payload = <String, dynamic>{
'ConnectPeerId': connectPeerId,
'DeviceId': deviceId,
if (linkId != null) 'LinkId': linkId,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/global-networks/${Uri.encodeComponent(globalNetworkId)}/connect-peer-associations',
exceptionFnMap: _exceptionFns,
);
return AssociateConnectPeerResponse.fromJson(response);
}