postPlatformProjectsByProjectAppsByAppStop method

Future<AppView?> postPlatformProjectsByProjectAppsByAppStop(
  1. String project,
  2. String app
)

Stops an app without deleting it.

Stops an app without deleting it. It scales the app's Service to zero replicas and marks it stopped, answering the updated application. Nothing else is removed — the record, its env, its domains and its deployment history all survive, and /start brings it back at the same replica count. An app that is not deployed has no Service CR to scale and is 404. An unreachable cluster is 503 and a cluster that refuses the scale is 502. Because the pods stop, so does the compute metering. Requires a validated principal; 403 without one.

Parameters:

  • String project (required): Project is the project the application lives under, from the path.

  • String app (required): App is the application's slug, from the path.

Implementation

Future<AppView?> postPlatformProjectsByProjectAppsByAppStop(String project, String app,) async {
  final response = await postPlatformProjectsByProjectAppsByAppStopWithHttpInfo(project, app,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AppView',) as AppView;

  }
  return null;
}