Repository navigation
Expand file tree
/
Copy pathjson_structure.go
More file actions
289 lines (259 loc) · 11.2 KB
/
Copy pathjson_structure.go
File metadata and controls
289 lines (259 loc) · 11.2 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
package cloudforms
import "time"
//===================================================================================
// Structure for cloudfroms resource
//===================================================================================
type requestJsonstruct struct {
Results []Results `json:"results"`
}
// Dialog : this is an interface for dialog parameters present in input template.
type Dialog interface {
}
// WorkflowSettings :
type WorkflowSettings struct {
ResourceActionID string `json:"resource_action_id"`
DialogID string `json:"dialog_id"`
}
//RequestOptions :
type RequestOptions struct {
SubmitWorkflow bool `json:"submit_workflow"`
InitDefaults bool `json:"init_defaults"`
}
// Options :
type Options struct {
Dialog Dialog `json:"dialog"`
WorkflowSettings WorkflowSettings `json:"workflow_settings"`
Initiator interface{} `json:"initiator"`
SrcID string `json:"src_id"`
RequestOptions RequestOptions `json:"request_options"`
CartState string `json:"cart_state"`
RequesterGroup string `json:"requester_group"`
}
// Results : Struct for result obtain after ordering service.
type Results struct {
Href string `json:"href"`
ID string `json:"id"`
Description string `json:"description"`
ApprovalState string `json:"approval_state"`
Type string `json:"type"`
CreatedOn time.Time `json:"created_on"`
UpdatedOn time.Time `json:"updated_on"`
FulfilledOn interface{} `json:"fulfilled_on"`
RequesterID string `json:"requester_id"`
RequesterName string `json:"requester_name"`
RequestType string `json:"request_type"`
RequestState string `json:"request_state"`
Message string `json:"message"`
Status string `json:"status"`
Options Options `json:"options"`
Userid string `json:"userid"`
SourceID string `json:"source_id"`
SourceType string `json:"source_type"`
DestinationID interface{} `json:"destination_id"`
DestinationType interface{} `json:"destination_type"`
TenantID string `json:"tenant_id"`
ServiceOrderID string `json:"service_order_id"`
Process bool `json:"process"`
CancelationStatus interface{} `json:"cancelation_status"`
}
//Struct for input json template.
type template struct {
Action string `json:"action"`
Resource Resource `json:"resource"`
}
// Resource : struct to store attribute of service
type Resource interface {
}
//===================================================================================
// Structure for cloudforms data source
//===================================================================================
// ServiceDetails : Struct for ServiceDetails expand = service_templates
type ServiceDetails struct {
Href string `json:"href"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
TenantID string `json:"tenant_id"`
ServiceTemplates []ServiceTemplates `json:"service_templates"`
}
// Options1 :
type Options1 struct {
}
// Resources1 : Resources under Service_templates
type Resources1 struct {
Href string `json:"href"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
GUID string `json:"guid"`
Type string `json:"type"`
ServiceTemplateID interface{} `json:"service_template_id"`
Options Options1 `json:"options"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Display bool `json:"display"`
EvmOwnerID interface{} `json:"evm_owner_id"`
MiqGroupID string `json:"miq_group_id"`
ServiceType string `json:"service_type"`
ProvType string `json:"prov_type"`
ProvisionCost interface{} `json:"provision_cost"`
ServiceTemplateCatalogID string `json:"service_template_catalog_id"`
LongDescription string `json:"long_description"`
TenantID string `json:"tenant_id"`
GenericSubtype interface{} `json:"generic_subtype"`
DeletedOn interface{} `json:"deleted_on"`
Internal bool `json:"internal"`
}
// ServiceTemplates : From expand = Service_templates
type ServiceTemplates struct {
Href string `json:"href"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
GUID string `json:"guid"`
Type string `json:"type"`
ServiceTemplateID interface{} `json:"service_template_id"`
Options Options1 `json:"options"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Display bool `json:"display"`
EvmOwnerID interface{} `json:"evm_owner_id"`
MiqGroupID string `json:"miq_group_id"`
ServiceType string `json:"service_type"`
ProvType string `json:"prov_type"`
ProvisionCost interface{} `json:"provision_cost"`
ServiceTemplateCatalogID string `json:"service_template_catalog_id"`
LongDescription string `json:"long_description"`
TenantID string `json:"tenant_id"`
GenericSubtype interface{} `json:"generic_subtype"`
DeletedOn interface{} `json:"deleted_on"`
Internal bool `json:"internal"`
}
// ServiceCatalogs : This is struct for service catalogs
type ServiceCatalogs struct {
Name string `json:"name"`
Count int `json:"count"`
Subcount int `json:"subcount"`
Pages int `json:"pages"`
Resources []Resources `json:"resources"`
Actions []Actions `json:"actions"`
Links Links `json:"links"`
}
// Resources11 ... under ServiceTemplates
type Resources11 struct {
Href string `json:"href"`
}
// Actions : Generic Actions
type Actions struct {
Name string `json:"name"`
Method string `json:"method"`
Href string `json:"href"`
}
// Links : Generic Links
type Links struct {
Self string `json:"self"`
First string `json:"first"`
Last string `json:"last"`
}
// ServiceTemplatesUndercatalogs : From expand = resources
type ServiceTemplatesUndercatalogs struct {
Count int `json:"count"`
Pages int `json:"pages"`
Resources []Resources11 `json:"resources"`
Actions []Actions `json:"actions"`
Links Links `json:"links"`
}
// Resources : parent resource which contains hidden service template
type Resources struct {
Href string `json:"href"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
TenantID string `json:"tenant_id"`
ServiceTemplates ServiceTemplatesUndercatalogs `json:"service_templates"`
}
// TemplateDetail :
type TemplateDetail struct {
Href string `json:"href"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
GUID string `json:"guid"`
Type string `json:"type"`
ServiceTemplateID interface{} `json:"service_template_id"`
Options Options1 `json:"options"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Display bool `json:"display"`
EvmOwnerID interface{} `json:"evm_owner_id"`
MiqGroupID string `json:"miq_group_id"`
ServiceType string `json:"service_type"`
ProvType string `json:"prov_type"`
ProvisionCost interface{} `json:"provision_cost"`
ServiceTemplateCatalogID string `json:"service_template_catalog_id"`
LongDescription string `json:"long_description"`
TenantID string `json:"tenant_id"`
GenericSubtype interface{} `json:"generic_subtype"`
DeletedOn interface{} `json:"deleted_on"`
Internal bool `json:"internal"`
ConfigInfo ConfigInfo `json:"config_info"`
Actions []Actions `json:"actions"`
}
// Provision :
type Provision struct {
DialogID string `json:"dialog_id"`
Fqname string `json:"fqname"`
}
// ConfigInfo :
type ConfigInfo struct {
ConfigurationScriptID string `json:"configuration_script_id"`
Provision Provision `json:"provision"`
}
// ResponseError : Structure to handle response error
type ResponseError struct {
Error Error `json:"error"`
}
// Error : Contains kind, message,klass
type Error struct {
Kind string `json:"kind"`
Message string `json:"message"`
Klass string `json:"klass"`
}
// -----------------------------------------
// TemplateQuery : Struct for filtered response of template
type TemplateQuery struct {
Name string `json:"name"`
Count int `json:"count"`
Subcount int `json:"subcount"`
SubqueryCount int `json:"subquery_count"`
Pages int `json:"pages"`
Resources []Template `json:"resources"`
Actions []Actions `json:"actions"`
Links Links `json:"links"`
}
// Template :
type Template struct {
Href string `json:"href"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
GUID string `json:"guid"`
Type string `json:"type"`
ServiceTemplateID interface{} `json:"service_template_id"`
Options Options1 `json:"options"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Display bool `json:"display"`
EvmOwnerID interface{} `json:"evm_owner_id"`
MiqGroupID string `json:"miq_group_id"`
ServiceType string `json:"service_type"`
ProvType string `json:"prov_type"`
ProvisionCost interface{} `json:"provision_cost"`
ServiceTemplateCatalogID string `json:"service_template_catalog_id"`
LongDescription string `json:"long_description"`
TenantID string `json:"tenant_id"`
GenericSubtype interface{} `json:"generic_subtype"`
DeletedOn interface{} `json:"deleted_on"`
Internal bool `json:"internal"`
Actions []Actions `json:"actions"`
}