| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 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 |
|
| 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 |
|
| 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:"-"` |
| 36 |
} |
| 37 |
|
| 38 |
|
| 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 |
|
| 49 |
type HttpError struct { |
| 50 |
StatusCode int |
| 51 |
Message string |
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
func (e HttpError) Error() string { |
| 56 |
return fmt.Sprintf("photon: HTTP %d: %v", e.StatusCode, e.Message) |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
type TaskError struct { |
| 63 |
ID string `json:"id"` |
| 64 |
Step Step `json:"step,omitempty"` |
| 65 |
} |
| 66 |
|
| 67 |
|
| 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 |
|
| 73 |
type TaskTimeoutError struct { |
| 74 |
ID string |
| 75 |
} |
| 76 |
|
| 77 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 123 |
type TaskList struct { |
| 124 |
Items []Task `json:"items"` |
| 125 |
} |
| 126 |
|
| 127 |
|
| 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 |
|
| 147 |
type QuotaStatusLineItem struct { |
| 148 |
Unit string `json:"unit"` |
| 149 |
Limit float64 `json:"limit"` |
| 150 |
Usage float64 `json:"usage"` |
| 151 |
} |
| 152 |
|
| 153 |
|
| 154 |
type LocalitySpec struct { |
| 155 |
Kind string `json:"kind"` |
| 156 |
ID string `json:"id"` |
| 157 |
} |
| 158 |
|
| 159 |
|
| 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 |
|
| 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 |
|
| 185 |
type DiskList struct { |
| 186 |
Items []PersistentDisk `json:"items"` |
| 187 |
} |
| 188 |
|
| 189 |
|
| 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 |
|
| 198 |
type ProjectList struct { |
| 199 |
Items []ProjectCompact `json:"items"` |
| 200 |
} |
| 201 |
|
| 202 |
|
| 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 |
|
| 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 |
|
| 230 |
type ImageScope struct { |
| 231 |
Kind string `json:"kind"` |
| 232 |
ID string `json:"id"` |
| 233 |
} |
| 234 |
|
| 235 |
|
| 236 |
type ImageSetting struct { |
| 237 |
Name string `json:"name"` |
| 238 |
DefaultValue string `json:"defaultValue"` |
| 239 |
} |
| 240 |
|
| 241 |
|
| 242 |
type ImageCreateOptions struct { |
| 243 |
ReplicationType string |
| 244 |
} |
| 245 |
|
| 246 |
|
| 247 |
type Images struct { |
| 248 |
Items []Image `json:"items"` |
| 249 |
} |
| 250 |
|
| 251 |
|
| 252 |
type Component struct { |
| 253 |
Component string |
| 254 |
Message string |
| 255 |
Status string |
| 256 |
} |
| 257 |
|
| 258 |
|
| 259 |
type Status struct { |
| 260 |
Status string |
| 261 |
Components []Component |
| 262 |
} |
| 263 |
|
| 264 |
|
| 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 |
|
| 277 |
type Tenants struct { |
| 278 |
Items []Tenant `json:"items"` |
| 279 |
} |
| 280 |
|
| 281 |
|
| 282 |
type TenantCreateSpec struct { |
| 283 |
Name string `json:"name"` |
| 284 |
SecurityGroups []string `json:"securityGroups,omitempty"` |
| 285 |
ResourceQuota Quota `json:"quota,omitempty"` |
| 286 |
} |
| 287 |
|
| 288 |
|
| 289 |
type Quota struct { |
| 290 |
QuotaLineItems map[string]QuotaStatusLineItem `json:"quotaItems"` |
| 291 |
} |
| 292 |
|
| 293 |
|
| 294 |
type QuotaSpec map[string]QuotaStatusLineItem |
| 295 |
|
| 296 |
|
| 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 |
|
| 309 |
|
| 310 |
type VmOperation struct { |
| 311 |
Operation string `json:"operation"` |
| 312 |
Arguments map[string]interface{} `json:"arguments,omitempty"` |
| 313 |
} |
| 314 |
|
| 315 |
|
| 316 |
type VmMetadata struct { |
| 317 |
Metadata map[string]string `json:"metadata"` |
| 318 |
} |
| 319 |
|
| 320 |
|
| 321 |
type VmTag struct { |
| 322 |
Tag string `json:"value"` |
| 323 |
} |
| 324 |
|
| 325 |
|
| 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 |
|
| 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 |
|
| 356 |
type VMs struct { |
| 357 |
Items []VM `json:"items"` |
| 358 |
} |
| 359 |
|
| 360 |
|
| 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 |
|
| 369 |
type VmDiskOperation struct { |
| 370 |
DiskID string `json:"diskId"` |
| 371 |
Arguments map[string]interface{} `json:"arguments,omitempty"` |
| 372 |
} |
| 373 |
|
| 374 |
|
| 375 |
type VmFloatingIpSpec struct { |
| 376 |
NetworkId string `json:"networkId"` |
| 377 |
} |
| 378 |
|
| 379 |
|
| 380 |
type FlavorCreateSpec struct { |
| 381 |
Cost []QuotaLineItem `json:"cost"` |
| 382 |
Kind string `json:"kind"` |
| 383 |
Name string `json:"name"` |
| 384 |
} |
| 385 |
|
| 386 |
|
| 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 |
|
| 398 |
type FlavorList struct { |
| 399 |
Items []Flavor `json:"items"` |
| 400 |
} |
| 401 |
|
| 402 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 471 |
type IpRange struct { |
| 472 |
Start string `json:"start,omitempty"` |
| 473 |
End string `json:"end,omitempty"` |
| 474 |
} |
| 475 |
|
| 476 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 525 |
type RouterUpdateSpec struct { |
| 526 |
RouterName string `json:"name"` |
| 527 |
} |
| 528 |
|
| 529 |
|
| 530 |
type ServiceConfigurationSpec struct { |
| 531 |
Type string `json:"type"` |
| 532 |
ImageID string `json:"imageId"` |
| 533 |
} |
| 534 |
|
| 535 |
|
| 536 |
type ServiceConfiguration struct { |
| 537 |
Kind string `json:"kind"` |
| 538 |
Type string `json:"type"` |
| 539 |
ImageID string `json:"imageId"` |
| 540 |
} |
| 541 |
|
| 542 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 584 |
type Services struct { |
| 585 |
Items []Service `json:"items"` |
| 586 |
} |
| 587 |
|
| 588 |
|
| 589 |
type ServiceResizeOperation struct { |
| 590 |
NewWorkerCount int `json:"newWorkerCount"` |
| 591 |
} |
| 592 |
|
| 593 |
|
| 594 |
type ServiceChangeVersionOperation struct { |
| 595 |
NewImageID string `json:"newImageId"` |
| 596 |
} |
| 597 |
|
| 598 |
|
| 599 |
type SecurityGroup struct { |
| 600 |
Name string `json:"name"` |
| 601 |
Inherited bool `json:"inherited"` |
| 602 |
} |
| 603 |
|
| 604 |
|
| 605 |
type SecurityGroupsSpec struct { |
| 606 |
Items []string `json:"items"` |
| 607 |
} |
| 608 |
|
| 609 |
|
| 610 |
type HostSetAvailabilityZoneOperation struct { |
| 611 |
AvailabilityZoneId string `json:"availabilityZoneId"` |
| 612 |
} |
| 613 |
|
| 614 |
|
| 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 |
|
| 624 |
type Zones struct { |
| 625 |
Items []Zone `json:"items"` |
| 626 |
} |
| 627 |
|
| 628 |
|
| 629 |
type ZoneCreateSpec struct { |
| 630 |
Name string `json:"name"` |
| 631 |
} |
| 632 |
|
| 633 |
|
| 634 |
type ImageDatastores struct { |
| 635 |
Items []string `json:"items"` |
| 636 |
} |
| 637 |
|
| 638 |
|
| 639 |
type ImageCreateSpec struct { |
| 640 |
Name string `json:"name"` |
| 641 |
ReplicationType string `json:"replicationType"` |
| 642 |
} |
| 643 |
|
| 644 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 688 |
type NetworkUpdateSpec struct { |
| 689 |
NetworkName string `json:"name"` |
| 690 |
} |
| 691 |
|
| 692 |
|
| 693 |
type PortGroups struct { |
| 694 |
Names []string `json:"names"` |
| 695 |
} |
| 696 |
|
| 697 |
|
| 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 |
|
| 712 |
type Subnets struct { |
| 713 |
Items []Subnet `json:"items"` |
| 714 |
} |
| 715 |
|
| 716 |
|
| 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 |
|
| 727 |
type SubnetUpdateSpec struct { |
| 728 |
SubnetName string `json:"name"` |
| 729 |
} |
| 730 |
|
| 731 |
|
| 732 |
|
| 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 |
} |