replaceAppsV1NamespacedStatefulSet method

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

Replace the specified StatefulSet.

name Name of the StatefulSet.

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

pretty If true, then the output is pretty printed.

Implementation

Future<api_apps_v1.StatefulSet> replaceAppsV1NamespacedStatefulSet({
  required api_apps_v1.StatefulSet 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(
      '/apis/apps/v1/namespaces/$namespace/statefulsets/$name$query',
      jsonBody);
  return api_apps_v1.StatefulSet.fromJson(result);
}