Logo

Command Palette

Search for a command to run...

GET/stacks/:stack_id/application_variants

Optional Parameters

stack_id
Stack UID

Returns all application variants (active, rollout, and preview) for the specified stack.

Application variants enable advanced deployment strategies like blue-green deployments, canary releases, and preview environments. Each variant represents a different version of your application that can receive varying amounts of traffic.

Variant Types:

  • Active: The current production version receiving 100% traffic
  • Canary: A rollout variant receiving a percentage of traffic for testing
  • Blue/Green: A rollout variant for blue-green deployments
  • Preview: A preview environment for testing changes
Response Status Codes
Status CodeDescription
200Success - Returns list of application variants
401Unauthorized - Authentication failed or missing OAuth token
403Forbidden - OAuth token lacks required `redeploy` scope or insufficient permissions
404Not Found - Stack not found

Request

GET
/stacks/:stack_id/application_variants
curl -X GET \
  "https://app.cloud66.com/api/3/stacks/:stack_id/application_variants" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": [
    {
      "id": 123,
      "uid": "abc123def456",
      "variant_type": "active",
      "git_hash": "a1b2c3d4e5f6",
      "created_at": "2023-01-15T10:30:00Z",
      "percentage": 100
    },
    {
      "id": 124,
      "uid": "def456ghi789",
      "variant_type": "canary",
      "git_hash": "f6e5d4c3b2a1",
      "created_at": "2023-01-15T11:00:00Z",
      "percentage": 20
    },
    {
      "id": 125,
      "uid": "ghi789jkl012",
      "variant_type": "preview",
      "git_hash": "123456789abc",
      "created_at": "2023-01-15T12:00:00Z",
      "percentage": 0
    }
  ]
}
PUT/stacks/:stack_id/application_variants/:id

Optional Parameters

stack_id
Stack UID
id
Application variant UID
operation
Operation to perform - "commit" to finalize rollout or "percentage" to update canary traffic
canary_percentage
New traffic percentage (0-100) - required when operation=percentage

Manages rollout variants by committing changes or adjusting canary percentages.

Only applies to rollout variants (blue-green or canary deployments). Use this endpoint to either finalize a rollout by committing it as the new active version, or to adjust the traffic percentage for canary deployments.

Operations:

  • commit: Finalize the rollout variant (make it the active version)
  • percentage: Update canary traffic percentage (canary deployments only)

Examples:

  • Commit a blue-green deployment: PUT /stacks/:stack_id/application_variants/:id?operation=commit
  • Update canary percentage: PUT /stacks/:stack_id/application_variants/:id?operation=percentage&canary_percentage=50
Response Status Codes
Status CodeDescription
200Success - Rollout variant updated successfully
400Bad Request - Invalid variant UID, non-rollout variant, or invalid operation parameters
401Unauthorized - Authentication failed or missing OAuth token
403Forbidden - OAuth token lacks required `redeploy` scope or insufficient permissions
404Not Found - Stack or variant not found

Request

PUT
/stacks/:stack_id/application_variants/:id
curl -X PUT \
  "https://app.cloud66.com/api/3/stacks/:stack_id/application_variants/:id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": {
    "ok": true,
    "message": "Done"
  }
}
DELETE/stacks/:stack_id/application_variants/:id

Optional Parameters

stack_id
Stack UID
id
Preview variant UID to delete

Permanently removes a preview variant from the system.

Preview variants are used for testing changes in isolated environments before promoting them to production through rollout strategies.

Response Status Codes
Status CodeDescription
200Success - Preview variant deleted successfully
400Bad Request - Invalid variant UID or not a preview variant
401Unauthorized - Authentication failed or missing OAuth token
403Forbidden - OAuth token lacks required `redeploy` scope or insufficient permissions
404Not Found - Stack or preview variant not found

Request

DELETE
/stacks/:stack_id/application_variants/:id
curl -X DELETE \
  "https://app.cloud66.com/api/3/stacks/:stack_id/application_variants/:id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": {
    "ok": true,
    "message": "Done"
  }
}