/
vra_client.go
437 lines (352 loc) · 16.1 KB
/
vra_client.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
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
// Code generated by go-swagger; DO NOT EDIT.
package client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/vmware/vra-sdk-go/pkg/client/about"
"github.com/vmware/vra-sdk-go/pkg/client/blueprint"
"github.com/vmware/vra-sdk-go/pkg/client/blueprint_requests"
"github.com/vmware/vra-sdk-go/pkg/client/blueprint_terraform_integrations"
"github.com/vmware/vra-sdk-go/pkg/client/blueprint_validation"
"github.com/vmware/vra-sdk-go/pkg/client/catalog_admin_items"
"github.com/vmware/vra-sdk-go/pkg/client/catalog_entitlements"
"github.com/vmware/vra-sdk-go/pkg/client/catalog_item_types"
"github.com/vmware/vra-sdk-go/pkg/client/catalog_items"
"github.com/vmware/vra-sdk-go/pkg/client/catalog_sources"
"github.com/vmware/vra-sdk-go/pkg/client/cloud_account"
"github.com/vmware/vra-sdk-go/pkg/client/compute"
"github.com/vmware/vra-sdk-go/pkg/client/compute_gateway"
"github.com/vmware/vra-sdk-go/pkg/client/compute_nat"
"github.com/vmware/vra-sdk-go/pkg/client/content_source"
"github.com/vmware/vra-sdk-go/pkg/client/custom_integrations"
"github.com/vmware/vra-sdk-go/pkg/client/data_collector"
"github.com/vmware/vra-sdk-go/pkg/client/deployment"
"github.com/vmware/vra-sdk-go/pkg/client/deployment_actions"
"github.com/vmware/vra-sdk-go/pkg/client/deployments"
"github.com/vmware/vra-sdk-go/pkg/client/disk"
"github.com/vmware/vra-sdk-go/pkg/client/endpoints"
"github.com/vmware/vra-sdk-go/pkg/client/executions"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_aws_volume_types"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_azure_storage_account"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_compute"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_flavors"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_images"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_network"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_vsphere_datastore"
"github.com/vmware/vra-sdk-go/pkg/client/fabric_vsphere_storage_policies"
"github.com/vmware/vra-sdk-go/pkg/client/flavor_profile"
"github.com/vmware/vra-sdk-go/pkg/client/flavors"
"github.com/vmware/vra-sdk-go/pkg/client/icons"
"github.com/vmware/vra-sdk-go/pkg/client/image_profile"
"github.com/vmware/vra-sdk-go/pkg/client/images"
"github.com/vmware/vra-sdk-go/pkg/client/load_balancer"
"github.com/vmware/vra-sdk-go/pkg/client/location"
"github.com/vmware/vra-sdk-go/pkg/client/login"
"github.com/vmware/vra-sdk-go/pkg/client/marketplace"
"github.com/vmware/vra-sdk-go/pkg/client/marketplace_downloads"
"github.com/vmware/vra-sdk-go/pkg/client/network"
"github.com/vmware/vra-sdk-go/pkg/client/network_ip_range"
"github.com/vmware/vra-sdk-go/pkg/client/network_profile"
"github.com/vmware/vra-sdk-go/pkg/client/perspective_sync"
"github.com/vmware/vra-sdk-go/pkg/client/pipelines"
"github.com/vmware/vra-sdk-go/pkg/client/policies"
"github.com/vmware/vra-sdk-go/pkg/client/policy_decisions"
"github.com/vmware/vra-sdk-go/pkg/client/policy_types"
"github.com/vmware/vra-sdk-go/pkg/client/pricing_card_assignments"
"github.com/vmware/vra-sdk-go/pkg/client/pricing_cards"
"github.com/vmware/vra-sdk-go/pkg/client/project"
"github.com/vmware/vra-sdk-go/pkg/client/property_groups"
"github.com/vmware/vra-sdk-go/pkg/client/request"
"github.com/vmware/vra-sdk-go/pkg/client/requests"
"github.com/vmware/vra-sdk-go/pkg/client/resource_actions"
"github.com/vmware/vra-sdk-go/pkg/client/resource_types"
"github.com/vmware/vra-sdk-go/pkg/client/resources"
"github.com/vmware/vra-sdk-go/pkg/client/security_group"
"github.com/vmware/vra-sdk-go/pkg/client/source_control_sync"
"github.com/vmware/vra-sdk-go/pkg/client/storage_profile"
"github.com/vmware/vra-sdk-go/pkg/client/tags"
"github.com/vmware/vra-sdk-go/pkg/client/triggers"
"github.com/vmware/vra-sdk-go/pkg/client/user_operations"
"github.com/vmware/vra-sdk-go/pkg/client/vcf"
"github.com/vmware/vra-sdk-go/pkg/client/variables"
)
// Default vmware cloud assembly iaas API HTTP client.
var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "api.mgmt.cloud.vmware.com"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"https"}
// NewHTTPClient creates a new vmware cloud assembly iaas API HTTP client.
func NewHTTPClient(formats strfmt.Registry) *MulticloudIaaS {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new vmware cloud assembly iaas API HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *MulticloudIaaS {
// ensure nullable parameters have default
if cfg == nil {
cfg = DefaultTransportConfig()
}
// create transport and client
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
return New(transport, formats)
}
// New creates a new vmware cloud assembly iaas API client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *MulticloudIaaS {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
}
cli := new(MulticloudIaaS)
cli.Transport = transport
cli.About = about.New(transport, formats)
cli.Blueprint = blueprint.New(transport, formats)
cli.BlueprintRequests = blueprint_requests.New(transport, formats)
cli.BlueprintTerraformIntegrations = blueprint_terraform_integrations.New(transport, formats)
cli.BlueprintValidation = blueprint_validation.New(transport, formats)
cli.CatalogAdminItems = catalog_admin_items.New(transport, formats)
cli.CatalogEntitlements = catalog_entitlements.New(transport, formats)
cli.CatalogItemTypes = catalog_item_types.New(transport, formats)
cli.CatalogItems = catalog_items.New(transport, formats)
cli.CatalogSources = catalog_sources.New(transport, formats)
cli.CloudAccount = cloud_account.New(transport, formats)
cli.Compute = compute.New(transport, formats)
cli.ComputeGateway = compute_gateway.New(transport, formats)
cli.ComputeNat = compute_nat.New(transport, formats)
cli.ContentSource = content_source.New(transport, formats)
cli.CustomIntegrations = custom_integrations.New(transport, formats)
cli.DataCollector = data_collector.New(transport, formats)
cli.Deployment = deployment.New(transport, formats)
cli.DeploymentActions = deployment_actions.New(transport, formats)
cli.Deployments = deployments.New(transport, formats)
cli.Disk = disk.New(transport, formats)
cli.Endpoints = endpoints.New(transport, formats)
cli.Executions = executions.New(transport, formats)
cli.FabricawsVolumeTypes = fabric_aws_volume_types.New(transport, formats)
cli.FabricAzureStorageAccount = fabric_azure_storage_account.New(transport, formats)
cli.FabricCompute = fabric_compute.New(transport, formats)
cli.FabricFlavors = fabric_flavors.New(transport, formats)
cli.FabricImages = fabric_images.New(transport, formats)
cli.FabricNetwork = fabric_network.New(transport, formats)
cli.FabricvSphereDatastore = fabric_vsphere_datastore.New(transport, formats)
cli.FabricvSphereStoragePolicies = fabric_vsphere_storage_policies.New(transport, formats)
cli.FlavorProfile = flavor_profile.New(transport, formats)
cli.Flavors = flavors.New(transport, formats)
cli.Icons = icons.New(transport, formats)
cli.ImageProfile = image_profile.New(transport, formats)
cli.Images = images.New(transport, formats)
cli.LoadBalancer = load_balancer.New(transport, formats)
cli.Location = location.New(transport, formats)
cli.Login = login.New(transport, formats)
cli.Marketplace = marketplace.New(transport, formats)
cli.MarketplaceDownloads = marketplace_downloads.New(transport, formats)
cli.Network = network.New(transport, formats)
cli.NetworkIPRange = network_ip_range.New(transport, formats)
cli.NetworkProfile = network_profile.New(transport, formats)
cli.PerspectiveSync = perspective_sync.New(transport, formats)
cli.Pipelines = pipelines.New(transport, formats)
cli.Policies = policies.New(transport, formats)
cli.PolicyDecisions = policy_decisions.New(transport, formats)
cli.PolicyTypes = policy_types.New(transport, formats)
cli.PricingCardAssignments = pricing_card_assignments.New(transport, formats)
cli.PricingCards = pricing_cards.New(transport, formats)
cli.Project = project.New(transport, formats)
cli.PropertyGroups = property_groups.New(transport, formats)
cli.Request = request.New(transport, formats)
cli.Requests = requests.New(transport, formats)
cli.ResourceActions = resource_actions.New(transport, formats)
cli.ResourceTypes = resource_types.New(transport, formats)
cli.Resources = resources.New(transport, formats)
cli.SecurityGroup = security_group.New(transport, formats)
cli.SourceControlSync = source_control_sync.New(transport, formats)
cli.StorageProfile = storage_profile.New(transport, formats)
cli.Tags = tags.New(transport, formats)
cli.Triggers = triggers.New(transport, formats)
cli.UserOperations = user_operations.New(transport, formats)
cli.Vcf = vcf.New(transport, formats)
cli.Variables = variables.New(transport, formats)
return cli
}
// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
return &TransportConfig{
Host: DefaultHost,
BasePath: DefaultBasePath,
Schemes: DefaultSchemes,
}
}
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
Host string
BasePath string
Schemes []string
}
// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
cfg.Host = host
return cfg
}
// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
cfg.BasePath = basePath
return cfg
}
// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
cfg.Schemes = schemes
return cfg
}
// MulticloudIaaS is a client for vmware cloud assembly iaas API
type MulticloudIaaS struct {
About about.ClientService
Blueprint blueprint.ClientService
BlueprintRequests blueprint_requests.ClientService
BlueprintTerraformIntegrations blueprint_terraform_integrations.ClientService
BlueprintValidation blueprint_validation.ClientService
CatalogAdminItems catalog_admin_items.ClientService
CatalogEntitlements catalog_entitlements.ClientService
CatalogItemTypes catalog_item_types.ClientService
CatalogItems catalog_items.ClientService
CatalogSources catalog_sources.ClientService
CloudAccount cloud_account.ClientService
Compute compute.ClientService
ComputeGateway compute_gateway.ClientService
ComputeNat compute_nat.ClientService
ContentSource content_source.ClientService
CustomIntegrations custom_integrations.ClientService
DataCollector data_collector.ClientService
Deployment deployment.ClientService
DeploymentActions deployment_actions.ClientService
Deployments deployments.ClientService
Disk disk.ClientService
Endpoints endpoints.ClientService
Executions executions.ClientService
FabricawsVolumeTypes fabric_aws_volume_types.ClientService
FabricAzureStorageAccount fabric_azure_storage_account.ClientService
FabricCompute fabric_compute.ClientService
FabricFlavors fabric_flavors.ClientService
FabricImages fabric_images.ClientService
FabricNetwork fabric_network.ClientService
FabricvSphereDatastore fabric_vsphere_datastore.ClientService
FabricvSphereStoragePolicies fabric_vsphere_storage_policies.ClientService
FlavorProfile flavor_profile.ClientService
Flavors flavors.ClientService
Icons icons.ClientService
ImageProfile image_profile.ClientService
Images images.ClientService
LoadBalancer load_balancer.ClientService
Location location.ClientService
Login login.ClientService
Marketplace marketplace.ClientService
MarketplaceDownloads marketplace_downloads.ClientService
Network network.ClientService
NetworkIPRange network_ip_range.ClientService
NetworkProfile network_profile.ClientService
PerspectiveSync perspective_sync.ClientService
Pipelines pipelines.ClientService
Policies policies.ClientService
PolicyDecisions policy_decisions.ClientService
PolicyTypes policy_types.ClientService
PricingCardAssignments pricing_card_assignments.ClientService
PricingCards pricing_cards.ClientService
Project project.ClientService
PropertyGroups property_groups.ClientService
Request request.ClientService
Requests requests.ClientService
ResourceActions resource_actions.ClientService
ResourceTypes resource_types.ClientService
Resources resources.ClientService
SecurityGroup security_group.ClientService
SourceControlSync source_control_sync.ClientService
StorageProfile storage_profile.ClientService
Tags tags.ClientService
Triggers triggers.ClientService
UserOperations user_operations.ClientService
Vcf vcf.ClientService
Variables variables.ClientService
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *MulticloudIaaS) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.About.SetTransport(transport)
c.Blueprint.SetTransport(transport)
c.BlueprintRequests.SetTransport(transport)
c.BlueprintTerraformIntegrations.SetTransport(transport)
c.BlueprintValidation.SetTransport(transport)
c.CatalogAdminItems.SetTransport(transport)
c.CatalogEntitlements.SetTransport(transport)
c.CatalogItemTypes.SetTransport(transport)
c.CatalogItems.SetTransport(transport)
c.CatalogSources.SetTransport(transport)
c.CloudAccount.SetTransport(transport)
c.Compute.SetTransport(transport)
c.ComputeGateway.SetTransport(transport)
c.ComputeNat.SetTransport(transport)
c.ContentSource.SetTransport(transport)
c.CustomIntegrations.SetTransport(transport)
c.DataCollector.SetTransport(transport)
c.Deployment.SetTransport(transport)
c.DeploymentActions.SetTransport(transport)
c.Deployments.SetTransport(transport)
c.Disk.SetTransport(transport)
c.Endpoints.SetTransport(transport)
c.Executions.SetTransport(transport)
c.FabricawsVolumeTypes.SetTransport(transport)
c.FabricAzureStorageAccount.SetTransport(transport)
c.FabricCompute.SetTransport(transport)
c.FabricFlavors.SetTransport(transport)
c.FabricImages.SetTransport(transport)
c.FabricNetwork.SetTransport(transport)
c.FabricvSphereDatastore.SetTransport(transport)
c.FabricvSphereStoragePolicies.SetTransport(transport)
c.FlavorProfile.SetTransport(transport)
c.Flavors.SetTransport(transport)
c.Icons.SetTransport(transport)
c.ImageProfile.SetTransport(transport)
c.Images.SetTransport(transport)
c.LoadBalancer.SetTransport(transport)
c.Location.SetTransport(transport)
c.Login.SetTransport(transport)
c.Marketplace.SetTransport(transport)
c.MarketplaceDownloads.SetTransport(transport)
c.Network.SetTransport(transport)
c.NetworkIPRange.SetTransport(transport)
c.NetworkProfile.SetTransport(transport)
c.PerspectiveSync.SetTransport(transport)
c.Pipelines.SetTransport(transport)
c.Policies.SetTransport(transport)
c.PolicyDecisions.SetTransport(transport)
c.PolicyTypes.SetTransport(transport)
c.PricingCardAssignments.SetTransport(transport)
c.PricingCards.SetTransport(transport)
c.Project.SetTransport(transport)
c.PropertyGroups.SetTransport(transport)
c.Request.SetTransport(transport)
c.Requests.SetTransport(transport)
c.ResourceActions.SetTransport(transport)
c.ResourceTypes.SetTransport(transport)
c.Resources.SetTransport(transport)
c.SecurityGroup.SetTransport(transport)
c.SourceControlSync.SetTransport(transport)
c.StorageProfile.SetTransport(transport)
c.Tags.SetTransport(transport)
c.Triggers.SetTransport(transport)
c.UserOperations.SetTransport(transport)
c.Vcf.SetTransport(transport)
c.Variables.SetTransport(transport)
}