This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cf-struct.go
157 lines (135 loc) · 3.87 KB
/
cf-struct.go
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
package cf_utils
type ErrorResponse struct {
Code int `json:"code"`
Description string `json:"description"`
Error_code string `json:"error_code"`
}
type GenericResponse struct {
Metadata struct {
Guid string `json:"guid"`
Url string `json:"url"`
} `json:"metadata"`
Entity struct {
Name string `json:"name"`
} `json:"entity"`
}
type QueryResponse struct {
Resources []GenericResponse `struct:"resources"`
}
/*
type GenericUrl struct {
Host string `json:"host"`
}
*/
type GenericUri struct {
Uri string `json:"uri"`
}
type GenericUsage struct {
Time string `json:"time"`
Cpu float64 `json:"cpu"`
Memory int `json:"mem"`
Disk int `json:"disk"`
}
type GenericDomain struct {
Name string `json:"name"`
}
type GenericRoute struct {
Host string `json:"host"`
Domain GenericDomain `struct:"domain"`
}
type AppDetail struct {
Guid string `json:"guid"`
Urls []string `json:"urls"`
Routes []GenericRoute `json:"routes"`
Services []string `json:"service_names"`
Running int `json:"running_instances"`
Name string `json:"name"`
Detected_buildpack string `json:"detected_buildpack"`
State string `json:"state"`
Memory int `json:"memory"`
Instances int `json:"instances"`
Disk int `json:"disk_quota"`
Environment_json string `json:"environment_json"`
Command string `json:"command"`
Detected_start_command string `json:"detected_start_command"`
}
type ServicePlanProviderDetail struct {
Label string `json:"label"`
Provider string `json:"provider"`
}
type ServicePlanDetail struct {
Guid string `json:"guid"`
Name string `json:"name"`
ServiceProvider ServicePlanProviderDetail `json:"service"`
}
type ServiceDetail struct {
Guid string `json:"guid"`
Name string `json:"name"`
Bound_App_Count int `json:"bound_app_count"`
Plan ServicePlanDetail `json:"service_plan"`
}
type AppStat struct {
Name string `json:"name"`
Uris []string `json:"uris"`
Host string `json:"host"`
Port int `json:"port"`
Uptime int `json:"uptime"`
Memory_Quota int `json:"mem_quota"`
Disk_Quota int `json:"disk_quota"`
Usage GenericUsage `json:"usage"`
}
type AppStatsResponse struct {
State string `json:"state"`
Stat AppStat `json:"stats"`
}
type SpaceSummaryResponse struct {
Guid string `json:"guid"`
Name string `json:"name"`
Apps []AppDetail `struct:"apps"`
Services []ServiceDetail `struct:"services"`
}
type SpaceResponse struct {
Guid string `json:"guid"`
Name string `json:"name"`
Metadata struct {
Guid string `json:"guid"`
Url string `json:"url"`
} `json:"metadata"`
Entity struct {
Name string `json:"name"`
} `json:"entity"`
}
type AppSummaryResponse struct {
Metadata struct {
Guid string `json:"guid"`
Url string `json:"url"`
} `json:"metadata"`
Entity struct {
Name string `json:"name"`
//Urls []GenericUrl `json:"urls"`
//Routes []GenericRoute `json:"routes"`
//Running int `json:"running_instances"`
Buildpack string `json:"buildpack"`
Detected_buildpack string `json:"detected_buildpack"`
Environment_json string `json:"environment_json"`
Memory int `json:"memory"`
Instances int `json:"instances"`
Disk int `json:"disk_quota"`
State string `json:"state"`
Command string `json:"command"`
Detected_start_command string `json:"detected_start_command"`
} `json:"entity"`
}
type SpaceAppResponse struct {
Metadata struct {
Guid string `json:"guid"`
Url string `json:"url"`
} `json:"metadata"`
Entity struct {
Name string `json:"name"`
Instances int `json:"instances"`
} `json:"entity"`
}
type SpaceAppQueryResponse struct {
Resources []SpaceAppResponse `struct:"resources"`
}