replaceCoreV1NamespacedPodTemplate method

Future<PodTemplate> replaceCoreV1NamespacedPodTemplate({
  1. required PodTemplate body,
  2. required String name,
  3. required String namespace,
  4. bool? pretty,
})

Replace the specified PodTemplate.

name Name of the PodTemplate.

namespace Object name and auth scope, such as for teams and projects.

pretty If true, then the output is pretty printed.

Implementation

Future<api_core_v1.PodTemplate> replaceCoreV1NamespacedPodTemplate({
  required api_core_v1.PodTemplate body,
  required String name,
  required String namespace,
  bool? pretty,
}) async {
  final queryStrings = <String, Object>{};
  if (pretty != null) {
    queryStrings['pretty'] = pretty;
  }

  final query =
      queryStrings.isEmpty ? '' : '?${_joinQueryStrings(queryStrings)}';

  final jsonBody = jsonEncode(body.toJson());
  final result = await _putJsonMap(
      '/api/v1/namespaces/$namespace/podtemplates/$name$query', jsonBody);
  return api_core_v1.PodTemplate.fromJson(result);
}