createChannelPlacementGroup method

Future<CreateChannelPlacementGroupResponse> createChannelPlacementGroup({
  1. required String clusterId,
  2. String? name,
  3. List<String>? nodes,
  4. String? requestId,
  5. Map<String, String>? tags,
})

Create a ChannelPlacementGroup in the specified Cluster. As part of the create operation, you specify the Nodes to attach the group to.After you create a ChannelPlacementGroup, you add Channels to the group (you do this by modifying the Channels to add them to a specific group). You now have an association of Channels to ChannelPlacementGroup, and ChannelPlacementGroup to Nodes. This association means that all the Channels in the group are able to run on any of the Nodes associated with the group.

May throw BadGatewayException. May throw BadRequestException. May throw ForbiddenException. May throw GatewayTimeoutException. May throw InternalServerErrorException. May throw TooManyRequestsException. May throw UnprocessableEntityException.

Parameter clusterId : The ID of the cluster.

Parameter name : Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.

Parameter nodes : An array of one ID for the Node that you want to associate with the ChannelPlacementGroup. (You can't associate more than one Node with the ChannelPlacementGroup.) The Node and the ChannelPlacementGroup must be in the same Cluster.

Parameter requestId : An ID that you assign to a create request. This ID ensures idempotency when creating resources. the request.

Parameter tags : A collection of key-value pairs.

Implementation

Future<CreateChannelPlacementGroupResponse> createChannelPlacementGroup({
  required String clusterId,
  String? name,
  List<String>? nodes,
  String? requestId,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    if (name != null) 'name': name,
    if (nodes != null) 'nodes': nodes,
    'requestId': requestId ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/prod/clusters/${Uri.encodeComponent(clusterId)}/channelplacementgroups',
    exceptionFnMap: _exceptionFns,
  );
  return CreateChannelPlacementGroupResponse.fromJson(response);
}