Debian Codegraph @

photon/apitypes.go

raw symbols SCIP
1 // Copyright (c) 2016 VMware, Inc. All Rights Reserved.
2 //
3 // This product is licensed to you under the Apache License, Version 2.0 (the "License").
4 // You may not use this product except in compliance with the License.
5 //
6 // This product may include a number of subcomponents with separate copyright notices and
7 // license terms. Your use of these subcomponents is subject to the terms and conditions
8 // of the subcomponent's license, as noted in the LICENSE file.
9
10 package photon
11
12 import (
13 "fmt"
14 )
15
16 type Entity struct {
17 ID string `json:"id"`
18 Kind string `json:"kind"`
19 }
20
21 // Implement a generic sdk error
22 type SdkError struct {
23 Message string
24 }
25
26 func (e SdkError) Error() string {
27 return fmt.Sprintf("photon: %v", e.Message)
28 }
29
30 // Represents an error from the Photon API.
31 type ApiError struct {
32 Code string `json:"code"`
33 Data map[string]interface{} `json:"data"`
34 Message string `json:"message"`
35 HttpStatusCode int `json:"-"` // Not part of API contract
36 }
37
38 // Implement Go error interface for ApiError
39 func (e ApiError) Error() string {
40 return fmt.Sprintf(
41 "photon: { HTTP status: '%v', code: '%v', message: '%v', data: '%v' }",
42 e.HttpStatusCode,
43 e.Code,
44 e.Message,
45 e.Data)
46 }
47
48 // Used to represent a generic HTTP error, i.e. an unexpected HTTP 500.
49 type HttpError struct {
50 StatusCode int
51 Message string
52 }
53
54 // Implementation of error interface for HttpError
55 func (e HttpError) Error() string {
56 return fmt.Sprintf("photon: HTTP %d: %v", e.StatusCode, e.Message)
57 }
58
59 // Represents an Photon task that has entered into an error state.
60 // Photon task errors can be caught and type-checked against with
61 // the usual Go idiom.
62 type TaskError struct {
63 ID string `json:"id"`
64 Step Step `json:"step,omitempty"`
65 }
66
67 // Implement Go error interface for TaskError.
68 func (e TaskError) Error() string {
69 return fmt.Sprintf("photon: Task '%s' is in error state: {@step==%s}", e.ID, GetStep(e.Step))
70 }
71
72 // An error representing a timeout while waiting for a task to complete.
73 type TaskTimeoutError struct {
74 ID string
75 }
76
77 // Implement Go error interface for TaskTimeoutError.
78 func (e TaskTimeoutError) Error() string {
79 return fmt.Sprintf("photon: Timed out waiting for task '%s'. "+
80 "Task may not be in error state, examine task for full details.", e.ID)
81 }
82
83 // Represents an operation (Step) within a Task.
84 type Step struct {
85 ID string `json:"id"`
86 Operation string `json:"operation,omitempty"`
87 State string `json:"state"`
88 StartedTime int64 `json:"startedTime"`
89 EndTime int64 `json:"endTime,omitempty"`
90 QueuedTime int64 `json:"queuedTime"`
91 Sequence int `json:"sequence,omitempty"`
92 ResourceProperties map[string]interface{} `json:"resourceProperties,omitempty"`
93 Errors []ApiError `json:"errors,omitempty"`
94 Warnings []ApiError `json:"warnings,omitempty"`
95 Options map[string]interface{} `json:"options,omitempty"`
96 SelfLink string `json:"selfLink,omitempty"`
97 }
98
99 // Implement Go error interface for Step.
100 func GetStep(s Step) string {
101 return fmt.Sprintf("{\"sequence\"=>\"%d\",\"state\"=>\"%s\",\"errors\"=>%s,\"warnings\"=>%s,\"operation\"=>\"%s\","+
102 "\"startedTime\"=>\"%d\",\"queuedTime\"=>\"%d\",\"endTime\"=>\"%d\",\"options\"=>%s}",
103 s.Sequence, s.State, s.Errors, s.Warnings, s.Operation, s.StartedTime, s.QueuedTime,
104 s.EndTime, s.Options)
105
106 }
107
108 // Represents an asynchronous task.
109 type Task struct {
110 ID string `json:"id"`
111 Operation string `json:"operation,omitempty"`
112 State string `json:"state"`
113 StartedTime int64 `json:"startedTime"`
114 EndTime int64 `json:"endTime,omitempty"`
115 QueuedTime int64 `json:"queuedTime"`
116 Entity Entity `json:"entity,omitempty"`
117 SelfLink string `json:"selfLink,omitempty"`
118 Steps []Step `json:"steps,omitempty"`
119 ResourceProperties interface{} `json:"resourceProperties,omitempty"`
120 }
121
122 // Represents multiple tasks returned by the API.
123 type TaskList struct {
124 Items []Task `json:"items"`
125 }
126
127 // Options for GetTasks API.
128 type TaskGetOptions struct {
129 State string `urlParam:"state"`
130 Kind string `urlParam:"kind"`
131 EntityID string `urlParam:"entityId"`
132 EntityKind string `urlParam:"entityKind"`
133 }
134
135 type BaseCompact struct {
136 Name string `json:"name"`
137 ID string `json:"id"`
138 }
139
140 type QuotaLineItem struct {
141 Unit string `json:"unit"`
142 Value float64 `json:"value"`
143 Key string `json:"key"`
144 }
145
146 // The QuotaLineItem with limit and usage in one place.
147 type QuotaStatusLineItem struct {
148 Unit string `json:"unit"`
149 Limit float64 `json:"limit"`
150 Usage float64 `json:"usage"`
151 }
152
153 // Creation spec for locality.
154 type LocalitySpec struct {
155 Kind string `json:"kind"`
156 ID string `json:"id"`
157 }
158
159 // Creation spec for disks.
160 type DiskCreateSpec struct {
161 Flavor string `json:"flavor"`
162 Kind string `json:"kind"`
163 CapacityGB int `json:"capacityGb"`
164 Affinities []LocalitySpec `json:"affinities,omitempty"`
165 Name string `json:"name"`
166 Tags []string `json:"tags,omitempty"`
167 }
168
169 // Represents a persistent disk.
170 type PersistentDisk struct {
171 Flavor string `json:"flavor"`
172 Cost []QuotaLineItem `json:"cost"`
173 Kind string `json:"kind"`
174 Datastore string `json:"datastore,omitempty"`
175 CapacityGB int `json:"capacityGb,omitempty"`
176 Name string `json:"name"`
177 State string `json:"state"`
178 ID string `json:"id"`
179 VMs []string `json:"vms"`
180 Tags []string `json:"tags,omitempty"`
181 SelfLink string `json:"selfLink,omitempty"`
182 }
183
184 // Represents multiple persistent disks returned by the API.
185 type DiskList struct {
186 Items []PersistentDisk `json:"items"`
187 }
188
189 // Creation spec for projects.
190 type ProjectCreateSpec struct {
191 Name string `json:"name"`
192 SecurityGroups []string `json:"securityGroups,omitempty"`
193 DefaultRouterPrivateIpCidr string `json:"defaultRouterPrivateIpCidr,omitempty"`
194 ResourceQuota Quota `json:"quota,omitempty"`
195 }
196
197 // Represents multiple projects returned by the API.
198 type ProjectList struct {
199 Items []ProjectCompact `json:"items"`
200 }
201
202 // Compact representation of projects.
203 type ProjectCompact struct {
204 Kind string `json:"kind"`
205 Name string `json:"name"`
206 ID string `json:"id"`
207 Tags []string `json:"tags"`
208 SelfLink string `json:"selfLink"`
209 SecurityGroups []SecurityGroup `json:"securityGroups"`
210 ResourceQuota Quota `json:"quota,omitempty"`
211 }
212
213 // Represents an image.
214 type Image struct {
215 Size int64 `json:"size"`
216 Kind string `json:"kind"`
217 Name string `json:"name"`
218 State string `json:"state"`
219 ID string `json:"id"`
220 Tags []string `json:"tags"`
221 Scope ImageScope `json:"scope"`
222 SelfLink string `json:"selfLink"`
223 Settings []ImageSetting `json:"settings"`
224 ReplicationType string `json:"replicationType"`
225 ReplicationProgress string `json:"replicationProgress"`
226 SeedingProgress string `json:"seedingProgress"`
227 }
228
229 // Represents an image scope.
230 type ImageScope struct {
231 Kind string `json:"kind"`
232 ID string `json:"id"`
233 }
234
235 // Represents an image setting.
236 type ImageSetting struct {
237 Name string `json:"name"`
238 DefaultValue string `json:"defaultValue"`
239 }
240
241 // Creation spec for images.
242 type ImageCreateOptions struct {
243 ReplicationType string
244 }
245
246 // Represents multiple images returned by the API.
247 type Images struct {
248 Items []Image `json:"items"`
249 }
250
251 // Represents a component with status.
252 type Component struct {
253 Component string
254 Message string
255 Status string
256 }
257
258 // Represents status of the photon system.
259 type Status struct {
260 Status string
261 Components []Component
262 }
263
264 // Represents a single tenant.
265 type Tenant struct {
266 Projects []BaseCompact `json:"projects"`
267 Kind string `json:"kind"`
268 Name string `json:"name"`
269 ID string `json:"id"`
270 SelfLink string `json:"selfLink"`
271 Tags []string `json:"tags"`
272 SecurityGroups []SecurityGroup `json:"securityGroups"`
273 ResourceQuota Quota `json:"quota,omitempty"`
274 }
275
276 // Represents multiple tenants returned by the API.
277 type Tenants struct {
278 Items []Tenant `json:"items"`
279 }
280
281 // Creation spec for tenants.
282 type TenantCreateSpec struct {
283 Name string `json:"name"`
284 SecurityGroups []string `json:"securityGroups,omitempty"`
285 ResourceQuota Quota `json:"quota,omitempty"`
286 }
287
288 // Represents the quota
289 type Quota struct {
290 QuotaLineItems map[string]QuotaStatusLineItem `json:"quotaItems"`
291 }
292
293 // QuotaSpec is used when set/update/excluding QuotaLineItems from existing Quota
294 type QuotaSpec map[string]QuotaStatusLineItem
295
296 // Creation spec for VMs.
297 type VmCreateSpec struct {
298 Flavor string `json:"flavor"`
299 SourceImageID string `json:"sourceImageId"`
300 AttachedDisks []AttachedDisk `json:"attachedDisks"`
301 Affinities []LocalitySpec `json:"affinities,omitempty"`
302 Name string `json:"name"`
303 Tags []string `json:"tags,omitempty"`
304 Subnets []string `json:"subnets,omitempty"`
305 Environment map[string]string `json:"environment,omitempty"`
306 }
307
308 // Represents possible operations for VMs. Valid values include:
309 // START_VM, STOP_VM, RESTART_VM, SUSPEND_VM, RESUME_VM
310 type VmOperation struct {
311 Operation string `json:"operation"`
312 Arguments map[string]interface{} `json:"arguments,omitempty"`
313 }
314
315 // Represents metadata that can be set on a VM.
316 type VmMetadata struct {
317 Metadata map[string]string `json:"metadata"`
318 }
319
320 // Represents tags that can be set on a VM.
321 type VmTag struct {
322 Tag string `json:"value"`
323 }
324
325 // Represents a single attached disk.
326 type AttachedDisk struct {
327 Flavor string `json:"flavor"`
328 Kind string `json:"kind"`
329 CapacityGB int `json:"capacityGb,omitempty"`
330 Name string `json:"name"`
331 State string `json:"state"`
332 ID string `json:"id,omitempty"`
333 BootDisk bool `json:"bootDisk"`
334 }
335
336 // Represents a single VM.
337 type VM struct {
338 SourceImageID string `json:"sourceImageId,omitempty"`
339 Cost []QuotaLineItem `json:"cost"`
340 Kind string `json:"kind"`
341 AttachedDisks []AttachedDisk `json:"attachedDisks"`
342 Datastore string `json:"datastore,omitempty"`
343 AttachedISOs []ISO `json:"attachedIsos,omitempty"`
344 Tags []string `json:"tags,omitempty"`
345 Metadata map[string]string `json:"metadata,omitempty"`
346 SelfLink string `json:"selfLink,omitempty"`
347 Flavor string `json:"flavor"`
348 Host string `json:"host,omitempty"`
349 Name string `json:"name"`
350 State string `json:"state"`
351 ID string `json:"id"`
352 FloatingIp string `json:"floatingIp"`
353 }
354
355 // Represents multiple VMs returned by the API.
356 type VMs struct {
357 Items []VM `json:"items"`
358 }
359
360 // Represents an ISO.
361 type ISO struct {
362 Size int64 `json:"size,omitempty"`
363 Kind string `json:"kind,omitempty"`
364 Name string `json:"name"`
365 ID string `json:"id"`
366 }
367
368 // Represents operations for disks.
369 type VmDiskOperation struct {
370 DiskID string `json:"diskId"`
371 Arguments map[string]interface{} `json:"arguments,omitempty"`
372 }
373
374 // Represents a floating IP operation related to a VM.
375 type VmFloatingIpSpec struct {
376 NetworkId string `json:"networkId"`
377 }
378
379 // Creation spec for flavors.
380 type FlavorCreateSpec struct {
381 Cost []QuotaLineItem `json:"cost"`
382 Kind string `json:"kind"`
383 Name string `json:"name"`
384 }
385
386 // Represents a single flavor.
387 type Flavor struct {
388 Cost []QuotaLineItem `json:"cost"`
389 Kind string `json:"kind"`
390 Name string `json:"name"`
391 ID string `json:"id"`
392 Tags []string `json:"tags"`
393 SelfLink string `json:"selfLink"`
394 State string `json:"state"`
395 }
396
397 // Represents multiple flavors returned by the API.
398 type FlavorList struct {
399 Items []Flavor `json:"items"`
400 }
401
402 // Creation spec for hosts.
403 type HostCreateSpec struct {
404 Username string `json:"username"`
405 Password string `json:"password"`
406 Zone string `json:"zone,omitempty"`
407 Metadata map[string]string `json:"metadata,omitempty"`
408 Address string `json:"address"`
409 Tags []string `json:"usageTags"`
410 }
411
412 // Represents a host
413 type Host struct {
414 Username string `json:"username"`
415 Password string `json:"password"`
416 Address string `json:"address"`
417 Kind string `json:"kind"`
418 ID string `json:"id"`
419 Zone string `json:"zone,omitempty"`
420 Tags []string `json:"usageTags"`
421 Metadata map[string]string `json:"metadata,omitempty"`
422 SelfLink string `json:"selfLink"`
423 State string `json:"state"`
424 EsxVersion string `json:"esxVersion"`
425 }
426
427 // Represents multiple hosts returned by the API.
428 type Hosts struct {
429 Items []Host `json:"items"`
430 }
431
432 type Datastore struct {
433 Kind string `json:"kind"`
434 Type string `json:"type"`
435 Tags []string `json:"tags,omitempty"`
436 ID string `json:"id"`
437 SelfLink string `json:"selfLink"`
438 }
439
440 type Datastores struct {
441 Items []Datastore `json:"items"`
442 }
443
444 type SystemUsage struct {
445 NumberHosts int `json:"numberHosts"`
446 NumberVMs int `json:"numberVMs"`
447 NumberTenants int `json:"numberTenants"`
448 NumberProjects int `json:"numberProjects"`
449 NumberDatastores int `json:"numberDatastores"`
450 NumberServices int `json:"numberServices"`
451 }
452
453 // Represents stats information
454 type StatsInfo struct {
455 Enabled bool `json:"enabled,omitempty"`
456 StoreEndpoint string `json:"storeEndpoint,omitempty"`
457 StorePort int `json:"storePort,omitempty"`
458 }
459
460 // Represents authentication information
461 type AuthInfo struct {
462 Password string `json:"password,omitempty"`
463 Endpoint string `json:"endpoint,omitempty"`
464 Domain string `json:"domain,omitempty"`
465 Port int `json:"port,omitempty"`
466 SecurityGroups []string `json:"securityGroups,omitempty"`
467 Username string `json:"username,omitempty"`
468 }
469
470 // Represents ip range
471 type IpRange struct {
472 Start string `json:"start,omitempty"`
473 End string `json:"end,omitempty"`
474 }
475
476 // Represents creation spec for network configuration.
477 type NetworkConfigurationCreateSpec struct {
478 Enabled bool `json:"sdnEnabled,omitempty"`
479 Address string `json:"networkManagerAddress,omitempty"`
480 Username string `json:"networkManagerUsername,omitempty"`
481 Password string `json:"networkManagerPassword,omitempty"`
482 NetworkZoneId string `json:"networkZoneId,omitempty"`
483 TopRouterId string `json:"networkTopRouterId,omitempty"`
484 EdgeIpPoolId string `json:"networkEdgeIpPoolId,omitempty"`
485 HostUplinkPnic string `json:"networkHostUplinkPnic,omitempty"`
486 IpRange string `json:"ipRange,omitempty"`
487 ExternalIpRange *IpRange `json:"externalIpRange,omitempty"`
488 }
489
490 // Represents network configuration.
491 type NetworkConfiguration struct {
492 Enabled bool `json:"sdnEnabled,omitempty"`
493 Address string `json:"networkManagerAddress,omitempty"`
494 Username string `json:"networkManagerUsername,omitempty"`
495 Password string `json:"networkManagerPassword,omitempty"`
496 NetworkZoneId string `json:"networkZoneId,omitempty"`
497 TopRouterId string `json:"networkTopRouterId,omitempty"`
498 EdgeIpPoolId string `json:"networkEdgeIpPoolId,omitempty"`
499 HostUplinkPnic string `json:"networkHostUplinkPnic,omitempty"`
500 IpRange string `json:"ipRange,omitempty"`
501 FloatingIpRange *IpRange `json:"floatingIpRange,omitempty"`
502 SnatIp string `json:"snatIp,omitempty"`
503 }
504
505 // Represents a router
506 type Router struct {
507 ID string `json:"id"`
508 Kind string `json:"kind"`
509 Name string `json:"name"`
510 PrivateIpCidr string `json:"privateIpCidr"`
511 IsDefault bool `json:"isDefault"`
512 }
513
514 // Represents multiple routers returned by the API.
515 type Routers struct {
516 Items []Router `json:"items"`
517 }
518
519 type RouterCreateSpec struct {
520 Name string `json:"name"`
521 PrivateIpCidr string `json:"privateIpCidr"`
522 }
523
524 // Represents name that can be set for router
525 type RouterUpdateSpec struct {
526 RouterName string `json:"name"`
527 }
528
529 // Creation spec for Service Configuration.
530 type ServiceConfigurationSpec struct {
531 Type string `json:"type"`
532 ImageID string `json:"imageId"`
533 }
534
535 // Represnts a Service configuration.
536 type ServiceConfiguration struct {
537 Kind string `json:"kind"`
538 Type string `json:"type"`
539 ImageID string `json:"imageId"`
540 }
541
542 // Creation spec for services.
543 type ServiceCreateSpec struct {
544 Name string `json:"name"`
545 Type string `json:"type"`
546 VMFlavor string `json:"vmFlavor,omitempty"`
547 MasterVmFlavor string `json:"masterVmFlavor,omitempty"`
548 WorkerVmFlavor string `json:"workerVmFlavor,omitempty"`
549 DiskFlavor string `json:"diskFlavor,omitempty"`
550 SubnetId string `json:"subnetId,omitempty"`
551 ImageID string `json:"imageId,omitempty"`
552 WorkerCount int `json:"workerCount"`
553 BatchSizeWorker int `json:"workerBatchExpansionSize,omitempty"`
554 ExtendedProperties map[string]string `json:"extendedProperties"`
555 }
556
557 // Represents a service.
558 type Service struct {
559 Kind string `json:"kind"`
560 Name string `json:"name"`
561 State string `json:"state"`
562 ID string `json:"id"`
563 Type string `json:"type"`
564 ImageID string `json:"imageId"`
565 UpgradeStatus *ServiceUpgradeStatus `json:"upgradeStatus,omitempty"`
566 ProjectID string `json:"projectID,omitempty"`
567 ClientID string `json:"clientId,omitempty"`
568 WorkerCount int `json:"workerCount"`
569 SelfLink string `json:"selfLink,omitempty"`
570 ErrorReason string `json:"errorReason,omitempty"`
571 ExtendedProperties map[string]string `json:"extendedProperties"`
572 }
573
574 // Represents the status of a service during upgrade.
575 type ServiceUpgradeStatus struct {
576 NewImageID string `json:"newImageId"`
577 UpgradeMessage string `json:"upgradeMessage,omitempty"`
578 TotalNodes int `json:"totalNodes,omitempty"`
579 NumNodesUpgraded int `json:"numNodesUpgraded"`
580 UpgradeResultMessage string `json:"upgradeResultMessage,omitempty"`
581 }
582
583 // Represents multiple services returned by the API
584 type Services struct {
585 Items []Service `json:"items"`
586 }
587
588 // Represents service size that can be resized for service
589 type ServiceResizeOperation struct {
590 NewWorkerCount int `json:"newWorkerCount"`
591 }
592
593 // Represents service imageId that can be updated during change version
594 type ServiceChangeVersionOperation struct {
595 NewImageID string `json:"newImageId"`
596 }
597
598 // Represents a security group
599 type SecurityGroup struct {
600 Name string `json:"name"`
601 Inherited bool `json:"inherited"`
602 }
603
604 // Represents set_security_groups spec
605 type SecurityGroupsSpec struct {
606 Items []string `json:"items"`
607 }
608
609 // Represents availability zone that can be set for host
610 type HostSetAvailabilityZoneOperation struct {
611 AvailabilityZoneId string `json:"availabilityZoneId"`
612 }
613
614 // Represents single zone.
615 type Zone struct {
616 Kind string `json:"kind"`
617 Name string `json:"name"`
618 State string `json:"state"`
619 ID string `json:"id"`
620 SelfLink string `json:"selfLink"`
621 }
622
623 // Represents multiple zones returned by the API.
624 type Zones struct {
625 Items []Zone `json:"items"`
626 }
627
628 // Creation spec for zones.
629 type ZoneCreateSpec struct {
630 Name string `json:"name"`
631 }
632
633 // Represents the list of image datastores.
634 type ImageDatastores struct {
635 Items []string `json:"items"`
636 }
637
638 // Image creation spec.
639 type ImageCreateSpec struct {
640 Name string `json:"name"`
641 ReplicationType string `json:"replicationType"`
642 }
643
644 // Represents deployment info
645 type Info struct {
646 BaseVersion string `json:"baseVersion"`
647 FullVersion string `json:"fullVersion"`
648 GitCommitHash string `json:"gitCommitHash"`
649 NetworkType string `json:"networkType"`
650 }
651
652 // NSX configuration spec
653 type NsxConfigurationSpec struct {
654 NsxAddress string `json:"nsxAddress"`
655 NsxUsername string `json:"nsxUsername"`
656 NsxPassword string `json:"nsxPassword"`
657 DhcpServerAddresses map[string]string `json:"dhcpServerAddresses"`
658 FloatingIpRootRange IpRange `json:"floatingIpRootRange"`
659 T0RouterId string `json:"t0RouterId"`
660 EdgeClusterId string `json:"edgeClusterId"`
661 OverlayTransportZoneId string `json:"overlayTransportZoneId"`
662 TunnelIpPoolId string `json:"tunnelIpPoolId"`
663 HostUplinkPnic string `json:"hostUplinkPnic"`
664 HostUplinkVlanId int `json:"hostUplinkVlanId"`
665 DnsServerAddresses []string `json:"dnsServerAddresses"`
666 }
667
668 // Represents a network
669 type Network struct {
670 ID string `json:"id"`
671 Kind string `json:"kind"`
672 Name string `json:"name"`
673 PrivateIpCidr string `json:"privateIpCidr"`
674 IsDefault bool `json:"isDefault"`
675 }
676
677 // Represents multiple networks returned by the API.
678 type Networks struct {
679 Items []Network `json:"items"`
680 }
681
682 type NetworkCreateSpec struct {
683 Name string `json:"name"`
684 PrivateIpCidr string `json:"privateIpCidr"`
685 }
686
687 // Represents name that can be set for network
688 type NetworkUpdateSpec struct {
689 NetworkName string `json:"name"`
690 }
691
692 // Represents port groups.
693 type PortGroups struct {
694 Names []string `json:"names"`
695 }
696
697 // Represents a subnet
698 type Subnet struct {
699 ID string `json:"id"`
700 Kind string `json:"kind"`
701 Name string `json:"name"`
702 Description string `json:"description,omitempty"`
703 PrivateIpCidr string `json:"privateIpCidr"`
704 ReservedIps map[string]string `json:"reservedIps"`
705 State string `json:"state"`
706 IsDefault bool `json:"isDefault"`
707 PortGroups PortGroups `json:"portGroups"`
708 DnsServerAddresses []string `json:"dnsServerAddresses"`
709 }
710
711 // Represents multiple subnets returned by the API.
712 type Subnets struct {
713 Items []Subnet `json:"items"`
714 }
715
716 // Creation spec for subnets.
717 type SubnetCreateSpec struct {
718 Name string `json:"name"`
719 Description string `json:"description"`
720 PrivateIpCidr string `json:"privateIpCidr"`
721 Type string `json:"type"`
722 PortGroups PortGroups `json:"portGroups"`
723 DnsServerAddresses []string `json:"dnsServerAddresses"`
724 }
725
726 // Represents name that can be set for subnet
727 type SubnetUpdateSpec struct {
728 SubnetName string `json:"name"`
729 }
730
731 // Identity and Access Management (IAM)
732 // IAM role binding
733 type RoleBinding struct {
734 Role string `json:"role"`
735 Subjects []string `json:"subjects"`
736 }
737
738 type RoleBindingDelta struct {
739 Action string `json:"action"`
740 Role string `json:"role"`
741 Subject string `json:"subject"`
742 }
743
744 type SystemInfo struct {
745 NTPEndpoint string `json:"ntpEndpoint,omitempty"`
746 UseImageDatastoreForVms bool `json:"useImageDatastoreForVms,omitempty"`
747 Auth *AuthInfo `json:"auth"`
748 NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration"`
749 Kind string `json:"kind"`
750 SyslogEndpoint string `json:"syslogEndpoint,omitempty"`
751 Stats *StatsInfo `json:"stats,omitempty"`
752 State string `json:"state"`
753 ImageDatastores []string `json:"imageDatastores"`
754 ServiceConfigurations []ServiceConfiguration `json:"serviceConfigurations,omitempty"`
755 LoadBalancerEnabled bool `json:"loadBalancerEnabled"`
756 LoadBalancerAddress string `json:"loadBalancerAddress"`
757 BaseVersion string `json:"baseVersion"`
758 FullVersion string `json:"fullVersion"`
759 GitCommitHash string `json:"gitCommitHash"`
760 NetworkType string `json:"networkType"`
761 }