updateVirtualNode method
- required String meshName,
- required VirtualNodeSpec spec,
- required String virtualNodeName,
- String? clientToken,
Updates an existing virtual node in a specified service 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 of the service mesh in which the virtual node resides.
Parameter spec
:
The new virtual node specification to apply. This overwrites the existing
data.
Parameter virtualNodeName
:
The name of the virtual node to update.
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<UpdateVirtualNodeOutput> updateVirtualNode({
required String meshName,
required VirtualNodeSpec spec,
required String virtualNodeName,
String? clientToken,
}) async {
ArgumentError.checkNotNull(meshName, 'meshName');
_s.validateStringLength(
'meshName',
meshName,
1,
255,
isRequired: true,
);
ArgumentError.checkNotNull(spec, 'spec');
ArgumentError.checkNotNull(virtualNodeName, 'virtualNodeName');
_s.validateStringLength(
'virtualNodeName',
virtualNodeName,
1,
255,
isRequired: true,
);
final $payload = <String, dynamic>{
'spec': spec,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.sendRaw(
payload: $payload,
method: 'PUT',
requestUri:
'/meshes/${Uri.encodeComponent(meshName)}/virtualNodes/${Uri.encodeComponent(virtualNodeName)}',
exceptionFnMap: _exceptionFns,
);
final $json = await _s.jsonFromResponse(response);
return UpdateVirtualNodeOutput(
virtualNode: VirtualNodeData.fromJson($json),
);
}