pydo.apps.validate_rollback()

Description

Check whether an app can be rolled back to a specific deployment. This endpoint can also be used to check if there are any warnings or validation conditions that will cause the rollback to proceed under unideal circumstances. For example, if a component must be rebuilt as part of the rollback causing it to take longer than usual.

Parameters

Name Type Required Description Default Value
app_id string True The app ID
body JSON or IO[bytes] True

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

validate_req = {"deployment_id": "2", "skip_pin": False}

validate_resp = client.apps.validate_rollback("1", validate_req)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

A JSON object with the validation results.

Click to expand an example response for Valid rollback.
{
  "value": {
    "valid": true
  }
}
Click to expand an example response for Valid rollback with warnings.
{
  "value": {
    "valid": true,
    "warnings": [
      {
        "code": "image_source_missing_digest",
        "components": [
          "docker-worker"
        ],
        "message": "one or more components are missing an image digest and are not guaranteed rollback to the old version"
      }
    ]
  }
}
Click to expand an example response for Invalid rollback.
{
  "value": {
    "valid": false,
    "error": {
      "code": "incompatible_result",
      "message": "deployment result \"failed\" is unsuitable for rollback"
    }
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}