forked from cloudfoundry/cloud_controller_ng
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_stacks.erb
More file actions
111 lines (108 loc) · 3.24 KB
/
_stacks.erb
File metadata and controls
111 lines (108 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<% content_for :single_stack do | metadata={} | %>
{
"guid": "11c916c9-c2f9-440e-8e73-102e79c4704d",
"created_at": "2018-11-09T22:43:28Z",
"updated_at": "2018-11-09T22:43:28Z",
"name": "my-stack",
"description": "Here is my stack!",
"state": "ACTIVE",
"state_reason": null,
"build_rootfs_image": "my-stack",
"run_rootfs_image": "my-stack",
"default": true,
"metadata": {
"labels": <%= metadata.fetch(:labels, {}).to_json(space: ' ', object_nl: ' ')%>,
"annotations": <%= metadata.fetch(:annotations, {}).to_json(space: ' ', object_nl: ' ')%>
},
"links": {
"self": {
"href": "https://api.example.com/v3/stacks/11c916c9-c2f9-440e-8e73-102e79c4704d"
}
}
}
<% end %>
<%content_for :paginated_list_of_stacks do |base_url| %>
{
"pagination": {
"total_results": 3,
"total_pages": 2,
"first": {
"href": "https://api.example.org<%= base_url %>?page=1&per_page=2"
},
"last": {
"href": "https://api.example.org<%= base_url %>?page=2&per_page=2"
},
"next": {
"href": "https://api.example.org<%= base_url %>?page=2&per_page=2"
},
"previous": null
},
"resources": [
{
"guid": "11c916c9-c2f9-440e-8e73-102e79c4704d",
"created_at": "2018-11-09T22:43:28Z",
"updated_at": "2018-11-09T22:43:28Z",
"name": "my-stack-1",
"build_rootfs_image": "my-stack-1-build",
"run_rootfs_image": "my-stack-1-run",
"description": "This is my first stack!",
"state": "ACTIVE",
"state_reason": null,
"default": true,
"metadata": {
"labels": {},
"annotations": {}
},
"links": {
"self": {
"href": "https://api.example.org<%= base_url %>/11c916c9-c2f9-440e-8e73-102e79c4704d"
}
}
},
{
"guid": "81c916c9-c2f9-440e-8e73-102e79c4704h",
"created_at": "2018-11-09T22:43:29Z",
"updated_at": "2018-11-09T22:43:29Z",
"name": "my-stack-2",
"description": "This is my second stack!",
"build_rootfs_image": "my-stack-2-build",
"run_rootfs_image": "my-stack-2-run",
"state": "DEPRECATED",
"state_reason": "Stack deprecated and will be removed in future release",
"default": false,
"metadata": {
"labels": {},
"annotations": {}
},
"links": {
"self": {
"href": "https://api.example.org<%= base_url %>/81c916c9-c2f9-440e-8e73-102e79c4704h"
}
}
}
]
}
<% end %>
<% content_for :single_stack_disabled do | metadata={} | %>
{
"guid": "11c916c9-c2f9-440e-8e73-102e79c4704d",
"created_at": "2018-11-09T22:43:28Z",
"updated_at": "2018-11-09T22:43:28Z",
"name": "my-stack",
"description": "Here is my stack!",
"state": "DISABLED",
"state_reason": "Stack disabled and cannot be used for staging new application",
"build_rootfs_image": "my-stack",
"run_rootfs_image": "my-stack",
"default": true,
"metadata": {
"labels": <%= metadata.fetch(:labels, {}).to_json(space: ' ', object_nl: ' ')%>,
"annotations": <%= metadata.fetch(:annotations, {}).to_json(space: ' ', object_nl: ' ')%>
},
"links": {
"self": {
"href": "https://api.example.com/v3/stacks/11c916c9-c2f9-440e-8e73-102e79c4704d"
}
}
}
<% end %>