Skip to content

Commit b37be77

Browse files
committed
Add Stack States in API documentation
Signed-off-by: Rashed Kamal <[email protected]>
1 parent 2abfafb commit b37be77

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

docs/v3/source/includes/api_resources/_stacks.erb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"updated_at": "2018-11-09T22:43:28Z",
66
"name": "my-stack",
77
"description": "Here is my stack!",
8+
"state": "ACTIVE",
89
"build_rootfs_image": "my-stack",
910
"run_rootfs_image": "my-stack",
1011
"default": true,
@@ -45,6 +46,7 @@
4546
"build_rootfs_image": "my-stack-1-build",
4647
"run_rootfs_image": "my-stack-1-run",
4748
"description": "This is my first stack!",
49+
"state": "ACTIVE",
4850
"default": true,
4951
"metadata": {
5052
"labels": {},
@@ -64,6 +66,7 @@
6466
"description": "This is my second stack!",
6567
"build_rootfs_image": "my-stack-2-build",
6668
"run_rootfs_image": "my-stack-2-run",
69+
"state": "DEPRECATED",
6770
"default": false,
6871
"metadata": {
6972
"labels": {},
@@ -79,3 +82,26 @@
7982
}
8083

8184
<% end %>
85+
86+
<% content_for :single_stack_disabled do | metadata={} | %>
87+
{
88+
"guid": "11c916c9-c2f9-440e-8e73-102e79c4704d",
89+
"created_at": "2018-11-09T22:43:28Z",
90+
"updated_at": "2018-11-09T22:43:28Z",
91+
"name": "my-stack",
92+
"description": "Here is my stack!",
93+
"state": "ACTIVE",
94+
"build_rootfs_image": "my-stack",
95+
"run_rootfs_image": "my-stack",
96+
"default": true,
97+
"metadata": {
98+
"labels": <%= metadata.fetch(:labels, {}).to_json(space: ' ', object_nl: ' ')%>,
99+
"annotations": <%= metadata.fetch(:annotations, {}).to_json(space: ' ', object_nl: ' ')%>
100+
},
101+
"links": {
102+
"self": {
103+
"href": "https://api.example.com/v3/stacks/11c916c9-c2f9-440e-8e73-102e79c4704d"
104+
}
105+
}
106+
}
107+
<% end %>

docs/v3/source/includes/resources/stacks/_object.md.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Name | Type | Description
1414
**updated_at** | _[timestamp](#timestamps)_ | The time with zone when the object was last updated
1515
**name** | _string_ | The name of the stack
1616
**description** | _string_ | The description of the stack
17+
**state** | string | The state of the stack; valid states are: `ACTIVE`, `RESTRICTED`, `DEPRECATED`, `DISABLED`
1718
**build_rootfs_image** | _string | The name of the stack image associated with staging/building Apps. If a stack does not have unique images, this will be the same as the stack name.
1819
**run_rootfs_image** | _string | The name of the stack image associated with running Apps + Tasks. If a stack does not have unique images, this will be the same as the stack name.
1920
**default** | _boolean_ | Whether the stack is configured to be the default stack for new applications.

docs/v3/source/includes/resources/stacks/_update.md.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ curl "https://api.example.org/v3/stacks/[guid]" \
99
-X PATCH \
1010
-H "Authorization: bearer [token]" \
1111
-H "Content-Type: application/json" \
12-
-d '{ "metadata": { "labels": { "key": "value" }, "annotations": {"note": "detailed information"}}}'
12+
-d '{ "metadata": { "labels": { "key": "value" }, "annotations": {"note": "detailed information"}, "state": "DISABLED" }}'
1313

1414
```
1515

@@ -21,7 +21,7 @@ Example Response
2121
HTTP/1.1 200 OK
2222
Content-Type: application/json
2323

24-
<%= yield_content :single_stack, labels: { "key" => "value" }, "annotations": {"note" => "detailed information"} %>
24+
<%= yield_content :single_stack_disabled, labels: { "key" => "value" }, "annotations": {"note" => "detailed information"} %>
2525
```
2626

2727
#### Definition
@@ -33,6 +33,7 @@ Name | Type | Description
3333
---- | ---- | -----------
3434
**metadata.labels** | [_label object_](#labels) | Labels applied to the stack
3535
**metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the stack
36+
**state** | string | The state of the stack; valid states are: `ACTIVE`, `RESTRICTED`, `DEPRECATED`, `DISABLED`
3637

3738
#### Permitted roles
3839
|

0 commit comments

Comments
 (0)