createMesh method

Future<CreateMeshOutput> createMesh({
  1. required String meshName,
  2. String? clientToken,
})

Creates a new service mesh. A service mesh is a logical boundary for network traffic between the services that reside within it.

After you create your service mesh, you can create virtual nodes, virtual routers, and routes to distribute traffic between the applications in your mesh.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw InternalServerErrorException. May throw LimitExceededException. May throw NotFoundException. May throw ServiceUnavailableException. May throw TooManyRequestsException.

Parameter meshName : The name to use for the service mesh.

Parameter clientToken : Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.

Implementation

Future<CreateMeshOutput> createMesh({
  required String meshName,
  String? clientToken,
}) async {
  ArgumentError.checkNotNull(meshName, 'meshName');
  _s.validateStringLength(
    'meshName',
    meshName,
    1,
    255,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'meshName': meshName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.sendRaw(
    payload: $payload,
    method: 'PUT',
    requestUri: '/meshes',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return CreateMeshOutput(
    mesh: MeshData.fromJson($json),
  );
}