postPlatformProjectsByProjectAppsByAppRollback method

Future<DeploymentView?> postPlatformProjectsByProjectAppsByAppRollback(
  1. String project,
  2. String app,
  3. RollbackReq rollbackReq
)

Goes back to the previous release.

Goes back to the previous release. It redeploys a prior image: the one named by deploymentId, or — with no body — the newest earlier deployment that carries a real built image and did not error, skipping the release currently live. An app with nothing earlier to return to is 400. A rollback is a deploy of an old image, not a rewind: it takes a NEW version number and appends to the history rather than erasing what came after. Both lookups are scoped to this app and org, so another tenant's image can never be rolled in. 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.

  • RollbackReq rollbackReq (required):

Implementation

Future<DeploymentView?> postPlatformProjectsByProjectAppsByAppRollback(String project, String app, RollbackReq rollbackReq,) async {
  final response = await postPlatformProjectsByProjectAppsByAppRollbackWithHttpInfo(project, app, rollbackReq,);
  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), 'DeploymentView',) as DeploymentView;

  }
  return null;
}