Optional Parameters
stack_id
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
Status Code | Description |
---|---|
200 | Success - Returns list of application variants |
401 | Unauthorized - Authentication failed or missing OAuth token |
403 | Forbidden - OAuth token lacks required `redeploy` scope or insufficient permissions |
404 | Not Found - Stack not found |
Request
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
}
]
}
Optional Parameters
stack_id
id
operation
canary_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
Status Code | Description |
---|---|
200 | Success - Rollout variant updated successfully |
400 | Bad Request - Invalid variant UID, non-rollout variant, or invalid operation parameters |
401 | Unauthorized - Authentication failed or missing OAuth token |
403 | Forbidden - OAuth token lacks required `redeploy` scope or insufficient permissions |
404 | Not Found - Stack or variant not found |
Request
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"
}
}
Optional Parameters
stack_id
id
Permanently removes a preview variant from the system.
This operation only applies to preview variants and cannot be undone. The variant management system will be updated to reflect the change and clean up associated resources.
Preview variants are used for testing changes in isolated environments before promoting them to production through rollout strategies.
Status Code | Description |
---|---|
200 | Success - Preview variant deleted successfully |
400 | Bad Request - Invalid variant UID or not a preview variant |
401 | Unauthorized - Authentication failed or missing OAuth token |
403 | Forbidden - OAuth token lacks required `redeploy` scope or insufficient permissions |
404 | Not Found - Stack or preview variant not found |
Request
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"
}
}