Get a list of preview change sets for open reviews related to the resource.
GET
/v1/resources/{org_uuid}/{resource_uuid}/previews
Get a list of preview change sets for open reviews related to the resource, in descending order of last_pushed_at.
Authorizations
apiKey
API key as username in Basic Authorization with
empty password.
TypeAPI Key (header: Authorization)
or
jwtToken
TypeHTTP (bearer)
Parameters
Path Parameters
org_uuid*
UUID of the organization
Typestring
Requiredformat
"uuid"resource_uuid*
The ID of the resource
Typestring
RequiredExample
"01c9fb02-7648-45f5-9bdd-f2c27e59c448"format
"uuid"Query Parameters
page
Page number to return
Typeinteger
Example
1format
"int64"minimum
1per_page
Number of elements per page
Typeinteger
format
"int64"minimum
1default
10Responses
OK
application/json
JSON
{
"resource_previews": [
{
"change": "string",
"changed_at": "2024-04-12T07:06:00Z",
"stack_preview": {
"stack_preview_id": 4242,
"stack": {
"stack_id": 1337,
"repository": "github.com/terramate-io/iac-gcloud",
"target": "staging",
"path": "/path/to/stack",
"default_branch": "main",
"meta_id": "a754255a-c92a-4aeb-9668-bd3ce21dc8a2",
"meta_name": "My Stack Name",
"meta_description": "My Stack Description",
"meta_tags": [
[
"tagA",
"tagB"
]
],
"status": "string",
"created_at": "string",
"updated_at": "string",
"seen_at": "string",
"is_archived": true,
"archived_at": "string",
"archived_by_user_uuid": "string",
"unarchived_at": "string",
"unarchived_by_user_uuid": "string",
"deployment_status": "string",
"drift_status": "string",
"draft": true,
"related_stacks": [
{
"stack_id": 0,
"target": "string"
}
],
"resources": {
"count": 42,
"policy_check": {
"created_at": "2024-09-12T07:06:00Z",
"passed": false,
"counters": {
"passed_count": 42,
"severity_low_count": 3,
"severity_medium_count": 2,
"severity_high_count": 1
}
}
}
},
"path": "string",
"status": "string",
"changeset_details": {
"provisioner": "string",
"serial": 0,
"changeset_ascii": "string",
"changeset_json": "string"
},
"technology": "string",
"technology_layer": "default",
"updated_at": "string",
"resource_changes": {
"actions_summary": {
"create_count": 3,
"delete_count": 2,
"noop_count": 5,
"read_count": 4,
"replace_count": 7,
"update_count": 0
}
}
},
"review_request": {
"review_request_id": 42,
"platform": "github",
"repository": "github.com/terramate-io/iac-gcloud",
"commit_sha": "deadc0decafebabecafed00ddeadbeeff00dface",
"number": 23,
"title": "feat: Add feature X",
"description": "My Change Description
with a lot of details.
",
"url": "https://github.com/terramate-io/iac-gcloud/pull/666",
"author": {
"login": "hacker",
"avatar_url": "https://avatar.url/hacker",
"id": "id"
},
"status": "string",
"platform_updated_at": "string",
"platform_created_at": "string",
"platform_pushed_at": "string",
"platform_merged_at": "string",
"reviewers": [
{
"login": "hacker",
"avatar_url": "https://avatar.url/hacker",
"id": "id"
}
],
"branch": "my_awesome_feature",
"base_branch": "main",
"draft": true,
"review_decision": "approved",
"changes_requested_count": 1,
"approved_count": 1,
"checks_total_count": 1,
"checks_failure_count": 1,
"checks_success_count": 1,
"labels": [
{
"name": "label1",
"color": "#000000",
"description": "label description"
}
],
"preview": {
"id": 232,
"status": "outdated",
"affected_count": 1,
"pending_count": 1,
"running_count": 1,
"changed_count": 1,
"unchanged_count": 1,
"failed_count": 1,
"canceled_count": 0,
"resource_changes": {
"create_count": 3,
"delete_count": 2,
"noop_count": 5,
"read_count": 4,
"replace_count": 7,
"update_count": 0
}
},
"metrics": {
"last_drafted_at": "string",
"last_ready_for_review_at": "string",
"ready_for_review_count": 1,
"review_total_duration_seconds": 1,
"last_mergeable_at": "string",
"mergeable_count": 1,
"mergeable_total_duration_seconds": 2323,
"last_closed_at": "string",
"deployment": {
"started_at": "string",
"finished_at": "string",
"failed_at": "string",
"fixed_at": "string",
"wait_time_total_duration_seconds": 2323,
"status": "string",
"time_to_restore_seconds": 2323,
"lead_time_for_change_seconds": 2342,
"stack_deployment_ok_count": 34,
"stack_deployment_failed_count": 23
}
},
"collaborators": [
{
"id": 232,
"platform": "github",
"display_name": "hacker",
"avatar_url": "https://avatar.url/hacker",
"linked_user": {
"user_uuid": "683e0589-65a8-48b8-bd90-6ee89e0682ab",
"display_name": "Marius Tolzmann",
"user_picture_url": "https://lh3.googleusercontent.com/a/AAcHTtcBqudpP0hVoQyjDv-v5b4lP6e0vN_92zi_aPp90hE=s96-c"
},
"roles": [
"string"
]
}
]
}
}
],
"paginated_result": {
"total": 0,
"page": 0,
"per_page": 0
}
}