1package compute 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" 22 23// AccessURI a disk access SAS uri. 24type AccessURI struct { 25 autorest.Response `json:"-"` 26 // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. 27 AccessSAS *string `json:"accessSAS,omitempty"` 28} 29 30// MarshalJSON is the custom marshaler for AccessURI. 31func (au AccessURI) MarshalJSON() ([]byte, error) { 32 objectMap := make(map[string]interface{}) 33 return json.Marshal(objectMap) 34} 35 36// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale 37// set. 38type AdditionalCapabilities struct { 39 // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. 40 UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` 41} 42 43// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 44// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 45// and the pass in which the content is applied. 46type AdditionalUnattendContent struct { 47 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' 48 PassName PassNames `json:"passName,omitempty"` 49 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' 50 ComponentName ComponentNames `json:"componentName,omitempty"` 51 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' 52 SettingName SettingNames `json:"settingName,omitempty"` 53 // Content - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. 54 Content *string `json:"content,omitempty"` 55} 56 57// APIEntityReference the API entity reference. 58type APIEntityReference struct { 59 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 60 ID *string `json:"id,omitempty"` 61} 62 63// APIError api error. 64type APIError struct { 65 // Details - The Api error details 66 Details *[]APIErrorBase `json:"details,omitempty"` 67 // Innererror - The Api inner error 68 Innererror *InnerError `json:"innererror,omitempty"` 69 // Code - The error code. 70 Code *string `json:"code,omitempty"` 71 // Target - The target of the particular error. 72 Target *string `json:"target,omitempty"` 73 // Message - The error message. 74 Message *string `json:"message,omitempty"` 75} 76 77// APIErrorBase api error base. 78type APIErrorBase struct { 79 // Code - The error code. 80 Code *string `json:"code,omitempty"` 81 // Target - The target of the particular error. 82 Target *string `json:"target,omitempty"` 83 // Message - The error message. 84 Message *string `json:"message,omitempty"` 85} 86 87// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. 88type AutomaticOSUpgradePolicy struct { 89 // EnableAutomaticOSUpgrade - Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false. If this is set to true for Windows based scale sets, recommendation is to set [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) to false. 90 EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` 91 // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. 92 DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` 93} 94 95// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. 96type AutomaticOSUpgradeProperties struct { 97 // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. 98 AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` 99} 100 101// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual 102// machine scale set. 103type AutomaticRepairsPolicy struct { 104 // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. 105 Enabled *bool `json:"enabled,omitempty"` 106 // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). 107 GracePeriod *string `json:"gracePeriod,omitempty"` 108} 109 110// AvailabilitySet specifies information about the availability set that the virtual machine should be 111// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 112// maximize availability. For more information about availability sets, see [Manage the availability of 113// virtual 114// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 115// <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual 116// machines in 117// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) 118// <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot 119// be added to an availability set. 120type AvailabilitySet struct { 121 autorest.Response `json:"-"` 122 *AvailabilitySetProperties `json:"properties,omitempty"` 123 // Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. 124 Sku *Sku `json:"sku,omitempty"` 125 // ID - READ-ONLY; Resource Id 126 ID *string `json:"id,omitempty"` 127 // Name - READ-ONLY; Resource name 128 Name *string `json:"name,omitempty"` 129 // Type - READ-ONLY; Resource type 130 Type *string `json:"type,omitempty"` 131 // Location - Resource location 132 Location *string `json:"location,omitempty"` 133 // Tags - Resource tags 134 Tags map[string]*string `json:"tags"` 135} 136 137// MarshalJSON is the custom marshaler for AvailabilitySet. 138func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 139 objectMap := make(map[string]interface{}) 140 if as.AvailabilitySetProperties != nil { 141 objectMap["properties"] = as.AvailabilitySetProperties 142 } 143 if as.Sku != nil { 144 objectMap["sku"] = as.Sku 145 } 146 if as.Location != nil { 147 objectMap["location"] = as.Location 148 } 149 if as.Tags != nil { 150 objectMap["tags"] = as.Tags 151 } 152 return json.Marshal(objectMap) 153} 154 155// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 156func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 157 var m map[string]*json.RawMessage 158 err := json.Unmarshal(body, &m) 159 if err != nil { 160 return err 161 } 162 for k, v := range m { 163 switch k { 164 case "properties": 165 if v != nil { 166 var availabilitySetProperties AvailabilitySetProperties 167 err = json.Unmarshal(*v, &availabilitySetProperties) 168 if err != nil { 169 return err 170 } 171 as.AvailabilitySetProperties = &availabilitySetProperties 172 } 173 case "sku": 174 if v != nil { 175 var sku Sku 176 err = json.Unmarshal(*v, &sku) 177 if err != nil { 178 return err 179 } 180 as.Sku = &sku 181 } 182 case "id": 183 if v != nil { 184 var ID string 185 err = json.Unmarshal(*v, &ID) 186 if err != nil { 187 return err 188 } 189 as.ID = &ID 190 } 191 case "name": 192 if v != nil { 193 var name string 194 err = json.Unmarshal(*v, &name) 195 if err != nil { 196 return err 197 } 198 as.Name = &name 199 } 200 case "type": 201 if v != nil { 202 var typeVar string 203 err = json.Unmarshal(*v, &typeVar) 204 if err != nil { 205 return err 206 } 207 as.Type = &typeVar 208 } 209 case "location": 210 if v != nil { 211 var location string 212 err = json.Unmarshal(*v, &location) 213 if err != nil { 214 return err 215 } 216 as.Location = &location 217 } 218 case "tags": 219 if v != nil { 220 var tags map[string]*string 221 err = json.Unmarshal(*v, &tags) 222 if err != nil { 223 return err 224 } 225 as.Tags = tags 226 } 227 } 228 } 229 230 return nil 231} 232 233// AvailabilitySetListResult the List Availability Set operation response. 234type AvailabilitySetListResult struct { 235 autorest.Response `json:"-"` 236 // Value - The list of availability sets 237 Value *[]AvailabilitySet `json:"value,omitempty"` 238 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 239 NextLink *string `json:"nextLink,omitempty"` 240} 241 242// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 243type AvailabilitySetListResultIterator struct { 244 i int 245 page AvailabilitySetListResultPage 246} 247 248// NextWithContext advances to the next value. If there was an error making 249// the request the iterator does not advance and the error is returned. 250func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 251 if tracing.IsEnabled() { 252 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 253 defer func() { 254 sc := -1 255 if iter.Response().Response.Response != nil { 256 sc = iter.Response().Response.Response.StatusCode 257 } 258 tracing.EndSpan(ctx, sc, err) 259 }() 260 } 261 iter.i++ 262 if iter.i < len(iter.page.Values()) { 263 return nil 264 } 265 err = iter.page.NextWithContext(ctx) 266 if err != nil { 267 iter.i-- 268 return err 269 } 270 iter.i = 0 271 return nil 272} 273 274// Next advances to the next value. If there was an error making 275// the request the iterator does not advance and the error is returned. 276// Deprecated: Use NextWithContext() instead. 277func (iter *AvailabilitySetListResultIterator) Next() error { 278 return iter.NextWithContext(context.Background()) 279} 280 281// NotDone returns true if the enumeration should be started or is not yet complete. 282func (iter AvailabilitySetListResultIterator) NotDone() bool { 283 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 284} 285 286// Response returns the raw server response from the last page request. 287func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 288 return iter.page.Response() 289} 290 291// Value returns the current value or a zero-initialized value if the 292// iterator has advanced beyond the end of the collection. 293func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 294 if !iter.page.NotDone() { 295 return AvailabilitySet{} 296 } 297 return iter.page.Values()[iter.i] 298} 299 300// Creates a new instance of the AvailabilitySetListResultIterator type. 301func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 302 return AvailabilitySetListResultIterator{page: page} 303} 304 305// IsEmpty returns true if the ListResult contains no values. 306func (aslr AvailabilitySetListResult) IsEmpty() bool { 307 return aslr.Value == nil || len(*aslr.Value) == 0 308} 309 310// hasNextLink returns true if the NextLink is not empty. 311func (aslr AvailabilitySetListResult) hasNextLink() bool { 312 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 313} 314 315// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 316// It returns nil if no more results exist. 317func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 318 if !aslr.hasNextLink() { 319 return nil, nil 320 } 321 return autorest.Prepare((&http.Request{}).WithContext(ctx), 322 autorest.AsJSON(), 323 autorest.AsGet(), 324 autorest.WithBaseURL(to.String(aslr.NextLink))) 325} 326 327// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 328type AvailabilitySetListResultPage struct { 329 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 330 aslr AvailabilitySetListResult 331} 332 333// NextWithContext advances to the next page of values. If there was an error making 334// the request the page does not advance and the error is returned. 335func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 336 if tracing.IsEnabled() { 337 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 338 defer func() { 339 sc := -1 340 if page.Response().Response.Response != nil { 341 sc = page.Response().Response.Response.StatusCode 342 } 343 tracing.EndSpan(ctx, sc, err) 344 }() 345 } 346 for { 347 next, err := page.fn(ctx, page.aslr) 348 if err != nil { 349 return err 350 } 351 page.aslr = next 352 if !next.hasNextLink() || !next.IsEmpty() { 353 break 354 } 355 } 356 return nil 357} 358 359// Next advances to the next page of values. If there was an error making 360// the request the page does not advance and the error is returned. 361// Deprecated: Use NextWithContext() instead. 362func (page *AvailabilitySetListResultPage) Next() error { 363 return page.NextWithContext(context.Background()) 364} 365 366// NotDone returns true if the page enumeration should be started or is not yet complete. 367func (page AvailabilitySetListResultPage) NotDone() bool { 368 return !page.aslr.IsEmpty() 369} 370 371// Response returns the raw server response from the last page request. 372func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 373 return page.aslr 374} 375 376// Values returns the slice of values for the current page or nil if there are no values. 377func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 378 if page.aslr.IsEmpty() { 379 return nil 380 } 381 return *page.aslr.Value 382} 383 384// Creates a new instance of the AvailabilitySetListResultPage type. 385func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 386 return AvailabilitySetListResultPage{ 387 fn: getNextPage, 388 aslr: cur, 389 } 390} 391 392// AvailabilitySetProperties the instance view of a resource. 393type AvailabilitySetProperties struct { 394 // PlatformUpdateDomainCount - Update Domain count. 395 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 396 // PlatformFaultDomainCount - Fault Domain count. 397 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 398 // VirtualMachines - A list of references to all virtual machines in the availability set. 399 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 400 // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 401 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 402 // Statuses - READ-ONLY; The resource status information. 403 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 404} 405 406// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 407func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 408 objectMap := make(map[string]interface{}) 409 if asp.PlatformUpdateDomainCount != nil { 410 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 411 } 412 if asp.PlatformFaultDomainCount != nil { 413 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 414 } 415 if asp.VirtualMachines != nil { 416 objectMap["virtualMachines"] = asp.VirtualMachines 417 } 418 if asp.ProximityPlacementGroup != nil { 419 objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup 420 } 421 return json.Marshal(objectMap) 422} 423 424// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should 425// be assigned to. Only tags may be updated. 426type AvailabilitySetUpdate struct { 427 *AvailabilitySetProperties `json:"properties,omitempty"` 428 // Sku - Sku of the availability set 429 Sku *Sku `json:"sku,omitempty"` 430 // Tags - Resource tags 431 Tags map[string]*string `json:"tags"` 432} 433 434// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. 435func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { 436 objectMap := make(map[string]interface{}) 437 if asu.AvailabilitySetProperties != nil { 438 objectMap["properties"] = asu.AvailabilitySetProperties 439 } 440 if asu.Sku != nil { 441 objectMap["sku"] = asu.Sku 442 } 443 if asu.Tags != nil { 444 objectMap["tags"] = asu.Tags 445 } 446 return json.Marshal(objectMap) 447} 448 449// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. 450func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { 451 var m map[string]*json.RawMessage 452 err := json.Unmarshal(body, &m) 453 if err != nil { 454 return err 455 } 456 for k, v := range m { 457 switch k { 458 case "properties": 459 if v != nil { 460 var availabilitySetProperties AvailabilitySetProperties 461 err = json.Unmarshal(*v, &availabilitySetProperties) 462 if err != nil { 463 return err 464 } 465 asu.AvailabilitySetProperties = &availabilitySetProperties 466 } 467 case "sku": 468 if v != nil { 469 var sku Sku 470 err = json.Unmarshal(*v, &sku) 471 if err != nil { 472 return err 473 } 474 asu.Sku = &sku 475 } 476 case "tags": 477 if v != nil { 478 var tags map[string]*string 479 err = json.Unmarshal(*v, &tags) 480 if err != nil { 481 return err 482 } 483 asu.Tags = tags 484 } 485 } 486 } 487 488 return nil 489} 490 491// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 492// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 493// Azure also enables you to see a screenshot of the VM from the hypervisor. 494type BootDiagnostics struct { 495 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 496 Enabled *bool `json:"enabled,omitempty"` 497 // StorageURI - Uri of the storage account to use for placing the console output and screenshot. 498 StorageURI *string `json:"storageUri,omitempty"` 499} 500 501// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 502type BootDiagnosticsInstanceView struct { 503 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. 504 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 505 // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri. 506 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 507 // Status - READ-ONLY; The boot diagnostics status information for the VM. <br><br> NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. 508 Status *InstanceViewStatus `json:"status,omitempty"` 509} 510 511// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. 512func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { 513 objectMap := make(map[string]interface{}) 514 return json.Marshal(objectMap) 515} 516 517// CloudError an error response from the Gallery service. 518type CloudError struct { 519 Error *APIError `json:"error,omitempty"` 520} 521 522// ContainerService container service. 523type ContainerService struct { 524 autorest.Response `json:"-"` 525 *ContainerServiceProperties `json:"properties,omitempty"` 526 // ID - READ-ONLY; Resource Id 527 ID *string `json:"id,omitempty"` 528 // Name - READ-ONLY; Resource name 529 Name *string `json:"name,omitempty"` 530 // Type - READ-ONLY; Resource type 531 Type *string `json:"type,omitempty"` 532 // Location - Resource location 533 Location *string `json:"location,omitempty"` 534 // Tags - Resource tags 535 Tags map[string]*string `json:"tags"` 536} 537 538// MarshalJSON is the custom marshaler for ContainerService. 539func (cs ContainerService) MarshalJSON() ([]byte, error) { 540 objectMap := make(map[string]interface{}) 541 if cs.ContainerServiceProperties != nil { 542 objectMap["properties"] = cs.ContainerServiceProperties 543 } 544 if cs.Location != nil { 545 objectMap["location"] = cs.Location 546 } 547 if cs.Tags != nil { 548 objectMap["tags"] = cs.Tags 549 } 550 return json.Marshal(objectMap) 551} 552 553// UnmarshalJSON is the custom unmarshaler for ContainerService struct. 554func (cs *ContainerService) UnmarshalJSON(body []byte) error { 555 var m map[string]*json.RawMessage 556 err := json.Unmarshal(body, &m) 557 if err != nil { 558 return err 559 } 560 for k, v := range m { 561 switch k { 562 case "properties": 563 if v != nil { 564 var containerServiceProperties ContainerServiceProperties 565 err = json.Unmarshal(*v, &containerServiceProperties) 566 if err != nil { 567 return err 568 } 569 cs.ContainerServiceProperties = &containerServiceProperties 570 } 571 case "id": 572 if v != nil { 573 var ID string 574 err = json.Unmarshal(*v, &ID) 575 if err != nil { 576 return err 577 } 578 cs.ID = &ID 579 } 580 case "name": 581 if v != nil { 582 var name string 583 err = json.Unmarshal(*v, &name) 584 if err != nil { 585 return err 586 } 587 cs.Name = &name 588 } 589 case "type": 590 if v != nil { 591 var typeVar string 592 err = json.Unmarshal(*v, &typeVar) 593 if err != nil { 594 return err 595 } 596 cs.Type = &typeVar 597 } 598 case "location": 599 if v != nil { 600 var location string 601 err = json.Unmarshal(*v, &location) 602 if err != nil { 603 return err 604 } 605 cs.Location = &location 606 } 607 case "tags": 608 if v != nil { 609 var tags map[string]*string 610 err = json.Unmarshal(*v, &tags) 611 if err != nil { 612 return err 613 } 614 cs.Tags = tags 615 } 616 } 617 } 618 619 return nil 620} 621 622// ContainerServiceAgentPoolProfile profile for the container service agent pool. 623type ContainerServiceAgentPoolProfile struct { 624 // Name - Unique name of the agent pool profile in the context of the subscription and resource group. 625 Name *string `json:"name,omitempty"` 626 // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. 627 Count *int32 `json:"count,omitempty"` 628 // VMSize - Size of agent VMs. Possible values include: 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5' 629 VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` 630 // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. 631 DNSPrefix *string `json:"dnsPrefix,omitempty"` 632 // Fqdn - READ-ONLY; FQDN for the agent pool. 633 Fqdn *string `json:"fqdn,omitempty"` 634} 635 636// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. 637func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { 638 objectMap := make(map[string]interface{}) 639 if csapp.Name != nil { 640 objectMap["name"] = csapp.Name 641 } 642 if csapp.Count != nil { 643 objectMap["count"] = csapp.Count 644 } 645 if csapp.VMSize != "" { 646 objectMap["vmSize"] = csapp.VMSize 647 } 648 if csapp.DNSPrefix != nil { 649 objectMap["dnsPrefix"] = csapp.DNSPrefix 650 } 651 return json.Marshal(objectMap) 652} 653 654// ContainerServiceCustomProfile properties to configure a custom container service cluster. 655type ContainerServiceCustomProfile struct { 656 // Orchestrator - The name of the custom orchestrator to use. 657 Orchestrator *string `json:"orchestrator,omitempty"` 658} 659 660// ContainerServiceDiagnosticsProfile ... 661type ContainerServiceDiagnosticsProfile struct { 662 // VMDiagnostics - Profile for the container service VM diagnostic agent. 663 VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` 664} 665 666// ContainerServiceLinuxProfile profile for Linux VMs in the container service cluster. 667type ContainerServiceLinuxProfile struct { 668 // AdminUsername - The administrator username to use for Linux VMs. 669 AdminUsername *string `json:"adminUsername,omitempty"` 670 // SSH - The ssh key configuration for Linux VMs. 671 SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` 672} 673 674// ContainerServiceListResult the response from the List Container Services operation. 675type ContainerServiceListResult struct { 676 autorest.Response `json:"-"` 677 // Value - the list of container services. 678 Value *[]ContainerService `json:"value,omitempty"` 679 // NextLink - The URL to get the next set of container service results. 680 NextLink *string `json:"nextLink,omitempty"` 681} 682 683// ContainerServiceListResultIterator provides access to a complete listing of ContainerService values. 684type ContainerServiceListResultIterator struct { 685 i int 686 page ContainerServiceListResultPage 687} 688 689// NextWithContext advances to the next value. If there was an error making 690// the request the iterator does not advance and the error is returned. 691func (iter *ContainerServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 692 if tracing.IsEnabled() { 693 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultIterator.NextWithContext") 694 defer func() { 695 sc := -1 696 if iter.Response().Response.Response != nil { 697 sc = iter.Response().Response.Response.StatusCode 698 } 699 tracing.EndSpan(ctx, sc, err) 700 }() 701 } 702 iter.i++ 703 if iter.i < len(iter.page.Values()) { 704 return nil 705 } 706 err = iter.page.NextWithContext(ctx) 707 if err != nil { 708 iter.i-- 709 return err 710 } 711 iter.i = 0 712 return nil 713} 714 715// Next advances to the next value. If there was an error making 716// the request the iterator does not advance and the error is returned. 717// Deprecated: Use NextWithContext() instead. 718func (iter *ContainerServiceListResultIterator) Next() error { 719 return iter.NextWithContext(context.Background()) 720} 721 722// NotDone returns true if the enumeration should be started or is not yet complete. 723func (iter ContainerServiceListResultIterator) NotDone() bool { 724 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 725} 726 727// Response returns the raw server response from the last page request. 728func (iter ContainerServiceListResultIterator) Response() ContainerServiceListResult { 729 return iter.page.Response() 730} 731 732// Value returns the current value or a zero-initialized value if the 733// iterator has advanced beyond the end of the collection. 734func (iter ContainerServiceListResultIterator) Value() ContainerService { 735 if !iter.page.NotDone() { 736 return ContainerService{} 737 } 738 return iter.page.Values()[iter.i] 739} 740 741// Creates a new instance of the ContainerServiceListResultIterator type. 742func NewContainerServiceListResultIterator(page ContainerServiceListResultPage) ContainerServiceListResultIterator { 743 return ContainerServiceListResultIterator{page: page} 744} 745 746// IsEmpty returns true if the ListResult contains no values. 747func (cslr ContainerServiceListResult) IsEmpty() bool { 748 return cslr.Value == nil || len(*cslr.Value) == 0 749} 750 751// hasNextLink returns true if the NextLink is not empty. 752func (cslr ContainerServiceListResult) hasNextLink() bool { 753 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 754} 755 756// containerServiceListResultPreparer prepares a request to retrieve the next set of results. 757// It returns nil if no more results exist. 758func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 759 if !cslr.hasNextLink() { 760 return nil, nil 761 } 762 return autorest.Prepare((&http.Request{}).WithContext(ctx), 763 autorest.AsJSON(), 764 autorest.AsGet(), 765 autorest.WithBaseURL(to.String(cslr.NextLink))) 766} 767 768// ContainerServiceListResultPage contains a page of ContainerService values. 769type ContainerServiceListResultPage struct { 770 fn func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error) 771 cslr ContainerServiceListResult 772} 773 774// NextWithContext advances to the next page of values. If there was an error making 775// the request the page does not advance and the error is returned. 776func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 777 if tracing.IsEnabled() { 778 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultPage.NextWithContext") 779 defer func() { 780 sc := -1 781 if page.Response().Response.Response != nil { 782 sc = page.Response().Response.Response.StatusCode 783 } 784 tracing.EndSpan(ctx, sc, err) 785 }() 786 } 787 for { 788 next, err := page.fn(ctx, page.cslr) 789 if err != nil { 790 return err 791 } 792 page.cslr = next 793 if !next.hasNextLink() || !next.IsEmpty() { 794 break 795 } 796 } 797 return nil 798} 799 800// Next advances to the next page of values. If there was an error making 801// the request the page does not advance and the error is returned. 802// Deprecated: Use NextWithContext() instead. 803func (page *ContainerServiceListResultPage) Next() error { 804 return page.NextWithContext(context.Background()) 805} 806 807// NotDone returns true if the page enumeration should be started or is not yet complete. 808func (page ContainerServiceListResultPage) NotDone() bool { 809 return !page.cslr.IsEmpty() 810} 811 812// Response returns the raw server response from the last page request. 813func (page ContainerServiceListResultPage) Response() ContainerServiceListResult { 814 return page.cslr 815} 816 817// Values returns the slice of values for the current page or nil if there are no values. 818func (page ContainerServiceListResultPage) Values() []ContainerService { 819 if page.cslr.IsEmpty() { 820 return nil 821 } 822 return *page.cslr.Value 823} 824 825// Creates a new instance of the ContainerServiceListResultPage type. 826func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { 827 return ContainerServiceListResultPage{ 828 fn: getNextPage, 829 cslr: cur, 830 } 831} 832 833// ContainerServiceMasterProfile profile for the container service master. 834type ContainerServiceMasterProfile struct { 835 // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 836 Count *int32 `json:"count,omitempty"` 837 // DNSPrefix - DNS prefix to be used to create the FQDN for master. 838 DNSPrefix *string `json:"dnsPrefix,omitempty"` 839 // Fqdn - READ-ONLY; FQDN for the master. 840 Fqdn *string `json:"fqdn,omitempty"` 841} 842 843// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. 844func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { 845 objectMap := make(map[string]interface{}) 846 if csmp.Count != nil { 847 objectMap["count"] = csmp.Count 848 } 849 if csmp.DNSPrefix != nil { 850 objectMap["dnsPrefix"] = csmp.DNSPrefix 851 } 852 return json.Marshal(objectMap) 853} 854 855// ContainerServiceOrchestratorProfile profile for the container service orchestrator. 856type ContainerServiceOrchestratorProfile struct { 857 // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' 858 OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` 859} 860 861// ContainerServiceProperties properties of the container service. 862type ContainerServiceProperties struct { 863 // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. 864 ProvisioningState *string `json:"provisioningState,omitempty"` 865 // OrchestratorProfile - Properties of the orchestrator. 866 OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` 867 // CustomProfile - Properties for custom clusters. 868 CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` 869 // ServicePrincipalProfile - Properties for cluster service principals. 870 ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 871 // MasterProfile - Properties of master agents. 872 MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` 873 // AgentPoolProfiles - Properties of the agent pool. 874 AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` 875 // WindowsProfile - Properties of Windows VMs. 876 WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` 877 // LinuxProfile - Properties of Linux VMs. 878 LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` 879 // DiagnosticsProfile - Properties of the diagnostic agent. 880 DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 881} 882 883// MarshalJSON is the custom marshaler for ContainerServiceProperties. 884func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { 885 objectMap := make(map[string]interface{}) 886 if csp.OrchestratorProfile != nil { 887 objectMap["orchestratorProfile"] = csp.OrchestratorProfile 888 } 889 if csp.CustomProfile != nil { 890 objectMap["customProfile"] = csp.CustomProfile 891 } 892 if csp.ServicePrincipalProfile != nil { 893 objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile 894 } 895 if csp.MasterProfile != nil { 896 objectMap["masterProfile"] = csp.MasterProfile 897 } 898 if csp.AgentPoolProfiles != nil { 899 objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles 900 } 901 if csp.WindowsProfile != nil { 902 objectMap["windowsProfile"] = csp.WindowsProfile 903 } 904 if csp.LinuxProfile != nil { 905 objectMap["linuxProfile"] = csp.LinuxProfile 906 } 907 if csp.DiagnosticsProfile != nil { 908 objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile 909 } 910 return json.Marshal(objectMap) 911} 912 913// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 914// long-running operation. 915type ContainerServicesCreateOrUpdateFuture struct { 916 azure.FutureAPI 917 // Result returns the result of the asynchronous operation. 918 // If the operation has not completed it will return an error. 919 Result func(ContainerServicesClient) (ContainerService, error) 920} 921 922// UnmarshalJSON is the custom unmarshaller for CreateFuture. 923func (future *ContainerServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 924 var azFuture azure.Future 925 if err := json.Unmarshal(body, &azFuture); err != nil { 926 return err 927 } 928 future.FutureAPI = &azFuture 929 future.Result = future.result 930 return nil 931} 932 933// result is the default implementation for ContainerServicesCreateOrUpdateFuture.Result. 934func (future *ContainerServicesCreateOrUpdateFuture) result(client ContainerServicesClient) (cs ContainerService, err error) { 935 var done bool 936 done, err = future.DoneWithContext(context.Background(), client) 937 if err != nil { 938 err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 939 return 940 } 941 if !done { 942 cs.Response.Response = future.Response() 943 err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesCreateOrUpdateFuture") 944 return 945 } 946 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 947 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 948 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 949 if err != nil { 950 err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 951 } 952 } 953 return 954} 955 956// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 957// operation. 958type ContainerServicesDeleteFuture struct { 959 azure.FutureAPI 960 // Result returns the result of the asynchronous operation. 961 // If the operation has not completed it will return an error. 962 Result func(ContainerServicesClient) (autorest.Response, error) 963} 964 965// UnmarshalJSON is the custom unmarshaller for CreateFuture. 966func (future *ContainerServicesDeleteFuture) UnmarshalJSON(body []byte) error { 967 var azFuture azure.Future 968 if err := json.Unmarshal(body, &azFuture); err != nil { 969 return err 970 } 971 future.FutureAPI = &azFuture 972 future.Result = future.result 973 return nil 974} 975 976// result is the default implementation for ContainerServicesDeleteFuture.Result. 977func (future *ContainerServicesDeleteFuture) result(client ContainerServicesClient) (ar autorest.Response, err error) { 978 var done bool 979 done, err = future.DoneWithContext(context.Background(), client) 980 if err != nil { 981 err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", future.Response(), "Polling failure") 982 return 983 } 984 if !done { 985 ar.Response = future.Response() 986 err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesDeleteFuture") 987 return 988 } 989 ar.Response = future.Response() 990 return 991} 992 993// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster 994// to use for manipulating Azure APIs. 995type ContainerServiceServicePrincipalProfile struct { 996 // ClientID - The ID for the service principal. 997 ClientID *string `json:"clientId,omitempty"` 998 // Secret - The secret password associated with the service principal. 999 Secret *string `json:"secret,omitempty"` 1000} 1001 1002// ContainerServiceSSHConfiguration SSH configuration for Linux-based VMs running on Azure. 1003type ContainerServiceSSHConfiguration struct { 1004 // PublicKeys - the list of SSH public keys used to authenticate with Linux-based VMs. 1005 PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` 1006} 1007 1008// ContainerServiceSSHPublicKey contains information about SSH certificate public key data. 1009type ContainerServiceSSHPublicKey struct { 1010 // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. 1011 KeyData *string `json:"keyData,omitempty"` 1012} 1013 1014// ContainerServiceVMDiagnostics profile for diagnostics on the container service VMs. 1015type ContainerServiceVMDiagnostics struct { 1016 // Enabled - Whether the VM diagnostic agent is provisioned on the VM. 1017 Enabled *bool `json:"enabled,omitempty"` 1018 // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. 1019 StorageURI *string `json:"storageUri,omitempty"` 1020} 1021 1022// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. 1023func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { 1024 objectMap := make(map[string]interface{}) 1025 if csvd.Enabled != nil { 1026 objectMap["enabled"] = csvd.Enabled 1027 } 1028 return json.Marshal(objectMap) 1029} 1030 1031// ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. 1032type ContainerServiceWindowsProfile struct { 1033 // AdminUsername - The administrator username to use for Windows VMs. 1034 AdminUsername *string `json:"adminUsername,omitempty"` 1035 // AdminPassword - The administrator password to use for Windows VMs. 1036 AdminPassword *string `json:"adminPassword,omitempty"` 1037} 1038 1039// CreationData data used when creating a disk. 1040type CreationData struct { 1041 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' 1042 CreateOption DiskCreateOption `json:"createOption,omitempty"` 1043 // StorageAccountID - If createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription 1044 StorageAccountID *string `json:"storageAccountId,omitempty"` 1045 // ImageReference - Disk source information. 1046 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 1047 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 1048 SourceURI *string `json:"sourceUri,omitempty"` 1049 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 1050 SourceResourceID *string `json:"sourceResourceId,omitempty"` 1051} 1052 1053// DataDisk describes a data disk. 1054type DataDisk struct { 1055 // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. 1056 Lun *int32 `json:"lun,omitempty"` 1057 // Name - The disk name. 1058 Name *string `json:"name,omitempty"` 1059 // Vhd - The virtual hard disk. 1060 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1061 // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. 1062 Image *VirtualHardDisk `json:"image,omitempty"` 1063 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 1064 Caching CachingTypes `json:"caching,omitempty"` 1065 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1066 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1067 // CreateOption - Specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 1068 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1069 // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 1070 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1071 // ManagedDisk - The managed disk parameters. 1072 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1073} 1074 1075// DataDiskImage contains the data disk images information. 1076type DataDiskImage struct { 1077 // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. 1078 Lun *int32 `json:"lun,omitempty"` 1079} 1080 1081// MarshalJSON is the custom marshaler for DataDiskImage. 1082func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { 1083 objectMap := make(map[string]interface{}) 1084 return json.Marshal(objectMap) 1085} 1086 1087// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 1088// 2015-06-15. 1089type DiagnosticsProfile struct { 1090 // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. 1091 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 1092} 1093 1094// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 1095// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 1096type DiffDiskSettings struct { 1097 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 1098 Option DiffDiskOptions `json:"option,omitempty"` 1099} 1100 1101// Disallowed describes the disallowed disk types. 1102type Disallowed struct { 1103 // DiskTypes - A list of disk types. 1104 DiskTypes *[]string `json:"diskTypes,omitempty"` 1105} 1106 1107// Disk disk resource. 1108type Disk struct { 1109 autorest.Response `json:"-"` 1110 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 1111 ManagedBy *string `json:"managedBy,omitempty"` 1112 Sku *DiskSku `json:"sku,omitempty"` 1113 // Zones - The Logical zone list for Disk. 1114 Zones *[]string `json:"zones,omitempty"` 1115 *DiskProperties `json:"properties,omitempty"` 1116 // ID - READ-ONLY; Resource Id 1117 ID *string `json:"id,omitempty"` 1118 // Name - READ-ONLY; Resource name 1119 Name *string `json:"name,omitempty"` 1120 // Type - READ-ONLY; Resource type 1121 Type *string `json:"type,omitempty"` 1122 // Location - Resource location 1123 Location *string `json:"location,omitempty"` 1124 // Tags - Resource tags 1125 Tags map[string]*string `json:"tags"` 1126} 1127 1128// MarshalJSON is the custom marshaler for Disk. 1129func (d Disk) MarshalJSON() ([]byte, error) { 1130 objectMap := make(map[string]interface{}) 1131 if d.Sku != nil { 1132 objectMap["sku"] = d.Sku 1133 } 1134 if d.Zones != nil { 1135 objectMap["zones"] = d.Zones 1136 } 1137 if d.DiskProperties != nil { 1138 objectMap["properties"] = d.DiskProperties 1139 } 1140 if d.Location != nil { 1141 objectMap["location"] = d.Location 1142 } 1143 if d.Tags != nil { 1144 objectMap["tags"] = d.Tags 1145 } 1146 return json.Marshal(objectMap) 1147} 1148 1149// UnmarshalJSON is the custom unmarshaler for Disk struct. 1150func (d *Disk) UnmarshalJSON(body []byte) error { 1151 var m map[string]*json.RawMessage 1152 err := json.Unmarshal(body, &m) 1153 if err != nil { 1154 return err 1155 } 1156 for k, v := range m { 1157 switch k { 1158 case "managedBy": 1159 if v != nil { 1160 var managedBy string 1161 err = json.Unmarshal(*v, &managedBy) 1162 if err != nil { 1163 return err 1164 } 1165 d.ManagedBy = &managedBy 1166 } 1167 case "sku": 1168 if v != nil { 1169 var sku DiskSku 1170 err = json.Unmarshal(*v, &sku) 1171 if err != nil { 1172 return err 1173 } 1174 d.Sku = &sku 1175 } 1176 case "zones": 1177 if v != nil { 1178 var zones []string 1179 err = json.Unmarshal(*v, &zones) 1180 if err != nil { 1181 return err 1182 } 1183 d.Zones = &zones 1184 } 1185 case "properties": 1186 if v != nil { 1187 var diskProperties DiskProperties 1188 err = json.Unmarshal(*v, &diskProperties) 1189 if err != nil { 1190 return err 1191 } 1192 d.DiskProperties = &diskProperties 1193 } 1194 case "id": 1195 if v != nil { 1196 var ID string 1197 err = json.Unmarshal(*v, &ID) 1198 if err != nil { 1199 return err 1200 } 1201 d.ID = &ID 1202 } 1203 case "name": 1204 if v != nil { 1205 var name string 1206 err = json.Unmarshal(*v, &name) 1207 if err != nil { 1208 return err 1209 } 1210 d.Name = &name 1211 } 1212 case "type": 1213 if v != nil { 1214 var typeVar string 1215 err = json.Unmarshal(*v, &typeVar) 1216 if err != nil { 1217 return err 1218 } 1219 d.Type = &typeVar 1220 } 1221 case "location": 1222 if v != nil { 1223 var location string 1224 err = json.Unmarshal(*v, &location) 1225 if err != nil { 1226 return err 1227 } 1228 d.Location = &location 1229 } 1230 case "tags": 1231 if v != nil { 1232 var tags map[string]*string 1233 err = json.Unmarshal(*v, &tags) 1234 if err != nil { 1235 return err 1236 } 1237 d.Tags = tags 1238 } 1239 } 1240 } 1241 1242 return nil 1243} 1244 1245// DiskEncryptionSettings describes a Encryption Settings for a Disk 1246type DiskEncryptionSettings struct { 1247 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 1248 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 1249 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 1250 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 1251 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 1252 Enabled *bool `json:"enabled,omitempty"` 1253} 1254 1255// DiskInstanceView the instance view of the disk. 1256type DiskInstanceView struct { 1257 // Name - The disk name. 1258 Name *string `json:"name,omitempty"` 1259 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 1260 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 1261 // Statuses - The resource status information. 1262 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1263} 1264 1265// DiskList the List Disks operation response. 1266type DiskList struct { 1267 autorest.Response `json:"-"` 1268 // Value - A list of disks. 1269 Value *[]Disk `json:"value,omitempty"` 1270 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 1271 NextLink *string `json:"nextLink,omitempty"` 1272} 1273 1274// DiskListIterator provides access to a complete listing of Disk values. 1275type DiskListIterator struct { 1276 i int 1277 page DiskListPage 1278} 1279 1280// NextWithContext advances to the next value. If there was an error making 1281// the request the iterator does not advance and the error is returned. 1282func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 1283 if tracing.IsEnabled() { 1284 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 1285 defer func() { 1286 sc := -1 1287 if iter.Response().Response.Response != nil { 1288 sc = iter.Response().Response.Response.StatusCode 1289 } 1290 tracing.EndSpan(ctx, sc, err) 1291 }() 1292 } 1293 iter.i++ 1294 if iter.i < len(iter.page.Values()) { 1295 return nil 1296 } 1297 err = iter.page.NextWithContext(ctx) 1298 if err != nil { 1299 iter.i-- 1300 return err 1301 } 1302 iter.i = 0 1303 return nil 1304} 1305 1306// Next advances to the next value. If there was an error making 1307// the request the iterator does not advance and the error is returned. 1308// Deprecated: Use NextWithContext() instead. 1309func (iter *DiskListIterator) Next() error { 1310 return iter.NextWithContext(context.Background()) 1311} 1312 1313// NotDone returns true if the enumeration should be started or is not yet complete. 1314func (iter DiskListIterator) NotDone() bool { 1315 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1316} 1317 1318// Response returns the raw server response from the last page request. 1319func (iter DiskListIterator) Response() DiskList { 1320 return iter.page.Response() 1321} 1322 1323// Value returns the current value or a zero-initialized value if the 1324// iterator has advanced beyond the end of the collection. 1325func (iter DiskListIterator) Value() Disk { 1326 if !iter.page.NotDone() { 1327 return Disk{} 1328 } 1329 return iter.page.Values()[iter.i] 1330} 1331 1332// Creates a new instance of the DiskListIterator type. 1333func NewDiskListIterator(page DiskListPage) DiskListIterator { 1334 return DiskListIterator{page: page} 1335} 1336 1337// IsEmpty returns true if the ListResult contains no values. 1338func (dl DiskList) IsEmpty() bool { 1339 return dl.Value == nil || len(*dl.Value) == 0 1340} 1341 1342// hasNextLink returns true if the NextLink is not empty. 1343func (dl DiskList) hasNextLink() bool { 1344 return dl.NextLink != nil && len(*dl.NextLink) != 0 1345} 1346 1347// diskListPreparer prepares a request to retrieve the next set of results. 1348// It returns nil if no more results exist. 1349func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 1350 if !dl.hasNextLink() { 1351 return nil, nil 1352 } 1353 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1354 autorest.AsJSON(), 1355 autorest.AsGet(), 1356 autorest.WithBaseURL(to.String(dl.NextLink))) 1357} 1358 1359// DiskListPage contains a page of Disk values. 1360type DiskListPage struct { 1361 fn func(context.Context, DiskList) (DiskList, error) 1362 dl DiskList 1363} 1364 1365// NextWithContext advances to the next page of values. If there was an error making 1366// the request the page does not advance and the error is returned. 1367func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 1368 if tracing.IsEnabled() { 1369 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 1370 defer func() { 1371 sc := -1 1372 if page.Response().Response.Response != nil { 1373 sc = page.Response().Response.Response.StatusCode 1374 } 1375 tracing.EndSpan(ctx, sc, err) 1376 }() 1377 } 1378 for { 1379 next, err := page.fn(ctx, page.dl) 1380 if err != nil { 1381 return err 1382 } 1383 page.dl = next 1384 if !next.hasNextLink() || !next.IsEmpty() { 1385 break 1386 } 1387 } 1388 return nil 1389} 1390 1391// Next advances to the next page of values. If there was an error making 1392// the request the page does not advance and the error is returned. 1393// Deprecated: Use NextWithContext() instead. 1394func (page *DiskListPage) Next() error { 1395 return page.NextWithContext(context.Background()) 1396} 1397 1398// NotDone returns true if the page enumeration should be started or is not yet complete. 1399func (page DiskListPage) NotDone() bool { 1400 return !page.dl.IsEmpty() 1401} 1402 1403// Response returns the raw server response from the last page request. 1404func (page DiskListPage) Response() DiskList { 1405 return page.dl 1406} 1407 1408// Values returns the slice of values for the current page or nil if there are no values. 1409func (page DiskListPage) Values() []Disk { 1410 if page.dl.IsEmpty() { 1411 return nil 1412 } 1413 return *page.dl.Value 1414} 1415 1416// Creates a new instance of the DiskListPage type. 1417func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 1418 return DiskListPage{ 1419 fn: getNextPage, 1420 dl: cur, 1421 } 1422} 1423 1424// DiskProperties disk resource properties. 1425type DiskProperties struct { 1426 // TimeCreated - READ-ONLY; The time when the disk was created. 1427 TimeCreated *date.Time `json:"timeCreated,omitempty"` 1428 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 1429 OsType OperatingSystemTypes `json:"osType,omitempty"` 1430 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 1431 CreationData *CreationData `json:"creationData,omitempty"` 1432 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 1433 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1434 // EncryptionSettings - Encryption settings for disk or snapshot 1435 EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` 1436 // ProvisioningState - READ-ONLY; The disk provisioning state. 1437 ProvisioningState *string `json:"provisioningState,omitempty"` 1438 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. For a description of the range of values you can set, see [Ultra SSD Managed Disk Offerings](https://docs.microsoft.com/azure/virtual-machines/windows/disks-ultra-ssd#ultra-ssd-managed-disk-offerings). 1439 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1440 // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. For a description of the range of values you can set, see [Ultra SSD Managed Disk Offerings](https://docs.microsoft.com/azure/virtual-machines/windows/disks-ultra-ssd#ultra-ssd-managed-disk-offerings). 1441 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 1442} 1443 1444// MarshalJSON is the custom marshaler for DiskProperties. 1445func (dp DiskProperties) MarshalJSON() ([]byte, error) { 1446 objectMap := make(map[string]interface{}) 1447 if dp.OsType != "" { 1448 objectMap["osType"] = dp.OsType 1449 } 1450 if dp.CreationData != nil { 1451 objectMap["creationData"] = dp.CreationData 1452 } 1453 if dp.DiskSizeGB != nil { 1454 objectMap["diskSizeGB"] = dp.DiskSizeGB 1455 } 1456 if dp.EncryptionSettings != nil { 1457 objectMap["encryptionSettings"] = dp.EncryptionSettings 1458 } 1459 if dp.DiskIOPSReadWrite != nil { 1460 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 1461 } 1462 if dp.DiskMBpsReadWrite != nil { 1463 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 1464 } 1465 return json.Marshal(objectMap) 1466} 1467 1468// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1469// operation. 1470type DisksCreateOrUpdateFuture struct { 1471 azure.FutureAPI 1472 // Result returns the result of the asynchronous operation. 1473 // If the operation has not completed it will return an error. 1474 Result func(DisksClient) (Disk, error) 1475} 1476 1477// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1478func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1479 var azFuture azure.Future 1480 if err := json.Unmarshal(body, &azFuture); err != nil { 1481 return err 1482 } 1483 future.FutureAPI = &azFuture 1484 future.Result = future.result 1485 return nil 1486} 1487 1488// result is the default implementation for DisksCreateOrUpdateFuture.Result. 1489func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 1490 var done bool 1491 done, err = future.DoneWithContext(context.Background(), client) 1492 if err != nil { 1493 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1494 return 1495 } 1496 if !done { 1497 d.Response.Response = future.Response() 1498 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 1499 return 1500 } 1501 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1502 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 1503 d, err = client.CreateOrUpdateResponder(d.Response.Response) 1504 if err != nil { 1505 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 1506 } 1507 } 1508 return 1509} 1510 1511// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1512type DisksDeleteFuture struct { 1513 azure.FutureAPI 1514 // Result returns the result of the asynchronous operation. 1515 // If the operation has not completed it will return an error. 1516 Result func(DisksClient) (autorest.Response, error) 1517} 1518 1519// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1520func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 1521 var azFuture azure.Future 1522 if err := json.Unmarshal(body, &azFuture); err != nil { 1523 return err 1524 } 1525 future.FutureAPI = &azFuture 1526 future.Result = future.result 1527 return nil 1528} 1529 1530// result is the default implementation for DisksDeleteFuture.Result. 1531func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 1532 var done bool 1533 done, err = future.DoneWithContext(context.Background(), client) 1534 if err != nil { 1535 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 1536 return 1537 } 1538 if !done { 1539 ar.Response = future.Response() 1540 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 1541 return 1542 } 1543 ar.Response = future.Response() 1544 return 1545} 1546 1547// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 1548// operation. 1549type DisksGrantAccessFuture struct { 1550 azure.FutureAPI 1551 // Result returns the result of the asynchronous operation. 1552 // If the operation has not completed it will return an error. 1553 Result func(DisksClient) (AccessURI, error) 1554} 1555 1556// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1557func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 1558 var azFuture azure.Future 1559 if err := json.Unmarshal(body, &azFuture); err != nil { 1560 return err 1561 } 1562 future.FutureAPI = &azFuture 1563 future.Result = future.result 1564 return nil 1565} 1566 1567// result is the default implementation for DisksGrantAccessFuture.Result. 1568func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 1569 var done bool 1570 done, err = future.DoneWithContext(context.Background(), client) 1571 if err != nil { 1572 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 1573 return 1574 } 1575 if !done { 1576 au.Response.Response = future.Response() 1577 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 1578 return 1579 } 1580 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1581 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 1582 au, err = client.GrantAccessResponder(au.Response.Response) 1583 if err != nil { 1584 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 1585 } 1586 } 1587 return 1588} 1589 1590// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 1591type DiskSku struct { 1592 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 1593 Name DiskStorageAccountTypes `json:"name,omitempty"` 1594 // Tier - READ-ONLY; The sku tier. 1595 Tier *string `json:"tier,omitempty"` 1596} 1597 1598// MarshalJSON is the custom marshaler for DiskSku. 1599func (ds DiskSku) MarshalJSON() ([]byte, error) { 1600 objectMap := make(map[string]interface{}) 1601 if ds.Name != "" { 1602 objectMap["name"] = ds.Name 1603 } 1604 return json.Marshal(objectMap) 1605} 1606 1607// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 1608// operation. 1609type DisksRevokeAccessFuture struct { 1610 azure.FutureAPI 1611 // Result returns the result of the asynchronous operation. 1612 // If the operation has not completed it will return an error. 1613 Result func(DisksClient) (autorest.Response, error) 1614} 1615 1616// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1617func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 1618 var azFuture azure.Future 1619 if err := json.Unmarshal(body, &azFuture); err != nil { 1620 return err 1621 } 1622 future.FutureAPI = &azFuture 1623 future.Result = future.result 1624 return nil 1625} 1626 1627// result is the default implementation for DisksRevokeAccessFuture.Result. 1628func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 1629 var done bool 1630 done, err = future.DoneWithContext(context.Background(), client) 1631 if err != nil { 1632 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 1633 return 1634 } 1635 if !done { 1636 ar.Response = future.Response() 1637 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 1638 return 1639 } 1640 ar.Response = future.Response() 1641 return 1642} 1643 1644// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1645type DisksUpdateFuture struct { 1646 azure.FutureAPI 1647 // Result returns the result of the asynchronous operation. 1648 // If the operation has not completed it will return an error. 1649 Result func(DisksClient) (Disk, error) 1650} 1651 1652// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1653func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 1654 var azFuture azure.Future 1655 if err := json.Unmarshal(body, &azFuture); err != nil { 1656 return err 1657 } 1658 future.FutureAPI = &azFuture 1659 future.Result = future.result 1660 return nil 1661} 1662 1663// result is the default implementation for DisksUpdateFuture.Result. 1664func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 1665 var done bool 1666 done, err = future.DoneWithContext(context.Background(), client) 1667 if err != nil { 1668 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 1669 return 1670 } 1671 if !done { 1672 d.Response.Response = future.Response() 1673 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 1674 return 1675 } 1676 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1677 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 1678 d, err = client.UpdateResponder(d.Response.Response) 1679 if err != nil { 1680 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 1681 } 1682 } 1683 return 1684} 1685 1686// DiskUpdate disk update resource. 1687type DiskUpdate struct { 1688 *DiskUpdateProperties `json:"properties,omitempty"` 1689 // Tags - Resource tags 1690 Tags map[string]*string `json:"tags"` 1691 Sku *DiskSku `json:"sku,omitempty"` 1692} 1693 1694// MarshalJSON is the custom marshaler for DiskUpdate. 1695func (du DiskUpdate) MarshalJSON() ([]byte, error) { 1696 objectMap := make(map[string]interface{}) 1697 if du.DiskUpdateProperties != nil { 1698 objectMap["properties"] = du.DiskUpdateProperties 1699 } 1700 if du.Tags != nil { 1701 objectMap["tags"] = du.Tags 1702 } 1703 if du.Sku != nil { 1704 objectMap["sku"] = du.Sku 1705 } 1706 return json.Marshal(objectMap) 1707} 1708 1709// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 1710func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 1711 var m map[string]*json.RawMessage 1712 err := json.Unmarshal(body, &m) 1713 if err != nil { 1714 return err 1715 } 1716 for k, v := range m { 1717 switch k { 1718 case "properties": 1719 if v != nil { 1720 var diskUpdateProperties DiskUpdateProperties 1721 err = json.Unmarshal(*v, &diskUpdateProperties) 1722 if err != nil { 1723 return err 1724 } 1725 du.DiskUpdateProperties = &diskUpdateProperties 1726 } 1727 case "tags": 1728 if v != nil { 1729 var tags map[string]*string 1730 err = json.Unmarshal(*v, &tags) 1731 if err != nil { 1732 return err 1733 } 1734 du.Tags = tags 1735 } 1736 case "sku": 1737 if v != nil { 1738 var sku DiskSku 1739 err = json.Unmarshal(*v, &sku) 1740 if err != nil { 1741 return err 1742 } 1743 du.Sku = &sku 1744 } 1745 } 1746 } 1747 1748 return nil 1749} 1750 1751// DiskUpdateProperties disk resource update properties. 1752type DiskUpdateProperties struct { 1753 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 1754 OsType OperatingSystemTypes `json:"osType,omitempty"` 1755 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 1756 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1757 // EncryptionSettings - Encryption settings for disk or snapshot 1758 EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` 1759 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 1760 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1761 // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 1762 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 1763} 1764 1765// EncryptionSettings encryption settings for disk or snapshot 1766type EncryptionSettings struct { 1767 // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. 1768 Enabled *bool `json:"enabled,omitempty"` 1769 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 1770 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 1771 // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key 1772 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 1773} 1774 1775// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1776// operation. 1777type GalleriesCreateOrUpdateFuture struct { 1778 azure.FutureAPI 1779 // Result returns the result of the asynchronous operation. 1780 // If the operation has not completed it will return an error. 1781 Result func(GalleriesClient) (Gallery, error) 1782} 1783 1784// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1785func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1786 var azFuture azure.Future 1787 if err := json.Unmarshal(body, &azFuture); err != nil { 1788 return err 1789 } 1790 future.FutureAPI = &azFuture 1791 future.Result = future.result 1792 return nil 1793} 1794 1795// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. 1796func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 1797 var done bool 1798 done, err = future.DoneWithContext(context.Background(), client) 1799 if err != nil { 1800 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1801 return 1802 } 1803 if !done { 1804 g.Response.Response = future.Response() 1805 err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") 1806 return 1807 } 1808 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1809 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 1810 g, err = client.CreateOrUpdateResponder(g.Response.Response) 1811 if err != nil { 1812 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 1813 } 1814 } 1815 return 1816} 1817 1818// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1819// operation. 1820type GalleriesDeleteFuture struct { 1821 azure.FutureAPI 1822 // Result returns the result of the asynchronous operation. 1823 // If the operation has not completed it will return an error. 1824 Result func(GalleriesClient) (autorest.Response, error) 1825} 1826 1827// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1828func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { 1829 var azFuture azure.Future 1830 if err := json.Unmarshal(body, &azFuture); err != nil { 1831 return err 1832 } 1833 future.FutureAPI = &azFuture 1834 future.Result = future.result 1835 return nil 1836} 1837 1838// result is the default implementation for GalleriesDeleteFuture.Result. 1839func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { 1840 var done bool 1841 done, err = future.DoneWithContext(context.Background(), client) 1842 if err != nil { 1843 err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") 1844 return 1845 } 1846 if !done { 1847 ar.Response = future.Response() 1848 err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") 1849 return 1850 } 1851 ar.Response = future.Response() 1852 return 1853} 1854 1855// Gallery specifies information about the Shared Image Gallery that you want to create or update. 1856type Gallery struct { 1857 autorest.Response `json:"-"` 1858 *GalleryProperties `json:"properties,omitempty"` 1859 // ID - READ-ONLY; Resource Id 1860 ID *string `json:"id,omitempty"` 1861 // Name - READ-ONLY; Resource name 1862 Name *string `json:"name,omitempty"` 1863 // Type - READ-ONLY; Resource type 1864 Type *string `json:"type,omitempty"` 1865 // Location - Resource location 1866 Location *string `json:"location,omitempty"` 1867 // Tags - Resource tags 1868 Tags map[string]*string `json:"tags"` 1869} 1870 1871// MarshalJSON is the custom marshaler for Gallery. 1872func (g Gallery) MarshalJSON() ([]byte, error) { 1873 objectMap := make(map[string]interface{}) 1874 if g.GalleryProperties != nil { 1875 objectMap["properties"] = g.GalleryProperties 1876 } 1877 if g.Location != nil { 1878 objectMap["location"] = g.Location 1879 } 1880 if g.Tags != nil { 1881 objectMap["tags"] = g.Tags 1882 } 1883 return json.Marshal(objectMap) 1884} 1885 1886// UnmarshalJSON is the custom unmarshaler for Gallery struct. 1887func (g *Gallery) UnmarshalJSON(body []byte) error { 1888 var m map[string]*json.RawMessage 1889 err := json.Unmarshal(body, &m) 1890 if err != nil { 1891 return err 1892 } 1893 for k, v := range m { 1894 switch k { 1895 case "properties": 1896 if v != nil { 1897 var galleryProperties GalleryProperties 1898 err = json.Unmarshal(*v, &galleryProperties) 1899 if err != nil { 1900 return err 1901 } 1902 g.GalleryProperties = &galleryProperties 1903 } 1904 case "id": 1905 if v != nil { 1906 var ID string 1907 err = json.Unmarshal(*v, &ID) 1908 if err != nil { 1909 return err 1910 } 1911 g.ID = &ID 1912 } 1913 case "name": 1914 if v != nil { 1915 var name string 1916 err = json.Unmarshal(*v, &name) 1917 if err != nil { 1918 return err 1919 } 1920 g.Name = &name 1921 } 1922 case "type": 1923 if v != nil { 1924 var typeVar string 1925 err = json.Unmarshal(*v, &typeVar) 1926 if err != nil { 1927 return err 1928 } 1929 g.Type = &typeVar 1930 } 1931 case "location": 1932 if v != nil { 1933 var location string 1934 err = json.Unmarshal(*v, &location) 1935 if err != nil { 1936 return err 1937 } 1938 g.Location = &location 1939 } 1940 case "tags": 1941 if v != nil { 1942 var tags map[string]*string 1943 err = json.Unmarshal(*v, &tags) 1944 if err != nil { 1945 return err 1946 } 1947 g.Tags = tags 1948 } 1949 } 1950 } 1951 1952 return nil 1953} 1954 1955// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 1956type GalleryArtifactPublishingProfileBase struct { 1957 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 1958 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 1959 Source *GalleryArtifactSource `json:"source,omitempty"` 1960} 1961 1962// GalleryArtifactSource the source image from which the Image Version is going to be created. 1963type GalleryArtifactSource struct { 1964 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 1965} 1966 1967// GalleryDataDiskImage this is the data disk image. 1968type GalleryDataDiskImage struct { 1969 // Lun - READ-ONLY; This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. 1970 Lun *int32 `json:"lun,omitempty"` 1971 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 1972 SizeInGB *int32 `json:"sizeInGB,omitempty"` 1973 // HostCaching - READ-ONLY; The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 1974 HostCaching HostCaching `json:"hostCaching,omitempty"` 1975} 1976 1977// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 1978func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 1979 objectMap := make(map[string]interface{}) 1980 return json.Marshal(objectMap) 1981} 1982 1983// GalleryDiskImage this is the disk image base class. 1984type GalleryDiskImage struct { 1985 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 1986 SizeInGB *int32 `json:"sizeInGB,omitempty"` 1987 // HostCaching - READ-ONLY; The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 1988 HostCaching HostCaching `json:"hostCaching,omitempty"` 1989} 1990 1991// MarshalJSON is the custom marshaler for GalleryDiskImage. 1992func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 1993 objectMap := make(map[string]interface{}) 1994 return json.Marshal(objectMap) 1995} 1996 1997// GalleryIdentifier describes the gallery unique name. 1998type GalleryIdentifier struct { 1999 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 2000 UniqueName *string `json:"uniqueName,omitempty"` 2001} 2002 2003// MarshalJSON is the custom marshaler for GalleryIdentifier. 2004func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { 2005 objectMap := make(map[string]interface{}) 2006 return json.Marshal(objectMap) 2007} 2008 2009// GalleryImage specifies information about the gallery Image Definition that you want to create or update. 2010type GalleryImage struct { 2011 autorest.Response `json:"-"` 2012 *GalleryImageProperties `json:"properties,omitempty"` 2013 // ID - READ-ONLY; Resource Id 2014 ID *string `json:"id,omitempty"` 2015 // Name - READ-ONLY; Resource name 2016 Name *string `json:"name,omitempty"` 2017 // Type - READ-ONLY; Resource type 2018 Type *string `json:"type,omitempty"` 2019 // Location - Resource location 2020 Location *string `json:"location,omitempty"` 2021 // Tags - Resource tags 2022 Tags map[string]*string `json:"tags"` 2023} 2024 2025// MarshalJSON is the custom marshaler for GalleryImage. 2026func (gi GalleryImage) MarshalJSON() ([]byte, error) { 2027 objectMap := make(map[string]interface{}) 2028 if gi.GalleryImageProperties != nil { 2029 objectMap["properties"] = gi.GalleryImageProperties 2030 } 2031 if gi.Location != nil { 2032 objectMap["location"] = gi.Location 2033 } 2034 if gi.Tags != nil { 2035 objectMap["tags"] = gi.Tags 2036 } 2037 return json.Marshal(objectMap) 2038} 2039 2040// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 2041func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 2042 var m map[string]*json.RawMessage 2043 err := json.Unmarshal(body, &m) 2044 if err != nil { 2045 return err 2046 } 2047 for k, v := range m { 2048 switch k { 2049 case "properties": 2050 if v != nil { 2051 var galleryImageProperties GalleryImageProperties 2052 err = json.Unmarshal(*v, &galleryImageProperties) 2053 if err != nil { 2054 return err 2055 } 2056 gi.GalleryImageProperties = &galleryImageProperties 2057 } 2058 case "id": 2059 if v != nil { 2060 var ID string 2061 err = json.Unmarshal(*v, &ID) 2062 if err != nil { 2063 return err 2064 } 2065 gi.ID = &ID 2066 } 2067 case "name": 2068 if v != nil { 2069 var name string 2070 err = json.Unmarshal(*v, &name) 2071 if err != nil { 2072 return err 2073 } 2074 gi.Name = &name 2075 } 2076 case "type": 2077 if v != nil { 2078 var typeVar string 2079 err = json.Unmarshal(*v, &typeVar) 2080 if err != nil { 2081 return err 2082 } 2083 gi.Type = &typeVar 2084 } 2085 case "location": 2086 if v != nil { 2087 var location string 2088 err = json.Unmarshal(*v, &location) 2089 if err != nil { 2090 return err 2091 } 2092 gi.Location = &location 2093 } 2094 case "tags": 2095 if v != nil { 2096 var tags map[string]*string 2097 err = json.Unmarshal(*v, &tags) 2098 if err != nil { 2099 return err 2100 } 2101 gi.Tags = tags 2102 } 2103 } 2104 } 2105 2106 return nil 2107} 2108 2109// GalleryImageIdentifier this is the gallery Image Definition identifier. 2110type GalleryImageIdentifier struct { 2111 // Publisher - The name of the gallery Image Definition publisher. 2112 Publisher *string `json:"publisher,omitempty"` 2113 // Offer - The name of the gallery Image Definition offer. 2114 Offer *string `json:"offer,omitempty"` 2115 // Sku - The name of the gallery Image Definition SKU. 2116 Sku *string `json:"sku,omitempty"` 2117} 2118 2119// GalleryImageList the List Gallery Images operation response. 2120type GalleryImageList struct { 2121 autorest.Response `json:"-"` 2122 // Value - A list of Shared Image Gallery images. 2123 Value *[]GalleryImage `json:"value,omitempty"` 2124 // NextLink - The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery Image Definitions. 2125 NextLink *string `json:"nextLink,omitempty"` 2126} 2127 2128// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 2129type GalleryImageListIterator struct { 2130 i int 2131 page GalleryImageListPage 2132} 2133 2134// NextWithContext advances to the next value. If there was an error making 2135// the request the iterator does not advance and the error is returned. 2136func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 2137 if tracing.IsEnabled() { 2138 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 2139 defer func() { 2140 sc := -1 2141 if iter.Response().Response.Response != nil { 2142 sc = iter.Response().Response.Response.StatusCode 2143 } 2144 tracing.EndSpan(ctx, sc, err) 2145 }() 2146 } 2147 iter.i++ 2148 if iter.i < len(iter.page.Values()) { 2149 return nil 2150 } 2151 err = iter.page.NextWithContext(ctx) 2152 if err != nil { 2153 iter.i-- 2154 return err 2155 } 2156 iter.i = 0 2157 return nil 2158} 2159 2160// Next advances to the next value. If there was an error making 2161// the request the iterator does not advance and the error is returned. 2162// Deprecated: Use NextWithContext() instead. 2163func (iter *GalleryImageListIterator) Next() error { 2164 return iter.NextWithContext(context.Background()) 2165} 2166 2167// NotDone returns true if the enumeration should be started or is not yet complete. 2168func (iter GalleryImageListIterator) NotDone() bool { 2169 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2170} 2171 2172// Response returns the raw server response from the last page request. 2173func (iter GalleryImageListIterator) Response() GalleryImageList { 2174 return iter.page.Response() 2175} 2176 2177// Value returns the current value or a zero-initialized value if the 2178// iterator has advanced beyond the end of the collection. 2179func (iter GalleryImageListIterator) Value() GalleryImage { 2180 if !iter.page.NotDone() { 2181 return GalleryImage{} 2182 } 2183 return iter.page.Values()[iter.i] 2184} 2185 2186// Creates a new instance of the GalleryImageListIterator type. 2187func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 2188 return GalleryImageListIterator{page: page} 2189} 2190 2191// IsEmpty returns true if the ListResult contains no values. 2192func (gil GalleryImageList) IsEmpty() bool { 2193 return gil.Value == nil || len(*gil.Value) == 0 2194} 2195 2196// hasNextLink returns true if the NextLink is not empty. 2197func (gil GalleryImageList) hasNextLink() bool { 2198 return gil.NextLink != nil && len(*gil.NextLink) != 0 2199} 2200 2201// galleryImageListPreparer prepares a request to retrieve the next set of results. 2202// It returns nil if no more results exist. 2203func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 2204 if !gil.hasNextLink() { 2205 return nil, nil 2206 } 2207 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2208 autorest.AsJSON(), 2209 autorest.AsGet(), 2210 autorest.WithBaseURL(to.String(gil.NextLink))) 2211} 2212 2213// GalleryImageListPage contains a page of GalleryImage values. 2214type GalleryImageListPage struct { 2215 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 2216 gil GalleryImageList 2217} 2218 2219// NextWithContext advances to the next page of values. If there was an error making 2220// the request the page does not advance and the error is returned. 2221func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 2222 if tracing.IsEnabled() { 2223 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 2224 defer func() { 2225 sc := -1 2226 if page.Response().Response.Response != nil { 2227 sc = page.Response().Response.Response.StatusCode 2228 } 2229 tracing.EndSpan(ctx, sc, err) 2230 }() 2231 } 2232 for { 2233 next, err := page.fn(ctx, page.gil) 2234 if err != nil { 2235 return err 2236 } 2237 page.gil = next 2238 if !next.hasNextLink() || !next.IsEmpty() { 2239 break 2240 } 2241 } 2242 return nil 2243} 2244 2245// Next advances to the next page of values. If there was an error making 2246// the request the page does not advance and the error is returned. 2247// Deprecated: Use NextWithContext() instead. 2248func (page *GalleryImageListPage) Next() error { 2249 return page.NextWithContext(context.Background()) 2250} 2251 2252// NotDone returns true if the page enumeration should be started or is not yet complete. 2253func (page GalleryImageListPage) NotDone() bool { 2254 return !page.gil.IsEmpty() 2255} 2256 2257// Response returns the raw server response from the last page request. 2258func (page GalleryImageListPage) Response() GalleryImageList { 2259 return page.gil 2260} 2261 2262// Values returns the slice of values for the current page or nil if there are no values. 2263func (page GalleryImageListPage) Values() []GalleryImage { 2264 if page.gil.IsEmpty() { 2265 return nil 2266 } 2267 return *page.gil.Value 2268} 2269 2270// Creates a new instance of the GalleryImageListPage type. 2271func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 2272 return GalleryImageListPage{ 2273 fn: getNextPage, 2274 gil: cur, 2275 } 2276} 2277 2278// GalleryImageProperties describes the properties of a gallery Image Definition. 2279type GalleryImageProperties struct { 2280 // Description - The description of this gallery Image Definition resource. This property is updatable. 2281 Description *string `json:"description,omitempty"` 2282 // Eula - The Eula agreement for the gallery Image Definition. 2283 Eula *string `json:"eula,omitempty"` 2284 // PrivacyStatementURI - The privacy statement uri. 2285 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 2286 // ReleaseNoteURI - The release note uri. 2287 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 2288 // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 2289 OsType OperatingSystemTypes `json:"osType,omitempty"` 2290 // OsState - The allowed values for OS State are 'Generalized'. Possible values include: 'Generalized', 'Specialized' 2291 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 2292 // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. 2293 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 2294 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 2295 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 2296 Disallowed *Disallowed `json:"disallowed,omitempty"` 2297 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 2298 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 2299 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 2300} 2301 2302// MarshalJSON is the custom marshaler for GalleryImageProperties. 2303func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 2304 objectMap := make(map[string]interface{}) 2305 if gip.Description != nil { 2306 objectMap["description"] = gip.Description 2307 } 2308 if gip.Eula != nil { 2309 objectMap["eula"] = gip.Eula 2310 } 2311 if gip.PrivacyStatementURI != nil { 2312 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 2313 } 2314 if gip.ReleaseNoteURI != nil { 2315 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 2316 } 2317 if gip.OsType != "" { 2318 objectMap["osType"] = gip.OsType 2319 } 2320 if gip.OsState != "" { 2321 objectMap["osState"] = gip.OsState 2322 } 2323 if gip.EndOfLifeDate != nil { 2324 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 2325 } 2326 if gip.Identifier != nil { 2327 objectMap["identifier"] = gip.Identifier 2328 } 2329 if gip.Recommended != nil { 2330 objectMap["recommended"] = gip.Recommended 2331 } 2332 if gip.Disallowed != nil { 2333 objectMap["disallowed"] = gip.Disallowed 2334 } 2335 if gip.PurchasePlan != nil { 2336 objectMap["purchasePlan"] = gip.PurchasePlan 2337 } 2338 return json.Marshal(objectMap) 2339} 2340 2341// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2342// long-running operation. 2343type GalleryImagesCreateOrUpdateFuture struct { 2344 azure.FutureAPI 2345 // Result returns the result of the asynchronous operation. 2346 // If the operation has not completed it will return an error. 2347 Result func(GalleryImagesClient) (GalleryImage, error) 2348} 2349 2350// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2351func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2352 var azFuture azure.Future 2353 if err := json.Unmarshal(body, &azFuture); err != nil { 2354 return err 2355 } 2356 future.FutureAPI = &azFuture 2357 future.Result = future.result 2358 return nil 2359} 2360 2361// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. 2362func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 2363 var done bool 2364 done, err = future.DoneWithContext(context.Background(), client) 2365 if err != nil { 2366 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2367 return 2368 } 2369 if !done { 2370 gi.Response.Response = future.Response() 2371 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") 2372 return 2373 } 2374 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2375 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 2376 gi, err = client.CreateOrUpdateResponder(gi.Response.Response) 2377 if err != nil { 2378 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 2379 } 2380 } 2381 return 2382} 2383 2384// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2385// operation. 2386type GalleryImagesDeleteFuture struct { 2387 azure.FutureAPI 2388 // Result returns the result of the asynchronous operation. 2389 // If the operation has not completed it will return an error. 2390 Result func(GalleryImagesClient) (autorest.Response, error) 2391} 2392 2393// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2394func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { 2395 var azFuture azure.Future 2396 if err := json.Unmarshal(body, &azFuture); err != nil { 2397 return err 2398 } 2399 future.FutureAPI = &azFuture 2400 future.Result = future.result 2401 return nil 2402} 2403 2404// result is the default implementation for GalleryImagesDeleteFuture.Result. 2405func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { 2406 var done bool 2407 done, err = future.DoneWithContext(context.Background(), client) 2408 if err != nil { 2409 err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") 2410 return 2411 } 2412 if !done { 2413 ar.Response = future.Response() 2414 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") 2415 return 2416 } 2417 ar.Response = future.Response() 2418 return 2419} 2420 2421// GalleryImageVersion specifies information about the gallery Image Version that you want to create or 2422// update. 2423type GalleryImageVersion struct { 2424 autorest.Response `json:"-"` 2425 *GalleryImageVersionProperties `json:"properties,omitempty"` 2426 // ID - READ-ONLY; Resource Id 2427 ID *string `json:"id,omitempty"` 2428 // Name - READ-ONLY; Resource name 2429 Name *string `json:"name,omitempty"` 2430 // Type - READ-ONLY; Resource type 2431 Type *string `json:"type,omitempty"` 2432 // Location - Resource location 2433 Location *string `json:"location,omitempty"` 2434 // Tags - Resource tags 2435 Tags map[string]*string `json:"tags"` 2436} 2437 2438// MarshalJSON is the custom marshaler for GalleryImageVersion. 2439func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 2440 objectMap := make(map[string]interface{}) 2441 if giv.GalleryImageVersionProperties != nil { 2442 objectMap["properties"] = giv.GalleryImageVersionProperties 2443 } 2444 if giv.Location != nil { 2445 objectMap["location"] = giv.Location 2446 } 2447 if giv.Tags != nil { 2448 objectMap["tags"] = giv.Tags 2449 } 2450 return json.Marshal(objectMap) 2451} 2452 2453// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 2454func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 2455 var m map[string]*json.RawMessage 2456 err := json.Unmarshal(body, &m) 2457 if err != nil { 2458 return err 2459 } 2460 for k, v := range m { 2461 switch k { 2462 case "properties": 2463 if v != nil { 2464 var galleryImageVersionProperties GalleryImageVersionProperties 2465 err = json.Unmarshal(*v, &galleryImageVersionProperties) 2466 if err != nil { 2467 return err 2468 } 2469 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 2470 } 2471 case "id": 2472 if v != nil { 2473 var ID string 2474 err = json.Unmarshal(*v, &ID) 2475 if err != nil { 2476 return err 2477 } 2478 giv.ID = &ID 2479 } 2480 case "name": 2481 if v != nil { 2482 var name string 2483 err = json.Unmarshal(*v, &name) 2484 if err != nil { 2485 return err 2486 } 2487 giv.Name = &name 2488 } 2489 case "type": 2490 if v != nil { 2491 var typeVar string 2492 err = json.Unmarshal(*v, &typeVar) 2493 if err != nil { 2494 return err 2495 } 2496 giv.Type = &typeVar 2497 } 2498 case "location": 2499 if v != nil { 2500 var location string 2501 err = json.Unmarshal(*v, &location) 2502 if err != nil { 2503 return err 2504 } 2505 giv.Location = &location 2506 } 2507 case "tags": 2508 if v != nil { 2509 var tags map[string]*string 2510 err = json.Unmarshal(*v, &tags) 2511 if err != nil { 2512 return err 2513 } 2514 giv.Tags = tags 2515 } 2516 } 2517 } 2518 2519 return nil 2520} 2521 2522// GalleryImageVersionList the List Gallery Image version operation response. 2523type GalleryImageVersionList struct { 2524 autorest.Response `json:"-"` 2525 // Value - A list of gallery Image Versions. 2526 Value *[]GalleryImageVersion `json:"value,omitempty"` 2527 // NextLink - The uri to fetch the next page of gallery Image Versions. Call ListNext() with this to fetch the next page of gallery Image Versions. 2528 NextLink *string `json:"nextLink,omitempty"` 2529} 2530 2531// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 2532type GalleryImageVersionListIterator struct { 2533 i int 2534 page GalleryImageVersionListPage 2535} 2536 2537// NextWithContext advances to the next value. If there was an error making 2538// the request the iterator does not advance and the error is returned. 2539func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 2540 if tracing.IsEnabled() { 2541 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 2542 defer func() { 2543 sc := -1 2544 if iter.Response().Response.Response != nil { 2545 sc = iter.Response().Response.Response.StatusCode 2546 } 2547 tracing.EndSpan(ctx, sc, err) 2548 }() 2549 } 2550 iter.i++ 2551 if iter.i < len(iter.page.Values()) { 2552 return nil 2553 } 2554 err = iter.page.NextWithContext(ctx) 2555 if err != nil { 2556 iter.i-- 2557 return err 2558 } 2559 iter.i = 0 2560 return nil 2561} 2562 2563// Next advances to the next value. If there was an error making 2564// the request the iterator does not advance and the error is returned. 2565// Deprecated: Use NextWithContext() instead. 2566func (iter *GalleryImageVersionListIterator) Next() error { 2567 return iter.NextWithContext(context.Background()) 2568} 2569 2570// NotDone returns true if the enumeration should be started or is not yet complete. 2571func (iter GalleryImageVersionListIterator) NotDone() bool { 2572 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2573} 2574 2575// Response returns the raw server response from the last page request. 2576func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 2577 return iter.page.Response() 2578} 2579 2580// Value returns the current value or a zero-initialized value if the 2581// iterator has advanced beyond the end of the collection. 2582func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 2583 if !iter.page.NotDone() { 2584 return GalleryImageVersion{} 2585 } 2586 return iter.page.Values()[iter.i] 2587} 2588 2589// Creates a new instance of the GalleryImageVersionListIterator type. 2590func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 2591 return GalleryImageVersionListIterator{page: page} 2592} 2593 2594// IsEmpty returns true if the ListResult contains no values. 2595func (givl GalleryImageVersionList) IsEmpty() bool { 2596 return givl.Value == nil || len(*givl.Value) == 0 2597} 2598 2599// hasNextLink returns true if the NextLink is not empty. 2600func (givl GalleryImageVersionList) hasNextLink() bool { 2601 return givl.NextLink != nil && len(*givl.NextLink) != 0 2602} 2603 2604// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 2605// It returns nil if no more results exist. 2606func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 2607 if !givl.hasNextLink() { 2608 return nil, nil 2609 } 2610 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2611 autorest.AsJSON(), 2612 autorest.AsGet(), 2613 autorest.WithBaseURL(to.String(givl.NextLink))) 2614} 2615 2616// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 2617type GalleryImageVersionListPage struct { 2618 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 2619 givl GalleryImageVersionList 2620} 2621 2622// NextWithContext advances to the next page of values. If there was an error making 2623// the request the page does not advance and the error is returned. 2624func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 2625 if tracing.IsEnabled() { 2626 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 2627 defer func() { 2628 sc := -1 2629 if page.Response().Response.Response != nil { 2630 sc = page.Response().Response.Response.StatusCode 2631 } 2632 tracing.EndSpan(ctx, sc, err) 2633 }() 2634 } 2635 for { 2636 next, err := page.fn(ctx, page.givl) 2637 if err != nil { 2638 return err 2639 } 2640 page.givl = next 2641 if !next.hasNextLink() || !next.IsEmpty() { 2642 break 2643 } 2644 } 2645 return nil 2646} 2647 2648// Next advances to the next page of values. If there was an error making 2649// the request the page does not advance and the error is returned. 2650// Deprecated: Use NextWithContext() instead. 2651func (page *GalleryImageVersionListPage) Next() error { 2652 return page.NextWithContext(context.Background()) 2653} 2654 2655// NotDone returns true if the page enumeration should be started or is not yet complete. 2656func (page GalleryImageVersionListPage) NotDone() bool { 2657 return !page.givl.IsEmpty() 2658} 2659 2660// Response returns the raw server response from the last page request. 2661func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 2662 return page.givl 2663} 2664 2665// Values returns the slice of values for the current page or nil if there are no values. 2666func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 2667 if page.givl.IsEmpty() { 2668 return nil 2669 } 2670 return *page.givl.Value 2671} 2672 2673// Creates a new instance of the GalleryImageVersionListPage type. 2674func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 2675 return GalleryImageVersionListPage{ 2676 fn: getNextPage, 2677 givl: cur, 2678 } 2679} 2680 2681// GalleryImageVersionProperties describes the properties of a gallery Image Version. 2682type GalleryImageVersionProperties struct { 2683 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 2684 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 2685 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 2686 // StorageProfile - READ-ONLY 2687 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 2688 // ReplicationStatus - READ-ONLY 2689 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 2690} 2691 2692// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 2693func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 2694 objectMap := make(map[string]interface{}) 2695 if givp.PublishingProfile != nil { 2696 objectMap["publishingProfile"] = givp.PublishingProfile 2697 } 2698 return json.Marshal(objectMap) 2699} 2700 2701// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. 2702type GalleryImageVersionPublishingProfile struct { 2703 // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. 2704 ReplicaCount *int32 `json:"replicaCount,omitempty"` 2705 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 2706 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 2707 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 2708 PublishedDate *date.Time `json:"publishedDate,omitempty"` 2709 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 2710 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 2711 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 2712 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 2713 Source *GalleryArtifactSource `json:"source,omitempty"` 2714} 2715 2716// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 2717func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 2718 objectMap := make(map[string]interface{}) 2719 if givpp.ReplicaCount != nil { 2720 objectMap["replicaCount"] = givpp.ReplicaCount 2721 } 2722 if givpp.ExcludeFromLatest != nil { 2723 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 2724 } 2725 if givpp.EndOfLifeDate != nil { 2726 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 2727 } 2728 if givpp.TargetRegions != nil { 2729 objectMap["targetRegions"] = givpp.TargetRegions 2730 } 2731 if givpp.Source != nil { 2732 objectMap["source"] = givpp.Source 2733 } 2734 return json.Marshal(objectMap) 2735} 2736 2737// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2738// long-running operation. 2739type GalleryImageVersionsCreateOrUpdateFuture struct { 2740 azure.FutureAPI 2741 // Result returns the result of the asynchronous operation. 2742 // If the operation has not completed it will return an error. 2743 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 2744} 2745 2746// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2747func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2748 var azFuture azure.Future 2749 if err := json.Unmarshal(body, &azFuture); err != nil { 2750 return err 2751 } 2752 future.FutureAPI = &azFuture 2753 future.Result = future.result 2754 return nil 2755} 2756 2757// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. 2758func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 2759 var done bool 2760 done, err = future.DoneWithContext(context.Background(), client) 2761 if err != nil { 2762 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2763 return 2764 } 2765 if !done { 2766 giv.Response.Response = future.Response() 2767 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") 2768 return 2769 } 2770 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2771 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 2772 giv, err = client.CreateOrUpdateResponder(giv.Response.Response) 2773 if err != nil { 2774 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 2775 } 2776 } 2777 return 2778} 2779 2780// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 2781// long-running operation. 2782type GalleryImageVersionsDeleteFuture struct { 2783 azure.FutureAPI 2784 // Result returns the result of the asynchronous operation. 2785 // If the operation has not completed it will return an error. 2786 Result func(GalleryImageVersionsClient) (autorest.Response, error) 2787} 2788 2789// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2790func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 2791 var azFuture azure.Future 2792 if err := json.Unmarshal(body, &azFuture); err != nil { 2793 return err 2794 } 2795 future.FutureAPI = &azFuture 2796 future.Result = future.result 2797 return nil 2798} 2799 2800// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. 2801func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { 2802 var done bool 2803 done, err = future.DoneWithContext(context.Background(), client) 2804 if err != nil { 2805 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 2806 return 2807 } 2808 if !done { 2809 ar.Response = future.Response() 2810 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") 2811 return 2812 } 2813 ar.Response = future.Response() 2814 return 2815} 2816 2817// GalleryImageVersionStorageProfile this is the storage profile of a gallery Image Version. 2818type GalleryImageVersionStorageProfile struct { 2819 // OsDiskImage - READ-ONLY 2820 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 2821 // DataDiskImages - READ-ONLY; A list of data disk images. 2822 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 2823} 2824 2825// MarshalJSON is the custom marshaler for GalleryImageVersionStorageProfile. 2826func (givsp GalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) { 2827 objectMap := make(map[string]interface{}) 2828 return json.Marshal(objectMap) 2829} 2830 2831// GalleryList the List Galleries operation response. 2832type GalleryList struct { 2833 autorest.Response `json:"-"` 2834 // Value - A list of galleries. 2835 Value *[]Gallery `json:"value,omitempty"` 2836 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 2837 NextLink *string `json:"nextLink,omitempty"` 2838} 2839 2840// GalleryListIterator provides access to a complete listing of Gallery values. 2841type GalleryListIterator struct { 2842 i int 2843 page GalleryListPage 2844} 2845 2846// NextWithContext advances to the next value. If there was an error making 2847// the request the iterator does not advance and the error is returned. 2848func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 2849 if tracing.IsEnabled() { 2850 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 2851 defer func() { 2852 sc := -1 2853 if iter.Response().Response.Response != nil { 2854 sc = iter.Response().Response.Response.StatusCode 2855 } 2856 tracing.EndSpan(ctx, sc, err) 2857 }() 2858 } 2859 iter.i++ 2860 if iter.i < len(iter.page.Values()) { 2861 return nil 2862 } 2863 err = iter.page.NextWithContext(ctx) 2864 if err != nil { 2865 iter.i-- 2866 return err 2867 } 2868 iter.i = 0 2869 return nil 2870} 2871 2872// Next advances to the next value. If there was an error making 2873// the request the iterator does not advance and the error is returned. 2874// Deprecated: Use NextWithContext() instead. 2875func (iter *GalleryListIterator) Next() error { 2876 return iter.NextWithContext(context.Background()) 2877} 2878 2879// NotDone returns true if the enumeration should be started or is not yet complete. 2880func (iter GalleryListIterator) NotDone() bool { 2881 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2882} 2883 2884// Response returns the raw server response from the last page request. 2885func (iter GalleryListIterator) Response() GalleryList { 2886 return iter.page.Response() 2887} 2888 2889// Value returns the current value or a zero-initialized value if the 2890// iterator has advanced beyond the end of the collection. 2891func (iter GalleryListIterator) Value() Gallery { 2892 if !iter.page.NotDone() { 2893 return Gallery{} 2894 } 2895 return iter.page.Values()[iter.i] 2896} 2897 2898// Creates a new instance of the GalleryListIterator type. 2899func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 2900 return GalleryListIterator{page: page} 2901} 2902 2903// IsEmpty returns true if the ListResult contains no values. 2904func (gl GalleryList) IsEmpty() bool { 2905 return gl.Value == nil || len(*gl.Value) == 0 2906} 2907 2908// hasNextLink returns true if the NextLink is not empty. 2909func (gl GalleryList) hasNextLink() bool { 2910 return gl.NextLink != nil && len(*gl.NextLink) != 0 2911} 2912 2913// galleryListPreparer prepares a request to retrieve the next set of results. 2914// It returns nil if no more results exist. 2915func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 2916 if !gl.hasNextLink() { 2917 return nil, nil 2918 } 2919 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2920 autorest.AsJSON(), 2921 autorest.AsGet(), 2922 autorest.WithBaseURL(to.String(gl.NextLink))) 2923} 2924 2925// GalleryListPage contains a page of Gallery values. 2926type GalleryListPage struct { 2927 fn func(context.Context, GalleryList) (GalleryList, error) 2928 gl GalleryList 2929} 2930 2931// NextWithContext advances to the next page of values. If there was an error making 2932// the request the page does not advance and the error is returned. 2933func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 2934 if tracing.IsEnabled() { 2935 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 2936 defer func() { 2937 sc := -1 2938 if page.Response().Response.Response != nil { 2939 sc = page.Response().Response.Response.StatusCode 2940 } 2941 tracing.EndSpan(ctx, sc, err) 2942 }() 2943 } 2944 for { 2945 next, err := page.fn(ctx, page.gl) 2946 if err != nil { 2947 return err 2948 } 2949 page.gl = next 2950 if !next.hasNextLink() || !next.IsEmpty() { 2951 break 2952 } 2953 } 2954 return nil 2955} 2956 2957// Next advances to the next page of values. If there was an error making 2958// the request the page does not advance and the error is returned. 2959// Deprecated: Use NextWithContext() instead. 2960func (page *GalleryListPage) Next() error { 2961 return page.NextWithContext(context.Background()) 2962} 2963 2964// NotDone returns true if the page enumeration should be started or is not yet complete. 2965func (page GalleryListPage) NotDone() bool { 2966 return !page.gl.IsEmpty() 2967} 2968 2969// Response returns the raw server response from the last page request. 2970func (page GalleryListPage) Response() GalleryList { 2971 return page.gl 2972} 2973 2974// Values returns the slice of values for the current page or nil if there are no values. 2975func (page GalleryListPage) Values() []Gallery { 2976 if page.gl.IsEmpty() { 2977 return nil 2978 } 2979 return *page.gl.Value 2980} 2981 2982// Creates a new instance of the GalleryListPage type. 2983func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 2984 return GalleryListPage{ 2985 fn: getNextPage, 2986 gl: cur, 2987 } 2988} 2989 2990// GalleryOSDiskImage this is the OS disk image. 2991type GalleryOSDiskImage struct { 2992 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 2993 SizeInGB *int32 `json:"sizeInGB,omitempty"` 2994 // HostCaching - READ-ONLY; The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 2995 HostCaching HostCaching `json:"hostCaching,omitempty"` 2996} 2997 2998// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 2999func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 3000 objectMap := make(map[string]interface{}) 3001 return json.Marshal(objectMap) 3002} 3003 3004// GalleryProperties describes the properties of a Shared Image Gallery. 3005type GalleryProperties struct { 3006 // Description - The description of this Shared Image Gallery resource. This property is updatable. 3007 Description *string `json:"description,omitempty"` 3008 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 3009 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 3010 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3011} 3012 3013// MarshalJSON is the custom marshaler for GalleryProperties. 3014func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 3015 objectMap := make(map[string]interface{}) 3016 if gp.Description != nil { 3017 objectMap["description"] = gp.Description 3018 } 3019 if gp.Identifier != nil { 3020 objectMap["identifier"] = gp.Identifier 3021 } 3022 return json.Marshal(objectMap) 3023} 3024 3025// GrantAccessData data used for requesting a SAS. 3026type GrantAccessData struct { 3027 // Access - Possible values include: 'None', 'Read' 3028 Access AccessLevel `json:"access,omitempty"` 3029 // DurationInSeconds - Time duration in seconds until the SAS access expires. 3030 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 3031} 3032 3033// HardwareProfile specifies the hardware settings for the virtual machine. 3034type HardwareProfile struct { 3035 // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> The available VM sizes depend on region and availability set. For a list of available sizes use these APIs: <br><br> [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'VirtualMachineSizeTypesBasicA0', 'VirtualMachineSizeTypesBasicA1', 'VirtualMachineSizeTypesBasicA2', 'VirtualMachineSizeTypesBasicA3', 'VirtualMachineSizeTypesBasicA4', 'VirtualMachineSizeTypesStandardA0', 'VirtualMachineSizeTypesStandardA1', 'VirtualMachineSizeTypesStandardA2', 'VirtualMachineSizeTypesStandardA3', 'VirtualMachineSizeTypesStandardA4', 'VirtualMachineSizeTypesStandardA5', 'VirtualMachineSizeTypesStandardA6', 'VirtualMachineSizeTypesStandardA7', 'VirtualMachineSizeTypesStandardA8', 'VirtualMachineSizeTypesStandardA9', 'VirtualMachineSizeTypesStandardA10', 'VirtualMachineSizeTypesStandardA11', 'VirtualMachineSizeTypesStandardA1V2', 'VirtualMachineSizeTypesStandardA2V2', 'VirtualMachineSizeTypesStandardA4V2', 'VirtualMachineSizeTypesStandardA8V2', 'VirtualMachineSizeTypesStandardA2mV2', 'VirtualMachineSizeTypesStandardA4mV2', 'VirtualMachineSizeTypesStandardA8mV2', 'VirtualMachineSizeTypesStandardB1s', 'VirtualMachineSizeTypesStandardB1ms', 'VirtualMachineSizeTypesStandardB2s', 'VirtualMachineSizeTypesStandardB2ms', 'VirtualMachineSizeTypesStandardB4ms', 'VirtualMachineSizeTypesStandardB8ms', 'VirtualMachineSizeTypesStandardD1', 'VirtualMachineSizeTypesStandardD2', 'VirtualMachineSizeTypesStandardD3', 'VirtualMachineSizeTypesStandardD4', 'VirtualMachineSizeTypesStandardD11', 'VirtualMachineSizeTypesStandardD12', 'VirtualMachineSizeTypesStandardD13', 'VirtualMachineSizeTypesStandardD14', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD2V3', 'VirtualMachineSizeTypesStandardD4V3', 'VirtualMachineSizeTypesStandardD8V3', 'VirtualMachineSizeTypesStandardD16V3', 'VirtualMachineSizeTypesStandardD32V3', 'VirtualMachineSizeTypesStandardD64V3', 'VirtualMachineSizeTypesStandardD2sV3', 'VirtualMachineSizeTypesStandardD4sV3', 'VirtualMachineSizeTypesStandardD8sV3', 'VirtualMachineSizeTypesStandardD16sV3', 'VirtualMachineSizeTypesStandardD32sV3', 'VirtualMachineSizeTypesStandardD64sV3', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardD14V2', 'VirtualMachineSizeTypesStandardD15V2', 'VirtualMachineSizeTypesStandardDS1', 'VirtualMachineSizeTypesStandardDS2', 'VirtualMachineSizeTypesStandardDS3', 'VirtualMachineSizeTypesStandardDS4', 'VirtualMachineSizeTypesStandardDS11', 'VirtualMachineSizeTypesStandardDS12', 'VirtualMachineSizeTypesStandardDS13', 'VirtualMachineSizeTypesStandardDS14', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardDS14V2', 'VirtualMachineSizeTypesStandardDS15V2', 'VirtualMachineSizeTypesStandardDS134V2', 'VirtualMachineSizeTypesStandardDS132V2', 'VirtualMachineSizeTypesStandardDS148V2', 'VirtualMachineSizeTypesStandardDS144V2', 'VirtualMachineSizeTypesStandardE2V3', 'VirtualMachineSizeTypesStandardE4V3', 'VirtualMachineSizeTypesStandardE8V3', 'VirtualMachineSizeTypesStandardE16V3', 'VirtualMachineSizeTypesStandardE32V3', 'VirtualMachineSizeTypesStandardE64V3', 'VirtualMachineSizeTypesStandardE2sV3', 'VirtualMachineSizeTypesStandardE4sV3', 'VirtualMachineSizeTypesStandardE8sV3', 'VirtualMachineSizeTypesStandardE16sV3', 'VirtualMachineSizeTypesStandardE32sV3', 'VirtualMachineSizeTypesStandardE64sV3', 'VirtualMachineSizeTypesStandardE3216V3', 'VirtualMachineSizeTypesStandardE328sV3', 'VirtualMachineSizeTypesStandardE6432sV3', 'VirtualMachineSizeTypesStandardE6416sV3', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s', 'VirtualMachineSizeTypesStandardF2sV2', 'VirtualMachineSizeTypesStandardF4sV2', 'VirtualMachineSizeTypesStandardF8sV2', 'VirtualMachineSizeTypesStandardF16sV2', 'VirtualMachineSizeTypesStandardF32sV2', 'VirtualMachineSizeTypesStandardF64sV2', 'VirtualMachineSizeTypesStandardF72sV2', 'VirtualMachineSizeTypesStandardG1', 'VirtualMachineSizeTypesStandardG2', 'VirtualMachineSizeTypesStandardG3', 'VirtualMachineSizeTypesStandardG4', 'VirtualMachineSizeTypesStandardG5', 'VirtualMachineSizeTypesStandardGS1', 'VirtualMachineSizeTypesStandardGS2', 'VirtualMachineSizeTypesStandardGS3', 'VirtualMachineSizeTypesStandardGS4', 'VirtualMachineSizeTypesStandardGS5', 'VirtualMachineSizeTypesStandardGS48', 'VirtualMachineSizeTypesStandardGS44', 'VirtualMachineSizeTypesStandardGS516', 'VirtualMachineSizeTypesStandardGS58', 'VirtualMachineSizeTypesStandardH8', 'VirtualMachineSizeTypesStandardH16', 'VirtualMachineSizeTypesStandardH8m', 'VirtualMachineSizeTypesStandardH16m', 'VirtualMachineSizeTypesStandardH16r', 'VirtualMachineSizeTypesStandardH16mr', 'VirtualMachineSizeTypesStandardL4s', 'VirtualMachineSizeTypesStandardL8s', 'VirtualMachineSizeTypesStandardL16s', 'VirtualMachineSizeTypesStandardL32s', 'VirtualMachineSizeTypesStandardM64s', 'VirtualMachineSizeTypesStandardM64ms', 'VirtualMachineSizeTypesStandardM128s', 'VirtualMachineSizeTypesStandardM128ms', 'VirtualMachineSizeTypesStandardM6432ms', 'VirtualMachineSizeTypesStandardM6416ms', 'VirtualMachineSizeTypesStandardM12864ms', 'VirtualMachineSizeTypesStandardM12832ms', 'VirtualMachineSizeTypesStandardNC6', 'VirtualMachineSizeTypesStandardNC12', 'VirtualMachineSizeTypesStandardNC24', 'VirtualMachineSizeTypesStandardNC24r', 'VirtualMachineSizeTypesStandardNC6sV2', 'VirtualMachineSizeTypesStandardNC12sV2', 'VirtualMachineSizeTypesStandardNC24sV2', 'VirtualMachineSizeTypesStandardNC24rsV2', 'VirtualMachineSizeTypesStandardNC6sV3', 'VirtualMachineSizeTypesStandardNC12sV3', 'VirtualMachineSizeTypesStandardNC24sV3', 'VirtualMachineSizeTypesStandardNC24rsV3', 'VirtualMachineSizeTypesStandardND6s', 'VirtualMachineSizeTypesStandardND12s', 'VirtualMachineSizeTypesStandardND24s', 'VirtualMachineSizeTypesStandardND24rs', 'VirtualMachineSizeTypesStandardNV6', 'VirtualMachineSizeTypesStandardNV12', 'VirtualMachineSizeTypesStandardNV24' 3036 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 3037} 3038 3039// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 3040// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 3041// exist. 3042type Image struct { 3043 autorest.Response `json:"-"` 3044 *ImageProperties `json:"properties,omitempty"` 3045 // ID - READ-ONLY; Resource Id 3046 ID *string `json:"id,omitempty"` 3047 // Name - READ-ONLY; Resource name 3048 Name *string `json:"name,omitempty"` 3049 // Type - READ-ONLY; Resource type 3050 Type *string `json:"type,omitempty"` 3051 // Location - Resource location 3052 Location *string `json:"location,omitempty"` 3053 // Tags - Resource tags 3054 Tags map[string]*string `json:"tags"` 3055} 3056 3057// MarshalJSON is the custom marshaler for Image. 3058func (i Image) MarshalJSON() ([]byte, error) { 3059 objectMap := make(map[string]interface{}) 3060 if i.ImageProperties != nil { 3061 objectMap["properties"] = i.ImageProperties 3062 } 3063 if i.Location != nil { 3064 objectMap["location"] = i.Location 3065 } 3066 if i.Tags != nil { 3067 objectMap["tags"] = i.Tags 3068 } 3069 return json.Marshal(objectMap) 3070} 3071 3072// UnmarshalJSON is the custom unmarshaler for Image struct. 3073func (i *Image) UnmarshalJSON(body []byte) error { 3074 var m map[string]*json.RawMessage 3075 err := json.Unmarshal(body, &m) 3076 if err != nil { 3077 return err 3078 } 3079 for k, v := range m { 3080 switch k { 3081 case "properties": 3082 if v != nil { 3083 var imageProperties ImageProperties 3084 err = json.Unmarshal(*v, &imageProperties) 3085 if err != nil { 3086 return err 3087 } 3088 i.ImageProperties = &imageProperties 3089 } 3090 case "id": 3091 if v != nil { 3092 var ID string 3093 err = json.Unmarshal(*v, &ID) 3094 if err != nil { 3095 return err 3096 } 3097 i.ID = &ID 3098 } 3099 case "name": 3100 if v != nil { 3101 var name string 3102 err = json.Unmarshal(*v, &name) 3103 if err != nil { 3104 return err 3105 } 3106 i.Name = &name 3107 } 3108 case "type": 3109 if v != nil { 3110 var typeVar string 3111 err = json.Unmarshal(*v, &typeVar) 3112 if err != nil { 3113 return err 3114 } 3115 i.Type = &typeVar 3116 } 3117 case "location": 3118 if v != nil { 3119 var location string 3120 err = json.Unmarshal(*v, &location) 3121 if err != nil { 3122 return err 3123 } 3124 i.Location = &location 3125 } 3126 case "tags": 3127 if v != nil { 3128 var tags map[string]*string 3129 err = json.Unmarshal(*v, &tags) 3130 if err != nil { 3131 return err 3132 } 3133 i.Tags = tags 3134 } 3135 } 3136 } 3137 3138 return nil 3139} 3140 3141// ImageDataDisk describes a data disk. 3142type ImageDataDisk struct { 3143 // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. 3144 Lun *int32 `json:"lun,omitempty"` 3145 // Snapshot - The snapshot. 3146 Snapshot *SubResource `json:"snapshot,omitempty"` 3147 // ManagedDisk - The managedDisk. 3148 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 3149 // BlobURI - The Virtual Hard Disk. 3150 BlobURI *string `json:"blobUri,omitempty"` 3151 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 3152 Caching CachingTypes `json:"caching,omitempty"` 3153 // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 3154 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3155 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 3156 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 3157} 3158 3159// ImageDiskReference the source image used for creating the disk. 3160type ImageDiskReference struct { 3161 // ID - A relative uri containing either a Platform Image Repository or user image reference. 3162 ID *string `json:"id,omitempty"` 3163 // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. 3164 Lun *int32 `json:"lun,omitempty"` 3165} 3166 3167// ImageListResult the List Image operation response. 3168type ImageListResult struct { 3169 autorest.Response `json:"-"` 3170 // Value - The list of Images. 3171 Value *[]Image `json:"value,omitempty"` 3172 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 3173 NextLink *string `json:"nextLink,omitempty"` 3174} 3175 3176// ImageListResultIterator provides access to a complete listing of Image values. 3177type ImageListResultIterator struct { 3178 i int 3179 page ImageListResultPage 3180} 3181 3182// NextWithContext advances to the next value. If there was an error making 3183// the request the iterator does not advance and the error is returned. 3184func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 3185 if tracing.IsEnabled() { 3186 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 3187 defer func() { 3188 sc := -1 3189 if iter.Response().Response.Response != nil { 3190 sc = iter.Response().Response.Response.StatusCode 3191 } 3192 tracing.EndSpan(ctx, sc, err) 3193 }() 3194 } 3195 iter.i++ 3196 if iter.i < len(iter.page.Values()) { 3197 return nil 3198 } 3199 err = iter.page.NextWithContext(ctx) 3200 if err != nil { 3201 iter.i-- 3202 return err 3203 } 3204 iter.i = 0 3205 return nil 3206} 3207 3208// Next advances to the next value. If there was an error making 3209// the request the iterator does not advance and the error is returned. 3210// Deprecated: Use NextWithContext() instead. 3211func (iter *ImageListResultIterator) Next() error { 3212 return iter.NextWithContext(context.Background()) 3213} 3214 3215// NotDone returns true if the enumeration should be started or is not yet complete. 3216func (iter ImageListResultIterator) NotDone() bool { 3217 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3218} 3219 3220// Response returns the raw server response from the last page request. 3221func (iter ImageListResultIterator) Response() ImageListResult { 3222 return iter.page.Response() 3223} 3224 3225// Value returns the current value or a zero-initialized value if the 3226// iterator has advanced beyond the end of the collection. 3227func (iter ImageListResultIterator) Value() Image { 3228 if !iter.page.NotDone() { 3229 return Image{} 3230 } 3231 return iter.page.Values()[iter.i] 3232} 3233 3234// Creates a new instance of the ImageListResultIterator type. 3235func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 3236 return ImageListResultIterator{page: page} 3237} 3238 3239// IsEmpty returns true if the ListResult contains no values. 3240func (ilr ImageListResult) IsEmpty() bool { 3241 return ilr.Value == nil || len(*ilr.Value) == 0 3242} 3243 3244// hasNextLink returns true if the NextLink is not empty. 3245func (ilr ImageListResult) hasNextLink() bool { 3246 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 3247} 3248 3249// imageListResultPreparer prepares a request to retrieve the next set of results. 3250// It returns nil if no more results exist. 3251func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 3252 if !ilr.hasNextLink() { 3253 return nil, nil 3254 } 3255 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3256 autorest.AsJSON(), 3257 autorest.AsGet(), 3258 autorest.WithBaseURL(to.String(ilr.NextLink))) 3259} 3260 3261// ImageListResultPage contains a page of Image values. 3262type ImageListResultPage struct { 3263 fn func(context.Context, ImageListResult) (ImageListResult, error) 3264 ilr ImageListResult 3265} 3266 3267// NextWithContext advances to the next page of values. If there was an error making 3268// the request the page does not advance and the error is returned. 3269func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 3270 if tracing.IsEnabled() { 3271 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 3272 defer func() { 3273 sc := -1 3274 if page.Response().Response.Response != nil { 3275 sc = page.Response().Response.Response.StatusCode 3276 } 3277 tracing.EndSpan(ctx, sc, err) 3278 }() 3279 } 3280 for { 3281 next, err := page.fn(ctx, page.ilr) 3282 if err != nil { 3283 return err 3284 } 3285 page.ilr = next 3286 if !next.hasNextLink() || !next.IsEmpty() { 3287 break 3288 } 3289 } 3290 return nil 3291} 3292 3293// Next advances to the next page of values. If there was an error making 3294// the request the page does not advance and the error is returned. 3295// Deprecated: Use NextWithContext() instead. 3296func (page *ImageListResultPage) Next() error { 3297 return page.NextWithContext(context.Background()) 3298} 3299 3300// NotDone returns true if the page enumeration should be started or is not yet complete. 3301func (page ImageListResultPage) NotDone() bool { 3302 return !page.ilr.IsEmpty() 3303} 3304 3305// Response returns the raw server response from the last page request. 3306func (page ImageListResultPage) Response() ImageListResult { 3307 return page.ilr 3308} 3309 3310// Values returns the slice of values for the current page or nil if there are no values. 3311func (page ImageListResultPage) Values() []Image { 3312 if page.ilr.IsEmpty() { 3313 return nil 3314 } 3315 return *page.ilr.Value 3316} 3317 3318// Creates a new instance of the ImageListResultPage type. 3319func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 3320 return ImageListResultPage{ 3321 fn: getNextPage, 3322 ilr: cur, 3323 } 3324} 3325 3326// ImageOSDisk describes an Operating System disk. 3327type ImageOSDisk struct { 3328 // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 3329 OsType OperatingSystemTypes `json:"osType,omitempty"` 3330 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 3331 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 3332 // Snapshot - The snapshot. 3333 Snapshot *SubResource `json:"snapshot,omitempty"` 3334 // ManagedDisk - The managedDisk. 3335 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 3336 // BlobURI - The Virtual Hard Disk. 3337 BlobURI *string `json:"blobUri,omitempty"` 3338 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 3339 Caching CachingTypes `json:"caching,omitempty"` 3340 // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 3341 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3342 // StorageAccountType - Specifies the storage account type for the managed disk. UltraSSD_LRS cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 3343 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 3344} 3345 3346// ImageProperties describes the properties of an Image. 3347type ImageProperties struct { 3348 // SourceVirtualMachine - The source virtual machine from which Image is created. 3349 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 3350 // StorageProfile - Specifies the storage settings for the virtual machine disks. 3351 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 3352 // ProvisioningState - READ-ONLY; The provisioning state. 3353 ProvisioningState *string `json:"provisioningState,omitempty"` 3354} 3355 3356// MarshalJSON is the custom marshaler for ImageProperties. 3357func (IP ImageProperties) MarshalJSON() ([]byte, error) { 3358 objectMap := make(map[string]interface{}) 3359 if IP.SourceVirtualMachine != nil { 3360 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 3361 } 3362 if IP.StorageProfile != nil { 3363 objectMap["storageProfile"] = IP.StorageProfile 3364 } 3365 return json.Marshal(objectMap) 3366} 3367 3368// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace 3369// images. 3370type ImagePurchasePlan struct { 3371 // Name - The plan ID. 3372 Name *string `json:"name,omitempty"` 3373 // Publisher - The publisher ID. 3374 Publisher *string `json:"publisher,omitempty"` 3375 // Product - The product ID. 3376 Product *string `json:"product,omitempty"` 3377} 3378 3379// ImageReference specifies information about the image to use. You can specify information about platform 3380// images, marketplace images, or virtual machine images. This element is required when you want to use a 3381// platform image, marketplace image, or virtual machine image, but is not used in other creation 3382// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 3383type ImageReference struct { 3384 // Publisher - The image publisher. 3385 Publisher *string `json:"publisher,omitempty"` 3386 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 3387 Offer *string `json:"offer,omitempty"` 3388 // Sku - The image SKU. 3389 Sku *string `json:"sku,omitempty"` 3390 // Version - Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. 3391 Version *string `json:"version,omitempty"` 3392 // ID - Resource Id 3393 ID *string `json:"id,omitempty"` 3394} 3395 3396// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3397// operation. 3398type ImagesCreateOrUpdateFuture struct { 3399 azure.FutureAPI 3400 // Result returns the result of the asynchronous operation. 3401 // If the operation has not completed it will return an error. 3402 Result func(ImagesClient) (Image, error) 3403} 3404 3405// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3406func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3407 var azFuture azure.Future 3408 if err := json.Unmarshal(body, &azFuture); err != nil { 3409 return err 3410 } 3411 future.FutureAPI = &azFuture 3412 future.Result = future.result 3413 return nil 3414} 3415 3416// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 3417func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 3418 var done bool 3419 done, err = future.DoneWithContext(context.Background(), client) 3420 if err != nil { 3421 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3422 return 3423 } 3424 if !done { 3425 i.Response.Response = future.Response() 3426 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 3427 return 3428 } 3429 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3430 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 3431 i, err = client.CreateOrUpdateResponder(i.Response.Response) 3432 if err != nil { 3433 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 3434 } 3435 } 3436 return 3437} 3438 3439// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3440type ImagesDeleteFuture struct { 3441 azure.FutureAPI 3442 // Result returns the result of the asynchronous operation. 3443 // If the operation has not completed it will return an error. 3444 Result func(ImagesClient) (autorest.Response, error) 3445} 3446 3447// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3448func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 3449 var azFuture azure.Future 3450 if err := json.Unmarshal(body, &azFuture); err != nil { 3451 return err 3452 } 3453 future.FutureAPI = &azFuture 3454 future.Result = future.result 3455 return nil 3456} 3457 3458// result is the default implementation for ImagesDeleteFuture.Result. 3459func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 3460 var done bool 3461 done, err = future.DoneWithContext(context.Background(), client) 3462 if err != nil { 3463 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 3464 return 3465 } 3466 if !done { 3467 ar.Response = future.Response() 3468 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 3469 return 3470 } 3471 ar.Response = future.Response() 3472 return 3473} 3474 3475// ImageStorageProfile describes a storage profile. 3476type ImageStorageProfile struct { 3477 // OsDisk - Specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 3478 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 3479 // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 3480 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 3481 // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). 3482 ZoneResilient *bool `json:"zoneResilient,omitempty"` 3483} 3484 3485// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3486type ImagesUpdateFuture struct { 3487 azure.FutureAPI 3488 // Result returns the result of the asynchronous operation. 3489 // If the operation has not completed it will return an error. 3490 Result func(ImagesClient) (Image, error) 3491} 3492 3493// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3494func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 3495 var azFuture azure.Future 3496 if err := json.Unmarshal(body, &azFuture); err != nil { 3497 return err 3498 } 3499 future.FutureAPI = &azFuture 3500 future.Result = future.result 3501 return nil 3502} 3503 3504// result is the default implementation for ImagesUpdateFuture.Result. 3505func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 3506 var done bool 3507 done, err = future.DoneWithContext(context.Background(), client) 3508 if err != nil { 3509 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 3510 return 3511 } 3512 if !done { 3513 i.Response.Response = future.Response() 3514 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 3515 return 3516 } 3517 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3518 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 3519 i, err = client.UpdateResponder(i.Response.Response) 3520 if err != nil { 3521 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 3522 } 3523 } 3524 return 3525} 3526 3527// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 3528type ImageUpdate struct { 3529 *ImageProperties `json:"properties,omitempty"` 3530 // Tags - Resource tags 3531 Tags map[string]*string `json:"tags"` 3532} 3533 3534// MarshalJSON is the custom marshaler for ImageUpdate. 3535func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 3536 objectMap := make(map[string]interface{}) 3537 if iu.ImageProperties != nil { 3538 objectMap["properties"] = iu.ImageProperties 3539 } 3540 if iu.Tags != nil { 3541 objectMap["tags"] = iu.Tags 3542 } 3543 return json.Marshal(objectMap) 3544} 3545 3546// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 3547func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 3548 var m map[string]*json.RawMessage 3549 err := json.Unmarshal(body, &m) 3550 if err != nil { 3551 return err 3552 } 3553 for k, v := range m { 3554 switch k { 3555 case "properties": 3556 if v != nil { 3557 var imageProperties ImageProperties 3558 err = json.Unmarshal(*v, &imageProperties) 3559 if err != nil { 3560 return err 3561 } 3562 iu.ImageProperties = &imageProperties 3563 } 3564 case "tags": 3565 if v != nil { 3566 var tags map[string]*string 3567 err = json.Unmarshal(*v, &tags) 3568 if err != nil { 3569 return err 3570 } 3571 iu.Tags = tags 3572 } 3573 } 3574 } 3575 3576 return nil 3577} 3578 3579// InnerError inner error details. 3580type InnerError struct { 3581 // Exceptiontype - The exception type. 3582 Exceptiontype *string `json:"exceptiontype,omitempty"` 3583 // Errordetail - The internal error message or exception dump. 3584 Errordetail *string `json:"errordetail,omitempty"` 3585} 3586 3587// InstanceViewStatus instance view status. 3588type InstanceViewStatus struct { 3589 // Code - The status code. 3590 Code *string `json:"code,omitempty"` 3591 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 3592 Level StatusLevelTypes `json:"level,omitempty"` 3593 // DisplayStatus - The short localizable label for the status. 3594 DisplayStatus *string `json:"displayStatus,omitempty"` 3595 // Message - The detailed status message, including for alerts and error messages. 3596 Message *string `json:"message,omitempty"` 3597 // Time - The time of the status. 3598 Time *date.Time `json:"time,omitempty"` 3599} 3600 3601// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 3602// to unwrap the encryptionKey 3603type KeyVaultAndKeyReference struct { 3604 // SourceVault - Resource id of the KeyVault containing the key or secret 3605 SourceVault *SourceVault `json:"sourceVault,omitempty"` 3606 // KeyURL - Url pointing to a key or secret in KeyVault 3607 KeyURL *string `json:"keyUrl,omitempty"` 3608} 3609 3610// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 3611type KeyVaultAndSecretReference struct { 3612 // SourceVault - Resource id of the KeyVault containing the key or secret 3613 SourceVault *SourceVault `json:"sourceVault,omitempty"` 3614 // SecretURL - Url pointing to a key or secret in KeyVault 3615 SecretURL *string `json:"secretUrl,omitempty"` 3616} 3617 3618// KeyVaultKeyReference describes a reference to Key Vault Key 3619type KeyVaultKeyReference struct { 3620 // KeyURL - The URL referencing a key encryption key in Key Vault. 3621 KeyURL *string `json:"keyUrl,omitempty"` 3622 // SourceVault - The relative URL of the Key Vault containing the key. 3623 SourceVault *SubResource `json:"sourceVault,omitempty"` 3624} 3625 3626// KeyVaultSecretReference describes a reference to Key Vault Secret 3627type KeyVaultSecretReference struct { 3628 // SecretURL - The URL referencing a secret in a Key Vault. 3629 SecretURL *string `json:"secretUrl,omitempty"` 3630 // SourceVault - The relative URL of the Key Vault containing the secret. 3631 SourceVault *SubResource `json:"sourceVault,omitempty"` 3632} 3633 3634// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 3635// list of supported Linux distributions, see [Linux on Azure-Endorsed 3636// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 3637// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 3638// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 3639type LinuxConfiguration struct { 3640 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 3641 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 3642 // SSH - Specifies the ssh key configuration for a Linux OS. 3643 SSH *SSHConfiguration `json:"ssh,omitempty"` 3644 // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine. <br><br> When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. 3645 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 3646} 3647 3648// ListUsagesResult the List Usages operation response. 3649type ListUsagesResult struct { 3650 autorest.Response `json:"-"` 3651 // Value - The list of compute resource usages. 3652 Value *[]Usage `json:"value,omitempty"` 3653 // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information. 3654 NextLink *string `json:"nextLink,omitempty"` 3655} 3656 3657// ListUsagesResultIterator provides access to a complete listing of Usage values. 3658type ListUsagesResultIterator struct { 3659 i int 3660 page ListUsagesResultPage 3661} 3662 3663// NextWithContext advances to the next value. If there was an error making 3664// the request the iterator does not advance and the error is returned. 3665func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 3666 if tracing.IsEnabled() { 3667 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 3668 defer func() { 3669 sc := -1 3670 if iter.Response().Response.Response != nil { 3671 sc = iter.Response().Response.Response.StatusCode 3672 } 3673 tracing.EndSpan(ctx, sc, err) 3674 }() 3675 } 3676 iter.i++ 3677 if iter.i < len(iter.page.Values()) { 3678 return nil 3679 } 3680 err = iter.page.NextWithContext(ctx) 3681 if err != nil { 3682 iter.i-- 3683 return err 3684 } 3685 iter.i = 0 3686 return nil 3687} 3688 3689// Next advances to the next value. If there was an error making 3690// the request the iterator does not advance and the error is returned. 3691// Deprecated: Use NextWithContext() instead. 3692func (iter *ListUsagesResultIterator) Next() error { 3693 return iter.NextWithContext(context.Background()) 3694} 3695 3696// NotDone returns true if the enumeration should be started or is not yet complete. 3697func (iter ListUsagesResultIterator) NotDone() bool { 3698 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3699} 3700 3701// Response returns the raw server response from the last page request. 3702func (iter ListUsagesResultIterator) Response() ListUsagesResult { 3703 return iter.page.Response() 3704} 3705 3706// Value returns the current value or a zero-initialized value if the 3707// iterator has advanced beyond the end of the collection. 3708func (iter ListUsagesResultIterator) Value() Usage { 3709 if !iter.page.NotDone() { 3710 return Usage{} 3711 } 3712 return iter.page.Values()[iter.i] 3713} 3714 3715// Creates a new instance of the ListUsagesResultIterator type. 3716func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 3717 return ListUsagesResultIterator{page: page} 3718} 3719 3720// IsEmpty returns true if the ListResult contains no values. 3721func (lur ListUsagesResult) IsEmpty() bool { 3722 return lur.Value == nil || len(*lur.Value) == 0 3723} 3724 3725// hasNextLink returns true if the NextLink is not empty. 3726func (lur ListUsagesResult) hasNextLink() bool { 3727 return lur.NextLink != nil && len(*lur.NextLink) != 0 3728} 3729 3730// listUsagesResultPreparer prepares a request to retrieve the next set of results. 3731// It returns nil if no more results exist. 3732func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 3733 if !lur.hasNextLink() { 3734 return nil, nil 3735 } 3736 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3737 autorest.AsJSON(), 3738 autorest.AsGet(), 3739 autorest.WithBaseURL(to.String(lur.NextLink))) 3740} 3741 3742// ListUsagesResultPage contains a page of Usage values. 3743type ListUsagesResultPage struct { 3744 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 3745 lur ListUsagesResult 3746} 3747 3748// NextWithContext advances to the next page of values. If there was an error making 3749// the request the page does not advance and the error is returned. 3750func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 3751 if tracing.IsEnabled() { 3752 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 3753 defer func() { 3754 sc := -1 3755 if page.Response().Response.Response != nil { 3756 sc = page.Response().Response.Response.StatusCode 3757 } 3758 tracing.EndSpan(ctx, sc, err) 3759 }() 3760 } 3761 for { 3762 next, err := page.fn(ctx, page.lur) 3763 if err != nil { 3764 return err 3765 } 3766 page.lur = next 3767 if !next.hasNextLink() || !next.IsEmpty() { 3768 break 3769 } 3770 } 3771 return nil 3772} 3773 3774// Next advances to the next page of values. If there was an error making 3775// the request the page does not advance and the error is returned. 3776// Deprecated: Use NextWithContext() instead. 3777func (page *ListUsagesResultPage) Next() error { 3778 return page.NextWithContext(context.Background()) 3779} 3780 3781// NotDone returns true if the page enumeration should be started or is not yet complete. 3782func (page ListUsagesResultPage) NotDone() bool { 3783 return !page.lur.IsEmpty() 3784} 3785 3786// Response returns the raw server response from the last page request. 3787func (page ListUsagesResultPage) Response() ListUsagesResult { 3788 return page.lur 3789} 3790 3791// Values returns the slice of values for the current page or nil if there are no values. 3792func (page ListUsagesResultPage) Values() []Usage { 3793 if page.lur.IsEmpty() { 3794 return nil 3795 } 3796 return *page.lur.Value 3797} 3798 3799// Creates a new instance of the ListUsagesResultPage type. 3800func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 3801 return ListUsagesResultPage{ 3802 fn: getNextPage, 3803 lur: cur, 3804 } 3805} 3806 3807// ListVirtualMachineExtensionImage ... 3808type ListVirtualMachineExtensionImage struct { 3809 autorest.Response `json:"-"` 3810 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 3811} 3812 3813// ListVirtualMachineImageResource ... 3814type ListVirtualMachineImageResource struct { 3815 autorest.Response `json:"-"` 3816 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 3817} 3818 3819// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 3820// of a long-running operation. 3821type LogAnalyticsExportRequestRateByIntervalFuture struct { 3822 azure.FutureAPI 3823 // Result returns the result of the asynchronous operation. 3824 // If the operation has not completed it will return an error. 3825 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 3826} 3827 3828// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3829func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 3830 var azFuture azure.Future 3831 if err := json.Unmarshal(body, &azFuture); err != nil { 3832 return err 3833 } 3834 future.FutureAPI = &azFuture 3835 future.Result = future.result 3836 return nil 3837} 3838 3839// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 3840func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 3841 var done bool 3842 done, err = future.DoneWithContext(context.Background(), client) 3843 if err != nil { 3844 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 3845 return 3846 } 3847 if !done { 3848 laor.Response.Response = future.Response() 3849 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 3850 return 3851 } 3852 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3853 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 3854 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 3855 if err != nil { 3856 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 3857 } 3858 } 3859 return 3860} 3861 3862// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 3863// long-running operation. 3864type LogAnalyticsExportThrottledRequestsFuture struct { 3865 azure.FutureAPI 3866 // Result returns the result of the asynchronous operation. 3867 // If the operation has not completed it will return an error. 3868 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 3869} 3870 3871// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3872func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 3873 var azFuture azure.Future 3874 if err := json.Unmarshal(body, &azFuture); err != nil { 3875 return err 3876 } 3877 future.FutureAPI = &azFuture 3878 future.Result = future.result 3879 return nil 3880} 3881 3882// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 3883func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 3884 var done bool 3885 done, err = future.DoneWithContext(context.Background(), client) 3886 if err != nil { 3887 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 3888 return 3889 } 3890 if !done { 3891 laor.Response.Response = future.Response() 3892 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 3893 return 3894 } 3895 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3896 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 3897 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 3898 if err != nil { 3899 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 3900 } 3901 } 3902 return 3903} 3904 3905// LogAnalyticsInputBase api input base class for LogAnalytics Api. 3906type LogAnalyticsInputBase struct { 3907 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 3908 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 3909 // FromTime - From time of the query 3910 FromTime *date.Time `json:"fromTime,omitempty"` 3911 // ToTime - To time of the query 3912 ToTime *date.Time `json:"toTime,omitempty"` 3913 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 3914 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 3915 // GroupByOperationName - Group query result by Operation Name. 3916 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 3917 // GroupByResourceName - Group query result by Resource Name. 3918 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 3919} 3920 3921// LogAnalyticsOperationResult logAnalytics operation status response 3922type LogAnalyticsOperationResult struct { 3923 autorest.Response `json:"-"` 3924 // Properties - READ-ONLY; LogAnalyticsOutput 3925 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 3926} 3927 3928// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. 3929func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { 3930 objectMap := make(map[string]interface{}) 3931 return json.Marshal(objectMap) 3932} 3933 3934// LogAnalyticsOutput logAnalytics output properties 3935type LogAnalyticsOutput struct { 3936 // Output - READ-ONLY; Output file Uri path to blob container. 3937 Output *string `json:"output,omitempty"` 3938} 3939 3940// MarshalJSON is the custom marshaler for LogAnalyticsOutput. 3941func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { 3942 objectMap := make(map[string]interface{}) 3943 return json.Marshal(objectMap) 3944} 3945 3946// MaintenanceRedeployStatus maintenance Operation Status. 3947type MaintenanceRedeployStatus struct { 3948 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 3949 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 3950 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 3951 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 3952 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 3953 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 3954 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 3955 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 3956 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 3957 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 3958 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 3959 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 3960 // LastOperationMessage - Message returned for the last Maintenance Operation. 3961 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 3962} 3963 3964// ManagedArtifact the managed artifact. 3965type ManagedArtifact struct { 3966 // ID - The managed artifact id. 3967 ID *string `json:"id,omitempty"` 3968} 3969 3970// ManagedDiskParameters the parameters of a managed disk. 3971type ManagedDiskParameters struct { 3972 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 3973 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 3974 // ID - Resource Id 3975 ID *string `json:"id,omitempty"` 3976} 3977 3978// NetworkInterfaceReference describes a network interface reference. 3979type NetworkInterfaceReference struct { 3980 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 3981 // ID - Resource Id 3982 ID *string `json:"id,omitempty"` 3983} 3984 3985// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 3986func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 3987 objectMap := make(map[string]interface{}) 3988 if nir.NetworkInterfaceReferenceProperties != nil { 3989 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 3990 } 3991 if nir.ID != nil { 3992 objectMap["id"] = nir.ID 3993 } 3994 return json.Marshal(objectMap) 3995} 3996 3997// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 3998func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 3999 var m map[string]*json.RawMessage 4000 err := json.Unmarshal(body, &m) 4001 if err != nil { 4002 return err 4003 } 4004 for k, v := range m { 4005 switch k { 4006 case "properties": 4007 if v != nil { 4008 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 4009 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 4010 if err != nil { 4011 return err 4012 } 4013 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 4014 } 4015 case "id": 4016 if v != nil { 4017 var ID string 4018 err = json.Unmarshal(*v, &ID) 4019 if err != nil { 4020 return err 4021 } 4022 nir.ID = &ID 4023 } 4024 } 4025 } 4026 4027 return nil 4028} 4029 4030// NetworkInterfaceReferenceProperties describes a network interface reference properties. 4031type NetworkInterfaceReferenceProperties struct { 4032 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 4033 Primary *bool `json:"primary,omitempty"` 4034} 4035 4036// NetworkProfile specifies the network interfaces of the virtual machine. 4037type NetworkProfile struct { 4038 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 4039 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 4040} 4041 4042// OperationListResult the List Compute Operation operation response. 4043type OperationListResult struct { 4044 autorest.Response `json:"-"` 4045 // Value - READ-ONLY; The list of compute operations 4046 Value *[]OperationValue `json:"value,omitempty"` 4047} 4048 4049// MarshalJSON is the custom marshaler for OperationListResult. 4050func (olr OperationListResult) MarshalJSON() ([]byte, error) { 4051 objectMap := make(map[string]interface{}) 4052 return json.Marshal(objectMap) 4053} 4054 4055// OperationValue describes the properties of a Compute Operation value. 4056type OperationValue struct { 4057 // Origin - READ-ONLY; The origin of the compute operation. 4058 Origin *string `json:"origin,omitempty"` 4059 // Name - READ-ONLY; The name of the compute operation. 4060 Name *string `json:"name,omitempty"` 4061 *OperationValueDisplay `json:"display,omitempty"` 4062} 4063 4064// MarshalJSON is the custom marshaler for OperationValue. 4065func (ov OperationValue) MarshalJSON() ([]byte, error) { 4066 objectMap := make(map[string]interface{}) 4067 if ov.OperationValueDisplay != nil { 4068 objectMap["display"] = ov.OperationValueDisplay 4069 } 4070 return json.Marshal(objectMap) 4071} 4072 4073// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 4074func (ov *OperationValue) UnmarshalJSON(body []byte) error { 4075 var m map[string]*json.RawMessage 4076 err := json.Unmarshal(body, &m) 4077 if err != nil { 4078 return err 4079 } 4080 for k, v := range m { 4081 switch k { 4082 case "origin": 4083 if v != nil { 4084 var origin string 4085 err = json.Unmarshal(*v, &origin) 4086 if err != nil { 4087 return err 4088 } 4089 ov.Origin = &origin 4090 } 4091 case "name": 4092 if v != nil { 4093 var name string 4094 err = json.Unmarshal(*v, &name) 4095 if err != nil { 4096 return err 4097 } 4098 ov.Name = &name 4099 } 4100 case "display": 4101 if v != nil { 4102 var operationValueDisplay OperationValueDisplay 4103 err = json.Unmarshal(*v, &operationValueDisplay) 4104 if err != nil { 4105 return err 4106 } 4107 ov.OperationValueDisplay = &operationValueDisplay 4108 } 4109 } 4110 } 4111 4112 return nil 4113} 4114 4115// OperationValueDisplay describes the properties of a Compute Operation Value Display. 4116type OperationValueDisplay struct { 4117 // Operation - READ-ONLY; The display name of the compute operation. 4118 Operation *string `json:"operation,omitempty"` 4119 // Resource - READ-ONLY; The display name of the resource the operation applies to. 4120 Resource *string `json:"resource,omitempty"` 4121 // Description - READ-ONLY; The description of the operation. 4122 Description *string `json:"description,omitempty"` 4123 // Provider - READ-ONLY; The resource provider for the operation. 4124 Provider *string `json:"provider,omitempty"` 4125} 4126 4127// MarshalJSON is the custom marshaler for OperationValueDisplay. 4128func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 4129 objectMap := make(map[string]interface{}) 4130 return json.Marshal(objectMap) 4131} 4132 4133// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 4134// more information about disks, see [About disks and VHDs for Azure virtual 4135// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 4136type OSDisk struct { 4137 // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 4138 OsType OperatingSystemTypes `json:"osType,omitempty"` 4139 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 4140 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 4141 // Name - The disk name. 4142 Name *string `json:"name,omitempty"` 4143 // Vhd - The virtual hard disk. 4144 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 4145 // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. 4146 Image *VirtualHardDisk `json:"image,omitempty"` 4147 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 4148 Caching CachingTypes `json:"caching,omitempty"` 4149 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 4150 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 4151 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 4152 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 4153 // CreateOption - Specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 4154 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 4155 // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 4156 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 4157 // ManagedDisk - The managed disk parameters. 4158 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 4159} 4160 4161// OSDiskImage contains the os disk image information. 4162type OSDiskImage struct { 4163 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 4164 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 4165} 4166 4167// OSProfile specifies the operating system settings for the virtual machine. 4168type OSProfile struct { 4169 // ComputerName - Specifies the host OS name of the virtual machine. <br><br> This name cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). 4170 ComputerName *string `json:"computerName,omitempty"` 4171 // AdminUsername - Specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 4172 AdminUsername *string `json:"adminUsername,omitempty"` 4173 // AdminPassword - Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) 4174 AdminPassword *string `json:"adminPassword,omitempty"` 4175 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 4176 CustomData *string `json:"customData,omitempty"` 4177 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 4178 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 4179 // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 4180 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 4181 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 4182 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 4183 // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual machine. 4184 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 4185} 4186 4187// Plan specifies information about the marketplace image used to create the virtual machine. This element 4188// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 4189// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 4190// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 4191// then click **Save**. 4192type Plan struct { 4193 // Name - The plan ID. 4194 Name *string `json:"name,omitempty"` 4195 // Publisher - The publisher ID. 4196 Publisher *string `json:"publisher,omitempty"` 4197 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 4198 Product *string `json:"product,omitempty"` 4199 // PromotionCode - The promotion code. 4200 PromotionCode *string `json:"promotionCode,omitempty"` 4201} 4202 4203// ProximityPlacementGroup specifies information about the proximity placement group. 4204type ProximityPlacementGroup struct { 4205 autorest.Response `json:"-"` 4206 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 4207 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 4208 // ID - READ-ONLY; Resource Id 4209 ID *string `json:"id,omitempty"` 4210 // Name - READ-ONLY; Resource name 4211 Name *string `json:"name,omitempty"` 4212 // Type - READ-ONLY; Resource type 4213 Type *string `json:"type,omitempty"` 4214 // Location - Resource location 4215 Location *string `json:"location,omitempty"` 4216 // Tags - Resource tags 4217 Tags map[string]*string `json:"tags"` 4218} 4219 4220// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 4221func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 4222 objectMap := make(map[string]interface{}) 4223 if ppg.ProximityPlacementGroupProperties != nil { 4224 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 4225 } 4226 if ppg.Location != nil { 4227 objectMap["location"] = ppg.Location 4228 } 4229 if ppg.Tags != nil { 4230 objectMap["tags"] = ppg.Tags 4231 } 4232 return json.Marshal(objectMap) 4233} 4234 4235// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 4236func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 4237 var m map[string]*json.RawMessage 4238 err := json.Unmarshal(body, &m) 4239 if err != nil { 4240 return err 4241 } 4242 for k, v := range m { 4243 switch k { 4244 case "properties": 4245 if v != nil { 4246 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 4247 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 4248 if err != nil { 4249 return err 4250 } 4251 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 4252 } 4253 case "id": 4254 if v != nil { 4255 var ID string 4256 err = json.Unmarshal(*v, &ID) 4257 if err != nil { 4258 return err 4259 } 4260 ppg.ID = &ID 4261 } 4262 case "name": 4263 if v != nil { 4264 var name string 4265 err = json.Unmarshal(*v, &name) 4266 if err != nil { 4267 return err 4268 } 4269 ppg.Name = &name 4270 } 4271 case "type": 4272 if v != nil { 4273 var typeVar string 4274 err = json.Unmarshal(*v, &typeVar) 4275 if err != nil { 4276 return err 4277 } 4278 ppg.Type = &typeVar 4279 } 4280 case "location": 4281 if v != nil { 4282 var location string 4283 err = json.Unmarshal(*v, &location) 4284 if err != nil { 4285 return err 4286 } 4287 ppg.Location = &location 4288 } 4289 case "tags": 4290 if v != nil { 4291 var tags map[string]*string 4292 err = json.Unmarshal(*v, &tags) 4293 if err != nil { 4294 return err 4295 } 4296 ppg.Tags = tags 4297 } 4298 } 4299 } 4300 4301 return nil 4302} 4303 4304// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 4305type ProximityPlacementGroupListResult struct { 4306 autorest.Response `json:"-"` 4307 // Value - The list of proximity placement groups 4308 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 4309 // NextLink - The URI to fetch the next page of proximity placement groups. 4310 NextLink *string `json:"nextLink,omitempty"` 4311} 4312 4313// ProximityPlacementGroupListResultIterator provides access to a complete listing of 4314// ProximityPlacementGroup values. 4315type ProximityPlacementGroupListResultIterator struct { 4316 i int 4317 page ProximityPlacementGroupListResultPage 4318} 4319 4320// NextWithContext advances to the next value. If there was an error making 4321// the request the iterator does not advance and the error is returned. 4322func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 4323 if tracing.IsEnabled() { 4324 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 4325 defer func() { 4326 sc := -1 4327 if iter.Response().Response.Response != nil { 4328 sc = iter.Response().Response.Response.StatusCode 4329 } 4330 tracing.EndSpan(ctx, sc, err) 4331 }() 4332 } 4333 iter.i++ 4334 if iter.i < len(iter.page.Values()) { 4335 return nil 4336 } 4337 err = iter.page.NextWithContext(ctx) 4338 if err != nil { 4339 iter.i-- 4340 return err 4341 } 4342 iter.i = 0 4343 return nil 4344} 4345 4346// Next advances to the next value. If there was an error making 4347// the request the iterator does not advance and the error is returned. 4348// Deprecated: Use NextWithContext() instead. 4349func (iter *ProximityPlacementGroupListResultIterator) Next() error { 4350 return iter.NextWithContext(context.Background()) 4351} 4352 4353// NotDone returns true if the enumeration should be started or is not yet complete. 4354func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 4355 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4356} 4357 4358// Response returns the raw server response from the last page request. 4359func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 4360 return iter.page.Response() 4361} 4362 4363// Value returns the current value or a zero-initialized value if the 4364// iterator has advanced beyond the end of the collection. 4365func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 4366 if !iter.page.NotDone() { 4367 return ProximityPlacementGroup{} 4368 } 4369 return iter.page.Values()[iter.i] 4370} 4371 4372// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 4373func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 4374 return ProximityPlacementGroupListResultIterator{page: page} 4375} 4376 4377// IsEmpty returns true if the ListResult contains no values. 4378func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 4379 return ppglr.Value == nil || len(*ppglr.Value) == 0 4380} 4381 4382// hasNextLink returns true if the NextLink is not empty. 4383func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 4384 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 4385} 4386 4387// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 4388// It returns nil if no more results exist. 4389func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 4390 if !ppglr.hasNextLink() { 4391 return nil, nil 4392 } 4393 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4394 autorest.AsJSON(), 4395 autorest.AsGet(), 4396 autorest.WithBaseURL(to.String(ppglr.NextLink))) 4397} 4398 4399// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 4400type ProximityPlacementGroupListResultPage struct { 4401 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 4402 ppglr ProximityPlacementGroupListResult 4403} 4404 4405// NextWithContext advances to the next page of values. If there was an error making 4406// the request the page does not advance and the error is returned. 4407func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 4408 if tracing.IsEnabled() { 4409 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 4410 defer func() { 4411 sc := -1 4412 if page.Response().Response.Response != nil { 4413 sc = page.Response().Response.Response.StatusCode 4414 } 4415 tracing.EndSpan(ctx, sc, err) 4416 }() 4417 } 4418 for { 4419 next, err := page.fn(ctx, page.ppglr) 4420 if err != nil { 4421 return err 4422 } 4423 page.ppglr = next 4424 if !next.hasNextLink() || !next.IsEmpty() { 4425 break 4426 } 4427 } 4428 return nil 4429} 4430 4431// Next advances to the next page of values. If there was an error making 4432// the request the page does not advance and the error is returned. 4433// Deprecated: Use NextWithContext() instead. 4434func (page *ProximityPlacementGroupListResultPage) Next() error { 4435 return page.NextWithContext(context.Background()) 4436} 4437 4438// NotDone returns true if the page enumeration should be started or is not yet complete. 4439func (page ProximityPlacementGroupListResultPage) NotDone() bool { 4440 return !page.ppglr.IsEmpty() 4441} 4442 4443// Response returns the raw server response from the last page request. 4444func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 4445 return page.ppglr 4446} 4447 4448// Values returns the slice of values for the current page or nil if there are no values. 4449func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 4450 if page.ppglr.IsEmpty() { 4451 return nil 4452 } 4453 return *page.ppglr.Value 4454} 4455 4456// Creates a new instance of the ProximityPlacementGroupListResultPage type. 4457func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 4458 return ProximityPlacementGroupListResultPage{ 4459 fn: getNextPage, 4460 ppglr: cur, 4461 } 4462} 4463 4464// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 4465type ProximityPlacementGroupProperties struct { 4466 // ProximityPlacementGroupType - Specifies the type of the proximity placement group. <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure region or Availability Zone. <br><br> **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' 4467 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 4468 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 4469 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 4470 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 4471 VirtualMachineScaleSets *[]SubResource `json:"virtualMachineScaleSets,omitempty"` 4472 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 4473 AvailabilitySets *[]SubResource `json:"availabilitySets,omitempty"` 4474} 4475 4476// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 4477func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 4478 objectMap := make(map[string]interface{}) 4479 if ppgp.ProximityPlacementGroupType != "" { 4480 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 4481 } 4482 return json.Marshal(objectMap) 4483} 4484 4485// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 4486type ProximityPlacementGroupUpdate struct { 4487 // Tags - Resource tags 4488 Tags map[string]*string `json:"tags"` 4489} 4490 4491// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 4492func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 4493 objectMap := make(map[string]interface{}) 4494 if ppgu.Tags != nil { 4495 objectMap["tags"] = ppgu.Tags 4496 } 4497 return json.Marshal(objectMap) 4498} 4499 4500// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 4501type PurchasePlan struct { 4502 // Publisher - The publisher ID. 4503 Publisher *string `json:"publisher,omitempty"` 4504 // Name - The plan ID. 4505 Name *string `json:"name,omitempty"` 4506 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 4507 Product *string `json:"product,omitempty"` 4508} 4509 4510// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 4511// Image Definition. These properties are updatable. 4512type RecommendedMachineConfiguration struct { 4513 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 4514 Memory *ResourceRange `json:"memory,omitempty"` 4515} 4516 4517// RecoveryWalkResponse response after calling a manual recovery walk 4518type RecoveryWalkResponse struct { 4519 autorest.Response `json:"-"` 4520 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 4521 WalkPerformed *bool `json:"walkPerformed,omitempty"` 4522 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 4523 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 4524} 4525 4526// MarshalJSON is the custom marshaler for RecoveryWalkResponse. 4527func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { 4528 objectMap := make(map[string]interface{}) 4529 return json.Marshal(objectMap) 4530} 4531 4532// RegionalReplicationStatus this is the regional replication status. 4533type RegionalReplicationStatus struct { 4534 // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. 4535 Region *string `json:"region,omitempty"` 4536 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 4537 State ReplicationState `json:"state,omitempty"` 4538 // Details - READ-ONLY; The details of the replication status. 4539 Details *string `json:"details,omitempty"` 4540 // Progress - READ-ONLY; It indicates progress of the replication job. 4541 Progress *int32 `json:"progress,omitempty"` 4542} 4543 4544// MarshalJSON is the custom marshaler for RegionalReplicationStatus. 4545func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { 4546 objectMap := make(map[string]interface{}) 4547 return json.Marshal(objectMap) 4548} 4549 4550// ReplicationStatus this is the replication status of the gallery Image Version. 4551type ReplicationStatus struct { 4552 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' 4553 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 4554 // Summary - READ-ONLY; This is a summary of replication status for each region. 4555 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 4556} 4557 4558// MarshalJSON is the custom marshaler for ReplicationStatus. 4559func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { 4560 objectMap := make(map[string]interface{}) 4561 return json.Marshal(objectMap) 4562} 4563 4564// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 4565type RequestRateByIntervalInput struct { 4566 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 4567 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 4568 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 4569 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 4570 // FromTime - From time of the query 4571 FromTime *date.Time `json:"fromTime,omitempty"` 4572 // ToTime - To time of the query 4573 ToTime *date.Time `json:"toTime,omitempty"` 4574 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 4575 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 4576 // GroupByOperationName - Group query result by Operation Name. 4577 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 4578 // GroupByResourceName - Group query result by Resource Name. 4579 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 4580} 4581 4582// Resource the Resource model definition. 4583type Resource struct { 4584 // ID - READ-ONLY; Resource Id 4585 ID *string `json:"id,omitempty"` 4586 // Name - READ-ONLY; Resource name 4587 Name *string `json:"name,omitempty"` 4588 // Type - READ-ONLY; Resource type 4589 Type *string `json:"type,omitempty"` 4590 // Location - Resource location 4591 Location *string `json:"location,omitempty"` 4592 // Tags - Resource tags 4593 Tags map[string]*string `json:"tags"` 4594} 4595 4596// MarshalJSON is the custom marshaler for Resource. 4597func (r Resource) MarshalJSON() ([]byte, error) { 4598 objectMap := make(map[string]interface{}) 4599 if r.Location != nil { 4600 objectMap["location"] = r.Location 4601 } 4602 if r.Tags != nil { 4603 objectMap["tags"] = r.Tags 4604 } 4605 return json.Marshal(objectMap) 4606} 4607 4608// ResourceRange describes the resource range. 4609type ResourceRange struct { 4610 // Min - The minimum number of the resource. 4611 Min *int32 `json:"min,omitempty"` 4612 // Max - The maximum number of the resource. 4613 Max *int32 `json:"max,omitempty"` 4614} 4615 4616// ResourceSku describes an available Compute SKU. 4617type ResourceSku struct { 4618 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 4619 ResourceType *string `json:"resourceType,omitempty"` 4620 // Name - READ-ONLY; The name of SKU. 4621 Name *string `json:"name,omitempty"` 4622 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 4623 Tier *string `json:"tier,omitempty"` 4624 // Size - READ-ONLY; The Size of the SKU. 4625 Size *string `json:"size,omitempty"` 4626 // Family - READ-ONLY; The Family of this particular SKU. 4627 Family *string `json:"family,omitempty"` 4628 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 4629 Kind *string `json:"kind,omitempty"` 4630 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 4631 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 4632 // Locations - READ-ONLY; The set of locations that the SKU is available. 4633 Locations *[]string `json:"locations,omitempty"` 4634 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 4635 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 4636 // APIVersions - READ-ONLY; The api versions that support this SKU. 4637 APIVersions *[]string `json:"apiVersions,omitempty"` 4638 // Costs - READ-ONLY; Metadata for retrieving price info. 4639 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 4640 // Capabilities - READ-ONLY; A name value pair to describe the capability. 4641 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 4642 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 4643 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 4644} 4645 4646// MarshalJSON is the custom marshaler for ResourceSku. 4647func (rs ResourceSku) MarshalJSON() ([]byte, error) { 4648 objectMap := make(map[string]interface{}) 4649 return json.Marshal(objectMap) 4650} 4651 4652// ResourceSkuCapabilities describes The SKU capabilities object. 4653type ResourceSkuCapabilities struct { 4654 // Name - READ-ONLY; An invariant to describe the feature. 4655 Name *string `json:"name,omitempty"` 4656 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 4657 Value *string `json:"value,omitempty"` 4658} 4659 4660// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. 4661func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { 4662 objectMap := make(map[string]interface{}) 4663 return json.Marshal(objectMap) 4664} 4665 4666// ResourceSkuCapacity describes scaling information of a SKU. 4667type ResourceSkuCapacity struct { 4668 // Minimum - READ-ONLY; The minimum capacity. 4669 Minimum *int64 `json:"minimum,omitempty"` 4670 // Maximum - READ-ONLY; The maximum capacity that can be set. 4671 Maximum *int64 `json:"maximum,omitempty"` 4672 // Default - READ-ONLY; The default capacity. 4673 Default *int64 `json:"default,omitempty"` 4674 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 4675 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 4676} 4677 4678// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 4679func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 4680 objectMap := make(map[string]interface{}) 4681 return json.Marshal(objectMap) 4682} 4683 4684// ResourceSkuCosts describes metadata for retrieving price info. 4685type ResourceSkuCosts struct { 4686 // MeterID - READ-ONLY; Used for querying price from commerce. 4687 MeterID *string `json:"meterID,omitempty"` 4688 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 4689 Quantity *int64 `json:"quantity,omitempty"` 4690 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 4691 ExtendedUnit *string `json:"extendedUnit,omitempty"` 4692} 4693 4694// MarshalJSON is the custom marshaler for ResourceSkuCosts. 4695func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { 4696 objectMap := make(map[string]interface{}) 4697 return json.Marshal(objectMap) 4698} 4699 4700// ResourceSkuLocationInfo ... 4701type ResourceSkuLocationInfo struct { 4702 // Location - READ-ONLY; Location of the SKU 4703 Location *string `json:"location,omitempty"` 4704 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 4705 Zones *[]string `json:"zones,omitempty"` 4706} 4707 4708// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. 4709func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { 4710 objectMap := make(map[string]interface{}) 4711 return json.Marshal(objectMap) 4712} 4713 4714// ResourceSkuRestrictionInfo ... 4715type ResourceSkuRestrictionInfo struct { 4716 // Locations - READ-ONLY; Locations where the SKU is restricted 4717 Locations *[]string `json:"locations,omitempty"` 4718 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 4719 Zones *[]string `json:"zones,omitempty"` 4720} 4721 4722// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. 4723func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { 4724 objectMap := make(map[string]interface{}) 4725 return json.Marshal(objectMap) 4726} 4727 4728// ResourceSkuRestrictions describes scaling information of a SKU. 4729type ResourceSkuRestrictions struct { 4730 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 4731 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 4732 // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. 4733 Values *[]string `json:"values,omitempty"` 4734 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 4735 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 4736 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 4737 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 4738} 4739 4740// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. 4741func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { 4742 objectMap := make(map[string]interface{}) 4743 return json.Marshal(objectMap) 4744} 4745 4746// ResourceSkusResult the List Resource Skus operation response. 4747type ResourceSkusResult struct { 4748 autorest.Response `json:"-"` 4749 // Value - The list of skus available for the subscription. 4750 Value *[]ResourceSku `json:"value,omitempty"` 4751 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 4752 NextLink *string `json:"nextLink,omitempty"` 4753} 4754 4755// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 4756type ResourceSkusResultIterator struct { 4757 i int 4758 page ResourceSkusResultPage 4759} 4760 4761// NextWithContext advances to the next value. If there was an error making 4762// the request the iterator does not advance and the error is returned. 4763func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 4764 if tracing.IsEnabled() { 4765 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 4766 defer func() { 4767 sc := -1 4768 if iter.Response().Response.Response != nil { 4769 sc = iter.Response().Response.Response.StatusCode 4770 } 4771 tracing.EndSpan(ctx, sc, err) 4772 }() 4773 } 4774 iter.i++ 4775 if iter.i < len(iter.page.Values()) { 4776 return nil 4777 } 4778 err = iter.page.NextWithContext(ctx) 4779 if err != nil { 4780 iter.i-- 4781 return err 4782 } 4783 iter.i = 0 4784 return nil 4785} 4786 4787// Next advances to the next value. If there was an error making 4788// the request the iterator does not advance and the error is returned. 4789// Deprecated: Use NextWithContext() instead. 4790func (iter *ResourceSkusResultIterator) Next() error { 4791 return iter.NextWithContext(context.Background()) 4792} 4793 4794// NotDone returns true if the enumeration should be started or is not yet complete. 4795func (iter ResourceSkusResultIterator) NotDone() bool { 4796 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4797} 4798 4799// Response returns the raw server response from the last page request. 4800func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 4801 return iter.page.Response() 4802} 4803 4804// Value returns the current value or a zero-initialized value if the 4805// iterator has advanced beyond the end of the collection. 4806func (iter ResourceSkusResultIterator) Value() ResourceSku { 4807 if !iter.page.NotDone() { 4808 return ResourceSku{} 4809 } 4810 return iter.page.Values()[iter.i] 4811} 4812 4813// Creates a new instance of the ResourceSkusResultIterator type. 4814func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 4815 return ResourceSkusResultIterator{page: page} 4816} 4817 4818// IsEmpty returns true if the ListResult contains no values. 4819func (rsr ResourceSkusResult) IsEmpty() bool { 4820 return rsr.Value == nil || len(*rsr.Value) == 0 4821} 4822 4823// hasNextLink returns true if the NextLink is not empty. 4824func (rsr ResourceSkusResult) hasNextLink() bool { 4825 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 4826} 4827 4828// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 4829// It returns nil if no more results exist. 4830func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 4831 if !rsr.hasNextLink() { 4832 return nil, nil 4833 } 4834 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4835 autorest.AsJSON(), 4836 autorest.AsGet(), 4837 autorest.WithBaseURL(to.String(rsr.NextLink))) 4838} 4839 4840// ResourceSkusResultPage contains a page of ResourceSku values. 4841type ResourceSkusResultPage struct { 4842 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 4843 rsr ResourceSkusResult 4844} 4845 4846// NextWithContext advances to the next page of values. If there was an error making 4847// the request the page does not advance and the error is returned. 4848func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 4849 if tracing.IsEnabled() { 4850 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 4851 defer func() { 4852 sc := -1 4853 if page.Response().Response.Response != nil { 4854 sc = page.Response().Response.Response.StatusCode 4855 } 4856 tracing.EndSpan(ctx, sc, err) 4857 }() 4858 } 4859 for { 4860 next, err := page.fn(ctx, page.rsr) 4861 if err != nil { 4862 return err 4863 } 4864 page.rsr = next 4865 if !next.hasNextLink() || !next.IsEmpty() { 4866 break 4867 } 4868 } 4869 return nil 4870} 4871 4872// Next advances to the next page of values. If there was an error making 4873// the request the page does not advance and the error is returned. 4874// Deprecated: Use NextWithContext() instead. 4875func (page *ResourceSkusResultPage) Next() error { 4876 return page.NextWithContext(context.Background()) 4877} 4878 4879// NotDone returns true if the page enumeration should be started or is not yet complete. 4880func (page ResourceSkusResultPage) NotDone() bool { 4881 return !page.rsr.IsEmpty() 4882} 4883 4884// Response returns the raw server response from the last page request. 4885func (page ResourceSkusResultPage) Response() ResourceSkusResult { 4886 return page.rsr 4887} 4888 4889// Values returns the slice of values for the current page or nil if there are no values. 4890func (page ResourceSkusResultPage) Values() []ResourceSku { 4891 if page.rsr.IsEmpty() { 4892 return nil 4893 } 4894 return *page.rsr.Value 4895} 4896 4897// Creates a new instance of the ResourceSkusResultPage type. 4898func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 4899 return ResourceSkusResultPage{ 4900 fn: getNextPage, 4901 rsr: cur, 4902 } 4903} 4904 4905// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 4906type RollbackStatusInfo struct { 4907 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 4908 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 4909 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 4910 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 4911 // RollbackError - READ-ONLY; Error details if OS rollback failed. 4912 RollbackError *APIError `json:"rollbackError,omitempty"` 4913} 4914 4915// MarshalJSON is the custom marshaler for RollbackStatusInfo. 4916func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { 4917 objectMap := make(map[string]interface{}) 4918 return json.Marshal(objectMap) 4919} 4920 4921// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 4922type RollingUpgradePolicy struct { 4923 // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. 4924 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 4925 // MaxUnhealthyInstancePercent - The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. 4926 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 4927 // MaxUnhealthyUpgradedInstancePercent - The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. 4928 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 4929 // PauseTimeBetweenBatches - The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). 4930 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 4931} 4932 4933// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 4934// state. 4935type RollingUpgradeProgressInfo struct { 4936 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 4937 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 4938 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 4939 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 4940 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 4941 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 4942 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 4943 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 4944} 4945 4946// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. 4947func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { 4948 objectMap := make(map[string]interface{}) 4949 return json.Marshal(objectMap) 4950} 4951 4952// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 4953type RollingUpgradeRunningStatus struct { 4954 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 4955 Code RollingUpgradeStatusCode `json:"code,omitempty"` 4956 // StartTime - READ-ONLY; Start time of the upgrade. 4957 StartTime *date.Time `json:"startTime,omitempty"` 4958 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 4959 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 4960 // LastActionTime - READ-ONLY; Last action time of the upgrade. 4961 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 4962} 4963 4964// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. 4965func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { 4966 objectMap := make(map[string]interface{}) 4967 return json.Marshal(objectMap) 4968} 4969 4970// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 4971type RollingUpgradeStatusInfo struct { 4972 autorest.Response `json:"-"` 4973 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 4974 // ID - READ-ONLY; Resource Id 4975 ID *string `json:"id,omitempty"` 4976 // Name - READ-ONLY; Resource name 4977 Name *string `json:"name,omitempty"` 4978 // Type - READ-ONLY; Resource type 4979 Type *string `json:"type,omitempty"` 4980 // Location - Resource location 4981 Location *string `json:"location,omitempty"` 4982 // Tags - Resource tags 4983 Tags map[string]*string `json:"tags"` 4984} 4985 4986// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 4987func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 4988 objectMap := make(map[string]interface{}) 4989 if rusi.RollingUpgradeStatusInfoProperties != nil { 4990 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 4991 } 4992 if rusi.Location != nil { 4993 objectMap["location"] = rusi.Location 4994 } 4995 if rusi.Tags != nil { 4996 objectMap["tags"] = rusi.Tags 4997 } 4998 return json.Marshal(objectMap) 4999} 5000 5001// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 5002func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 5003 var m map[string]*json.RawMessage 5004 err := json.Unmarshal(body, &m) 5005 if err != nil { 5006 return err 5007 } 5008 for k, v := range m { 5009 switch k { 5010 case "properties": 5011 if v != nil { 5012 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 5013 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 5014 if err != nil { 5015 return err 5016 } 5017 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 5018 } 5019 case "id": 5020 if v != nil { 5021 var ID string 5022 err = json.Unmarshal(*v, &ID) 5023 if err != nil { 5024 return err 5025 } 5026 rusi.ID = &ID 5027 } 5028 case "name": 5029 if v != nil { 5030 var name string 5031 err = json.Unmarshal(*v, &name) 5032 if err != nil { 5033 return err 5034 } 5035 rusi.Name = &name 5036 } 5037 case "type": 5038 if v != nil { 5039 var typeVar string 5040 err = json.Unmarshal(*v, &typeVar) 5041 if err != nil { 5042 return err 5043 } 5044 rusi.Type = &typeVar 5045 } 5046 case "location": 5047 if v != nil { 5048 var location string 5049 err = json.Unmarshal(*v, &location) 5050 if err != nil { 5051 return err 5052 } 5053 rusi.Location = &location 5054 } 5055 case "tags": 5056 if v != nil { 5057 var tags map[string]*string 5058 err = json.Unmarshal(*v, &tags) 5059 if err != nil { 5060 return err 5061 } 5062 rusi.Tags = tags 5063 } 5064 } 5065 } 5066 5067 return nil 5068} 5069 5070// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 5071type RollingUpgradeStatusInfoProperties struct { 5072 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 5073 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 5074 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 5075 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 5076 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 5077 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 5078 // Error - READ-ONLY; Error details for this upgrade, if there are any. 5079 Error *APIError `json:"error,omitempty"` 5080} 5081 5082// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. 5083func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { 5084 objectMap := make(map[string]interface{}) 5085 return json.Marshal(objectMap) 5086} 5087 5088// RunCommandDocument describes the properties of a Run Command. 5089type RunCommandDocument struct { 5090 autorest.Response `json:"-"` 5091 // Script - The script to be executed. 5092 Script *[]string `json:"script,omitempty"` 5093 // Parameters - The parameters used by the script. 5094 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 5095 // Schema - The VM run command schema. 5096 Schema *string `json:"$schema,omitempty"` 5097 // ID - The VM run command id. 5098 ID *string `json:"id,omitempty"` 5099 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 5100 OsType OperatingSystemTypes `json:"osType,omitempty"` 5101 // Label - The VM run command label. 5102 Label *string `json:"label,omitempty"` 5103 // Description - The VM run command description. 5104 Description *string `json:"description,omitempty"` 5105} 5106 5107// RunCommandDocumentBase describes the properties of a Run Command metadata. 5108type RunCommandDocumentBase struct { 5109 // Schema - The VM run command schema. 5110 Schema *string `json:"$schema,omitempty"` 5111 // ID - The VM run command id. 5112 ID *string `json:"id,omitempty"` 5113 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 5114 OsType OperatingSystemTypes `json:"osType,omitempty"` 5115 // Label - The VM run command label. 5116 Label *string `json:"label,omitempty"` 5117 // Description - The VM run command description. 5118 Description *string `json:"description,omitempty"` 5119} 5120 5121// RunCommandInput capture Virtual Machine parameters. 5122type RunCommandInput struct { 5123 // CommandID - The run command id. 5124 CommandID *string `json:"commandId,omitempty"` 5125 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 5126 Script *[]string `json:"script,omitempty"` 5127 // Parameters - The run command parameters. 5128 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 5129} 5130 5131// RunCommandInputParameter describes the properties of a run command parameter. 5132type RunCommandInputParameter struct { 5133 // Name - The run command parameter name. 5134 Name *string `json:"name,omitempty"` 5135 // Value - The run command parameter value. 5136 Value *string `json:"value,omitempty"` 5137} 5138 5139// RunCommandListResult the List Virtual Machine operation response. 5140type RunCommandListResult struct { 5141 autorest.Response `json:"-"` 5142 // Value - The list of virtual machine run commands. 5143 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 5144 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 5145 NextLink *string `json:"nextLink,omitempty"` 5146} 5147 5148// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 5149type RunCommandListResultIterator struct { 5150 i int 5151 page RunCommandListResultPage 5152} 5153 5154// NextWithContext advances to the next value. If there was an error making 5155// the request the iterator does not advance and the error is returned. 5156func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 5157 if tracing.IsEnabled() { 5158 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 5159 defer func() { 5160 sc := -1 5161 if iter.Response().Response.Response != nil { 5162 sc = iter.Response().Response.Response.StatusCode 5163 } 5164 tracing.EndSpan(ctx, sc, err) 5165 }() 5166 } 5167 iter.i++ 5168 if iter.i < len(iter.page.Values()) { 5169 return nil 5170 } 5171 err = iter.page.NextWithContext(ctx) 5172 if err != nil { 5173 iter.i-- 5174 return err 5175 } 5176 iter.i = 0 5177 return nil 5178} 5179 5180// Next advances to the next value. If there was an error making 5181// the request the iterator does not advance and the error is returned. 5182// Deprecated: Use NextWithContext() instead. 5183func (iter *RunCommandListResultIterator) Next() error { 5184 return iter.NextWithContext(context.Background()) 5185} 5186 5187// NotDone returns true if the enumeration should be started or is not yet complete. 5188func (iter RunCommandListResultIterator) NotDone() bool { 5189 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5190} 5191 5192// Response returns the raw server response from the last page request. 5193func (iter RunCommandListResultIterator) Response() RunCommandListResult { 5194 return iter.page.Response() 5195} 5196 5197// Value returns the current value or a zero-initialized value if the 5198// iterator has advanced beyond the end of the collection. 5199func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 5200 if !iter.page.NotDone() { 5201 return RunCommandDocumentBase{} 5202 } 5203 return iter.page.Values()[iter.i] 5204} 5205 5206// Creates a new instance of the RunCommandListResultIterator type. 5207func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 5208 return RunCommandListResultIterator{page: page} 5209} 5210 5211// IsEmpty returns true if the ListResult contains no values. 5212func (rclr RunCommandListResult) IsEmpty() bool { 5213 return rclr.Value == nil || len(*rclr.Value) == 0 5214} 5215 5216// hasNextLink returns true if the NextLink is not empty. 5217func (rclr RunCommandListResult) hasNextLink() bool { 5218 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 5219} 5220 5221// runCommandListResultPreparer prepares a request to retrieve the next set of results. 5222// It returns nil if no more results exist. 5223func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 5224 if !rclr.hasNextLink() { 5225 return nil, nil 5226 } 5227 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5228 autorest.AsJSON(), 5229 autorest.AsGet(), 5230 autorest.WithBaseURL(to.String(rclr.NextLink))) 5231} 5232 5233// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 5234type RunCommandListResultPage struct { 5235 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 5236 rclr RunCommandListResult 5237} 5238 5239// NextWithContext advances to the next page of values. If there was an error making 5240// the request the page does not advance and the error is returned. 5241func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 5242 if tracing.IsEnabled() { 5243 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 5244 defer func() { 5245 sc := -1 5246 if page.Response().Response.Response != nil { 5247 sc = page.Response().Response.Response.StatusCode 5248 } 5249 tracing.EndSpan(ctx, sc, err) 5250 }() 5251 } 5252 for { 5253 next, err := page.fn(ctx, page.rclr) 5254 if err != nil { 5255 return err 5256 } 5257 page.rclr = next 5258 if !next.hasNextLink() || !next.IsEmpty() { 5259 break 5260 } 5261 } 5262 return nil 5263} 5264 5265// Next advances to the next page of values. If there was an error making 5266// the request the page does not advance and the error is returned. 5267// Deprecated: Use NextWithContext() instead. 5268func (page *RunCommandListResultPage) Next() error { 5269 return page.NextWithContext(context.Background()) 5270} 5271 5272// NotDone returns true if the page enumeration should be started or is not yet complete. 5273func (page RunCommandListResultPage) NotDone() bool { 5274 return !page.rclr.IsEmpty() 5275} 5276 5277// Response returns the raw server response from the last page request. 5278func (page RunCommandListResultPage) Response() RunCommandListResult { 5279 return page.rclr 5280} 5281 5282// Values returns the slice of values for the current page or nil if there are no values. 5283func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 5284 if page.rclr.IsEmpty() { 5285 return nil 5286 } 5287 return *page.rclr.Value 5288} 5289 5290// Creates a new instance of the RunCommandListResultPage type. 5291func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 5292 return RunCommandListResultPage{ 5293 fn: getNextPage, 5294 rclr: cur, 5295 } 5296} 5297 5298// RunCommandParameterDefinition describes the properties of a run command parameter. 5299type RunCommandParameterDefinition struct { 5300 // Name - The run command parameter name. 5301 Name *string `json:"name,omitempty"` 5302 // Type - The run command parameter type. 5303 Type *string `json:"type,omitempty"` 5304 // DefaultValue - The run command parameter default value. 5305 DefaultValue *string `json:"defaultValue,omitempty"` 5306 // Required - The run command parameter required. 5307 Required *bool `json:"required,omitempty"` 5308} 5309 5310// RunCommandResult ... 5311type RunCommandResult struct { 5312 autorest.Response `json:"-"` 5313 // Value - Run command operation response. 5314 Value *[]InstanceViewStatus `json:"value,omitempty"` 5315} 5316 5317// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 5318// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 5319// name. 5320type Sku struct { 5321 // Name - The sku name. 5322 Name *string `json:"name,omitempty"` 5323 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 5324 Tier *string `json:"tier,omitempty"` 5325 // Capacity - Specifies the number of virtual machines in the scale set. 5326 Capacity *int64 `json:"capacity,omitempty"` 5327} 5328 5329// Snapshot snapshot resource. 5330type Snapshot struct { 5331 autorest.Response `json:"-"` 5332 // ManagedBy - READ-ONLY; Unused. Always Null. 5333 ManagedBy *string `json:"managedBy,omitempty"` 5334 Sku *SnapshotSku `json:"sku,omitempty"` 5335 *SnapshotProperties `json:"properties,omitempty"` 5336 // ID - READ-ONLY; Resource Id 5337 ID *string `json:"id,omitempty"` 5338 // Name - READ-ONLY; Resource name 5339 Name *string `json:"name,omitempty"` 5340 // Type - READ-ONLY; Resource type 5341 Type *string `json:"type,omitempty"` 5342 // Location - Resource location 5343 Location *string `json:"location,omitempty"` 5344 // Tags - Resource tags 5345 Tags map[string]*string `json:"tags"` 5346} 5347 5348// MarshalJSON is the custom marshaler for Snapshot. 5349func (s Snapshot) MarshalJSON() ([]byte, error) { 5350 objectMap := make(map[string]interface{}) 5351 if s.Sku != nil { 5352 objectMap["sku"] = s.Sku 5353 } 5354 if s.SnapshotProperties != nil { 5355 objectMap["properties"] = s.SnapshotProperties 5356 } 5357 if s.Location != nil { 5358 objectMap["location"] = s.Location 5359 } 5360 if s.Tags != nil { 5361 objectMap["tags"] = s.Tags 5362 } 5363 return json.Marshal(objectMap) 5364} 5365 5366// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 5367func (s *Snapshot) UnmarshalJSON(body []byte) error { 5368 var m map[string]*json.RawMessage 5369 err := json.Unmarshal(body, &m) 5370 if err != nil { 5371 return err 5372 } 5373 for k, v := range m { 5374 switch k { 5375 case "managedBy": 5376 if v != nil { 5377 var managedBy string 5378 err = json.Unmarshal(*v, &managedBy) 5379 if err != nil { 5380 return err 5381 } 5382 s.ManagedBy = &managedBy 5383 } 5384 case "sku": 5385 if v != nil { 5386 var sku SnapshotSku 5387 err = json.Unmarshal(*v, &sku) 5388 if err != nil { 5389 return err 5390 } 5391 s.Sku = &sku 5392 } 5393 case "properties": 5394 if v != nil { 5395 var snapshotProperties SnapshotProperties 5396 err = json.Unmarshal(*v, &snapshotProperties) 5397 if err != nil { 5398 return err 5399 } 5400 s.SnapshotProperties = &snapshotProperties 5401 } 5402 case "id": 5403 if v != nil { 5404 var ID string 5405 err = json.Unmarshal(*v, &ID) 5406 if err != nil { 5407 return err 5408 } 5409 s.ID = &ID 5410 } 5411 case "name": 5412 if v != nil { 5413 var name string 5414 err = json.Unmarshal(*v, &name) 5415 if err != nil { 5416 return err 5417 } 5418 s.Name = &name 5419 } 5420 case "type": 5421 if v != nil { 5422 var typeVar string 5423 err = json.Unmarshal(*v, &typeVar) 5424 if err != nil { 5425 return err 5426 } 5427 s.Type = &typeVar 5428 } 5429 case "location": 5430 if v != nil { 5431 var location string 5432 err = json.Unmarshal(*v, &location) 5433 if err != nil { 5434 return err 5435 } 5436 s.Location = &location 5437 } 5438 case "tags": 5439 if v != nil { 5440 var tags map[string]*string 5441 err = json.Unmarshal(*v, &tags) 5442 if err != nil { 5443 return err 5444 } 5445 s.Tags = tags 5446 } 5447 } 5448 } 5449 5450 return nil 5451} 5452 5453// SnapshotList the List Snapshots operation response. 5454type SnapshotList struct { 5455 autorest.Response `json:"-"` 5456 // Value - A list of snapshots. 5457 Value *[]Snapshot `json:"value,omitempty"` 5458 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 5459 NextLink *string `json:"nextLink,omitempty"` 5460} 5461 5462// SnapshotListIterator provides access to a complete listing of Snapshot values. 5463type SnapshotListIterator struct { 5464 i int 5465 page SnapshotListPage 5466} 5467 5468// NextWithContext advances to the next value. If there was an error making 5469// the request the iterator does not advance and the error is returned. 5470func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 5471 if tracing.IsEnabled() { 5472 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 5473 defer func() { 5474 sc := -1 5475 if iter.Response().Response.Response != nil { 5476 sc = iter.Response().Response.Response.StatusCode 5477 } 5478 tracing.EndSpan(ctx, sc, err) 5479 }() 5480 } 5481 iter.i++ 5482 if iter.i < len(iter.page.Values()) { 5483 return nil 5484 } 5485 err = iter.page.NextWithContext(ctx) 5486 if err != nil { 5487 iter.i-- 5488 return err 5489 } 5490 iter.i = 0 5491 return nil 5492} 5493 5494// Next advances to the next value. If there was an error making 5495// the request the iterator does not advance and the error is returned. 5496// Deprecated: Use NextWithContext() instead. 5497func (iter *SnapshotListIterator) Next() error { 5498 return iter.NextWithContext(context.Background()) 5499} 5500 5501// NotDone returns true if the enumeration should be started or is not yet complete. 5502func (iter SnapshotListIterator) NotDone() bool { 5503 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5504} 5505 5506// Response returns the raw server response from the last page request. 5507func (iter SnapshotListIterator) Response() SnapshotList { 5508 return iter.page.Response() 5509} 5510 5511// Value returns the current value or a zero-initialized value if the 5512// iterator has advanced beyond the end of the collection. 5513func (iter SnapshotListIterator) Value() Snapshot { 5514 if !iter.page.NotDone() { 5515 return Snapshot{} 5516 } 5517 return iter.page.Values()[iter.i] 5518} 5519 5520// Creates a new instance of the SnapshotListIterator type. 5521func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 5522 return SnapshotListIterator{page: page} 5523} 5524 5525// IsEmpty returns true if the ListResult contains no values. 5526func (sl SnapshotList) IsEmpty() bool { 5527 return sl.Value == nil || len(*sl.Value) == 0 5528} 5529 5530// hasNextLink returns true if the NextLink is not empty. 5531func (sl SnapshotList) hasNextLink() bool { 5532 return sl.NextLink != nil && len(*sl.NextLink) != 0 5533} 5534 5535// snapshotListPreparer prepares a request to retrieve the next set of results. 5536// It returns nil if no more results exist. 5537func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 5538 if !sl.hasNextLink() { 5539 return nil, nil 5540 } 5541 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5542 autorest.AsJSON(), 5543 autorest.AsGet(), 5544 autorest.WithBaseURL(to.String(sl.NextLink))) 5545} 5546 5547// SnapshotListPage contains a page of Snapshot values. 5548type SnapshotListPage struct { 5549 fn func(context.Context, SnapshotList) (SnapshotList, error) 5550 sl SnapshotList 5551} 5552 5553// NextWithContext advances to the next page of values. If there was an error making 5554// the request the page does not advance and the error is returned. 5555func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 5556 if tracing.IsEnabled() { 5557 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 5558 defer func() { 5559 sc := -1 5560 if page.Response().Response.Response != nil { 5561 sc = page.Response().Response.Response.StatusCode 5562 } 5563 tracing.EndSpan(ctx, sc, err) 5564 }() 5565 } 5566 for { 5567 next, err := page.fn(ctx, page.sl) 5568 if err != nil { 5569 return err 5570 } 5571 page.sl = next 5572 if !next.hasNextLink() || !next.IsEmpty() { 5573 break 5574 } 5575 } 5576 return nil 5577} 5578 5579// Next advances to the next page of values. If there was an error making 5580// the request the page does not advance and the error is returned. 5581// Deprecated: Use NextWithContext() instead. 5582func (page *SnapshotListPage) Next() error { 5583 return page.NextWithContext(context.Background()) 5584} 5585 5586// NotDone returns true if the page enumeration should be started or is not yet complete. 5587func (page SnapshotListPage) NotDone() bool { 5588 return !page.sl.IsEmpty() 5589} 5590 5591// Response returns the raw server response from the last page request. 5592func (page SnapshotListPage) Response() SnapshotList { 5593 return page.sl 5594} 5595 5596// Values returns the slice of values for the current page or nil if there are no values. 5597func (page SnapshotListPage) Values() []Snapshot { 5598 if page.sl.IsEmpty() { 5599 return nil 5600 } 5601 return *page.sl.Value 5602} 5603 5604// Creates a new instance of the SnapshotListPage type. 5605func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 5606 return SnapshotListPage{ 5607 fn: getNextPage, 5608 sl: cur, 5609 } 5610} 5611 5612// SnapshotProperties snapshot resource properties. 5613type SnapshotProperties struct { 5614 // TimeCreated - READ-ONLY; The time when the disk was created. 5615 TimeCreated *date.Time `json:"timeCreated,omitempty"` 5616 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 5617 OsType OperatingSystemTypes `json:"osType,omitempty"` 5618 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 5619 CreationData *CreationData `json:"creationData,omitempty"` 5620 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 5621 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5622 // EncryptionSettings - Encryption settings for disk or snapshot 5623 EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` 5624 // ProvisioningState - READ-ONLY; The disk provisioning state. 5625 ProvisioningState *string `json:"provisioningState,omitempty"` 5626} 5627 5628// MarshalJSON is the custom marshaler for SnapshotProperties. 5629func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 5630 objectMap := make(map[string]interface{}) 5631 if sp.OsType != "" { 5632 objectMap["osType"] = sp.OsType 5633 } 5634 if sp.CreationData != nil { 5635 objectMap["creationData"] = sp.CreationData 5636 } 5637 if sp.DiskSizeGB != nil { 5638 objectMap["diskSizeGB"] = sp.DiskSizeGB 5639 } 5640 if sp.EncryptionSettings != nil { 5641 objectMap["encryptionSettings"] = sp.EncryptionSettings 5642 } 5643 return json.Marshal(objectMap) 5644} 5645 5646// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5647// operation. 5648type SnapshotsCreateOrUpdateFuture struct { 5649 azure.FutureAPI 5650 // Result returns the result of the asynchronous operation. 5651 // If the operation has not completed it will return an error. 5652 Result func(SnapshotsClient) (Snapshot, error) 5653} 5654 5655// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5656func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5657 var azFuture azure.Future 5658 if err := json.Unmarshal(body, &azFuture); err != nil { 5659 return err 5660 } 5661 future.FutureAPI = &azFuture 5662 future.Result = future.result 5663 return nil 5664} 5665 5666// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 5667func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 5668 var done bool 5669 done, err = future.DoneWithContext(context.Background(), client) 5670 if err != nil { 5671 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5672 return 5673 } 5674 if !done { 5675 s.Response.Response = future.Response() 5676 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 5677 return 5678 } 5679 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5680 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 5681 s, err = client.CreateOrUpdateResponder(s.Response.Response) 5682 if err != nil { 5683 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 5684 } 5685 } 5686 return 5687} 5688 5689// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5690// operation. 5691type SnapshotsDeleteFuture struct { 5692 azure.FutureAPI 5693 // Result returns the result of the asynchronous operation. 5694 // If the operation has not completed it will return an error. 5695 Result func(SnapshotsClient) (autorest.Response, error) 5696} 5697 5698// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5699func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 5700 var azFuture azure.Future 5701 if err := json.Unmarshal(body, &azFuture); err != nil { 5702 return err 5703 } 5704 future.FutureAPI = &azFuture 5705 future.Result = future.result 5706 return nil 5707} 5708 5709// result is the default implementation for SnapshotsDeleteFuture.Result. 5710func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 5711 var done bool 5712 done, err = future.DoneWithContext(context.Background(), client) 5713 if err != nil { 5714 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 5715 return 5716 } 5717 if !done { 5718 ar.Response = future.Response() 5719 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 5720 return 5721 } 5722 ar.Response = future.Response() 5723 return 5724} 5725 5726// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5727// operation. 5728type SnapshotsGrantAccessFuture struct { 5729 azure.FutureAPI 5730 // Result returns the result of the asynchronous operation. 5731 // If the operation has not completed it will return an error. 5732 Result func(SnapshotsClient) (AccessURI, error) 5733} 5734 5735// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5736func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 5737 var azFuture azure.Future 5738 if err := json.Unmarshal(body, &azFuture); err != nil { 5739 return err 5740 } 5741 future.FutureAPI = &azFuture 5742 future.Result = future.result 5743 return nil 5744} 5745 5746// result is the default implementation for SnapshotsGrantAccessFuture.Result. 5747func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 5748 var done bool 5749 done, err = future.DoneWithContext(context.Background(), client) 5750 if err != nil { 5751 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 5752 return 5753 } 5754 if !done { 5755 au.Response.Response = future.Response() 5756 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 5757 return 5758 } 5759 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5760 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 5761 au, err = client.GrantAccessResponder(au.Response.Response) 5762 if err != nil { 5763 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 5764 } 5765 } 5766 return 5767} 5768 5769// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 5770type SnapshotSku struct { 5771 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 5772 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 5773 // Tier - READ-ONLY; The sku tier. 5774 Tier *string `json:"tier,omitempty"` 5775} 5776 5777// MarshalJSON is the custom marshaler for SnapshotSku. 5778func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 5779 objectMap := make(map[string]interface{}) 5780 if ss.Name != "" { 5781 objectMap["name"] = ss.Name 5782 } 5783 return json.Marshal(objectMap) 5784} 5785 5786// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5787// operation. 5788type SnapshotsRevokeAccessFuture struct { 5789 azure.FutureAPI 5790 // Result returns the result of the asynchronous operation. 5791 // If the operation has not completed it will return an error. 5792 Result func(SnapshotsClient) (autorest.Response, error) 5793} 5794 5795// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5796func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 5797 var azFuture azure.Future 5798 if err := json.Unmarshal(body, &azFuture); err != nil { 5799 return err 5800 } 5801 future.FutureAPI = &azFuture 5802 future.Result = future.result 5803 return nil 5804} 5805 5806// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 5807func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 5808 var done bool 5809 done, err = future.DoneWithContext(context.Background(), client) 5810 if err != nil { 5811 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 5812 return 5813 } 5814 if !done { 5815 ar.Response = future.Response() 5816 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 5817 return 5818 } 5819 ar.Response = future.Response() 5820 return 5821} 5822 5823// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5824// operation. 5825type SnapshotsUpdateFuture struct { 5826 azure.FutureAPI 5827 // Result returns the result of the asynchronous operation. 5828 // If the operation has not completed it will return an error. 5829 Result func(SnapshotsClient) (Snapshot, error) 5830} 5831 5832// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5833func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 5834 var azFuture azure.Future 5835 if err := json.Unmarshal(body, &azFuture); err != nil { 5836 return err 5837 } 5838 future.FutureAPI = &azFuture 5839 future.Result = future.result 5840 return nil 5841} 5842 5843// result is the default implementation for SnapshotsUpdateFuture.Result. 5844func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 5845 var done bool 5846 done, err = future.DoneWithContext(context.Background(), client) 5847 if err != nil { 5848 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 5849 return 5850 } 5851 if !done { 5852 s.Response.Response = future.Response() 5853 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 5854 return 5855 } 5856 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5857 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 5858 s, err = client.UpdateResponder(s.Response.Response) 5859 if err != nil { 5860 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 5861 } 5862 } 5863 return 5864} 5865 5866// SnapshotUpdate snapshot update resource. 5867type SnapshotUpdate struct { 5868 *SnapshotUpdateProperties `json:"properties,omitempty"` 5869 // Tags - Resource tags 5870 Tags map[string]*string `json:"tags"` 5871 Sku *SnapshotSku `json:"sku,omitempty"` 5872} 5873 5874// MarshalJSON is the custom marshaler for SnapshotUpdate. 5875func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 5876 objectMap := make(map[string]interface{}) 5877 if su.SnapshotUpdateProperties != nil { 5878 objectMap["properties"] = su.SnapshotUpdateProperties 5879 } 5880 if su.Tags != nil { 5881 objectMap["tags"] = su.Tags 5882 } 5883 if su.Sku != nil { 5884 objectMap["sku"] = su.Sku 5885 } 5886 return json.Marshal(objectMap) 5887} 5888 5889// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 5890func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 5891 var m map[string]*json.RawMessage 5892 err := json.Unmarshal(body, &m) 5893 if err != nil { 5894 return err 5895 } 5896 for k, v := range m { 5897 switch k { 5898 case "properties": 5899 if v != nil { 5900 var snapshotUpdateProperties SnapshotUpdateProperties 5901 err = json.Unmarshal(*v, &snapshotUpdateProperties) 5902 if err != nil { 5903 return err 5904 } 5905 su.SnapshotUpdateProperties = &snapshotUpdateProperties 5906 } 5907 case "tags": 5908 if v != nil { 5909 var tags map[string]*string 5910 err = json.Unmarshal(*v, &tags) 5911 if err != nil { 5912 return err 5913 } 5914 su.Tags = tags 5915 } 5916 case "sku": 5917 if v != nil { 5918 var sku SnapshotSku 5919 err = json.Unmarshal(*v, &sku) 5920 if err != nil { 5921 return err 5922 } 5923 su.Sku = &sku 5924 } 5925 } 5926 } 5927 5928 return nil 5929} 5930 5931// SnapshotUpdateProperties snapshot resource update properties. 5932type SnapshotUpdateProperties struct { 5933 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 5934 OsType OperatingSystemTypes `json:"osType,omitempty"` 5935 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 5936 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5937 // EncryptionSettings - Encryption settings for disk or snapshot 5938 EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` 5939} 5940 5941// SourceVault the vault id is an Azure Resource Manager Resource id in the form 5942// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 5943type SourceVault struct { 5944 // ID - Resource Id 5945 ID *string `json:"id,omitempty"` 5946} 5947 5948// SSHConfiguration SSH configuration for Linux based VMs running on Azure 5949type SSHConfiguration struct { 5950 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 5951 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 5952} 5953 5954// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 5955// the public key is placed. 5956type SSHPublicKey struct { 5957 // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys 5958 Path *string `json:"path,omitempty"` 5959 // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 5960 KeyData *string `json:"keyData,omitempty"` 5961} 5962 5963// StorageProfile specifies the storage settings for the virtual machine disks. 5964type StorageProfile struct { 5965 // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. 5966 ImageReference *ImageReference `json:"imageReference,omitempty"` 5967 // OsDisk - Specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 5968 OsDisk *OSDisk `json:"osDisk,omitempty"` 5969 // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 5970 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 5971} 5972 5973// SubResource ... 5974type SubResource struct { 5975 // ID - Resource Id 5976 ID *string `json:"id,omitempty"` 5977} 5978 5979// SubResourceReadOnly ... 5980type SubResourceReadOnly struct { 5981 // ID - READ-ONLY; Resource Id 5982 ID *string `json:"id,omitempty"` 5983} 5984 5985// MarshalJSON is the custom marshaler for SubResourceReadOnly. 5986func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { 5987 objectMap := make(map[string]interface{}) 5988 return json.Marshal(objectMap) 5989} 5990 5991// TargetRegion describes the target region information. 5992type TargetRegion struct { 5993 // Name - The name of the region. 5994 Name *string `json:"name,omitempty"` 5995 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 5996 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 5997} 5998 5999// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 6000type ThrottledRequestsInput struct { 6001 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 6002 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 6003 // FromTime - From time of the query 6004 FromTime *date.Time `json:"fromTime,omitempty"` 6005 // ToTime - To time of the query 6006 ToTime *date.Time `json:"toTime,omitempty"` 6007 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 6008 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 6009 // GroupByOperationName - Group query result by Operation Name. 6010 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 6011 // GroupByResourceName - Group query result by Resource Name. 6012 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 6013} 6014 6015// UpdateResource the Update Resource model definition. 6016type UpdateResource struct { 6017 // Tags - Resource tags 6018 Tags map[string]*string `json:"tags"` 6019} 6020 6021// MarshalJSON is the custom marshaler for UpdateResource. 6022func (ur UpdateResource) MarshalJSON() ([]byte, error) { 6023 objectMap := make(map[string]interface{}) 6024 if ur.Tags != nil { 6025 objectMap["tags"] = ur.Tags 6026 } 6027 return json.Marshal(objectMap) 6028} 6029 6030// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 6031type UpgradeOperationHistoricalStatusInfo struct { 6032 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 6033 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 6034 // Type - READ-ONLY; Resource type 6035 Type *string `json:"type,omitempty"` 6036 // Location - READ-ONLY; Resource location 6037 Location *string `json:"location,omitempty"` 6038} 6039 6040// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. 6041func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { 6042 objectMap := make(map[string]interface{}) 6043 return json.Marshal(objectMap) 6044} 6045 6046// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 6047// Set. 6048type UpgradeOperationHistoricalStatusInfoProperties struct { 6049 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 6050 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 6051 // Progress - READ-ONLY; Counts of the VMs in each state. 6052 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 6053 // Error - READ-ONLY; Error Details for this upgrade if there are any. 6054 Error *APIError `json:"error,omitempty"` 6055 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 6056 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 6057 // TargetImageReference - READ-ONLY; Image Reference details 6058 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 6059 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 6060 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 6061} 6062 6063// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. 6064func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { 6065 objectMap := make(map[string]interface{}) 6066 return json.Marshal(objectMap) 6067} 6068 6069// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 6070type UpgradeOperationHistoryStatus struct { 6071 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 6072 Code UpgradeState `json:"code,omitempty"` 6073 // StartTime - READ-ONLY; Start time of the upgrade. 6074 StartTime *date.Time `json:"startTime,omitempty"` 6075 // EndTime - READ-ONLY; End time of the upgrade. 6076 EndTime *date.Time `json:"endTime,omitempty"` 6077} 6078 6079// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. 6080func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { 6081 objectMap := make(map[string]interface{}) 6082 return json.Marshal(objectMap) 6083} 6084 6085// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 6086type UpgradePolicy struct { 6087 // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'Automatic', 'Manual', 'Rolling' 6088 Mode UpgradeMode `json:"mode,omitempty"` 6089 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 6090 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 6091 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 6092 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 6093} 6094 6095// Usage describes Compute Resource Usage. 6096type Usage struct { 6097 // Unit - An enum describing the unit of usage measurement. 6098 Unit *string `json:"unit,omitempty"` 6099 // CurrentValue - The current usage of the resource. 6100 CurrentValue *int32 `json:"currentValue,omitempty"` 6101 // Limit - The maximum permitted usage of the resource. 6102 Limit *int64 `json:"limit,omitempty"` 6103 // Name - The name of the type of usage. 6104 Name *UsageName `json:"name,omitempty"` 6105} 6106 6107// UsageName the Usage Names. 6108type UsageName struct { 6109 // Value - The name of the resource. 6110 Value *string `json:"value,omitempty"` 6111 // LocalizedValue - The localized name of the resource. 6112 LocalizedValue *string `json:"localizedValue,omitempty"` 6113} 6114 6115// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 6116// should reside on the VM. 6117type VaultCertificate struct { 6118 // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>} 6119 CertificateURL *string `json:"certificateUrl,omitempty"` 6120 // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. 6121 CertificateStore *string `json:"certificateStore,omitempty"` 6122} 6123 6124// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 6125type VaultSecretGroup struct { 6126 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 6127 SourceVault *SubResource `json:"sourceVault,omitempty"` 6128 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 6129 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 6130} 6131 6132// VirtualHardDisk describes the uri of a disk. 6133type VirtualHardDisk struct { 6134 // URI - Specifies the virtual hard disk's uri. 6135 URI *string `json:"uri,omitempty"` 6136} 6137 6138// VirtualMachine describes a Virtual Machine. 6139type VirtualMachine struct { 6140 autorest.Response `json:"-"` 6141 // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. 6142 Plan *Plan `json:"plan,omitempty"` 6143 *VirtualMachineProperties `json:"properties,omitempty"` 6144 // Resources - READ-ONLY; The virtual machine child extension resources. 6145 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 6146 // Identity - The identity of the virtual machine, if configured. 6147 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 6148 // Zones - The virtual machine zones. 6149 Zones *[]string `json:"zones,omitempty"` 6150 // ID - READ-ONLY; Resource Id 6151 ID *string `json:"id,omitempty"` 6152 // Name - READ-ONLY; Resource name 6153 Name *string `json:"name,omitempty"` 6154 // Type - READ-ONLY; Resource type 6155 Type *string `json:"type,omitempty"` 6156 // Location - Resource location 6157 Location *string `json:"location,omitempty"` 6158 // Tags - Resource tags 6159 Tags map[string]*string `json:"tags"` 6160} 6161 6162// MarshalJSON is the custom marshaler for VirtualMachine. 6163func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 6164 objectMap := make(map[string]interface{}) 6165 if VM.Plan != nil { 6166 objectMap["plan"] = VM.Plan 6167 } 6168 if VM.VirtualMachineProperties != nil { 6169 objectMap["properties"] = VM.VirtualMachineProperties 6170 } 6171 if VM.Identity != nil { 6172 objectMap["identity"] = VM.Identity 6173 } 6174 if VM.Zones != nil { 6175 objectMap["zones"] = VM.Zones 6176 } 6177 if VM.Location != nil { 6178 objectMap["location"] = VM.Location 6179 } 6180 if VM.Tags != nil { 6181 objectMap["tags"] = VM.Tags 6182 } 6183 return json.Marshal(objectMap) 6184} 6185 6186// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 6187func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 6188 var m map[string]*json.RawMessage 6189 err := json.Unmarshal(body, &m) 6190 if err != nil { 6191 return err 6192 } 6193 for k, v := range m { 6194 switch k { 6195 case "plan": 6196 if v != nil { 6197 var plan Plan 6198 err = json.Unmarshal(*v, &plan) 6199 if err != nil { 6200 return err 6201 } 6202 VM.Plan = &plan 6203 } 6204 case "properties": 6205 if v != nil { 6206 var virtualMachineProperties VirtualMachineProperties 6207 err = json.Unmarshal(*v, &virtualMachineProperties) 6208 if err != nil { 6209 return err 6210 } 6211 VM.VirtualMachineProperties = &virtualMachineProperties 6212 } 6213 case "resources": 6214 if v != nil { 6215 var resources []VirtualMachineExtension 6216 err = json.Unmarshal(*v, &resources) 6217 if err != nil { 6218 return err 6219 } 6220 VM.Resources = &resources 6221 } 6222 case "identity": 6223 if v != nil { 6224 var identity VirtualMachineIdentity 6225 err = json.Unmarshal(*v, &identity) 6226 if err != nil { 6227 return err 6228 } 6229 VM.Identity = &identity 6230 } 6231 case "zones": 6232 if v != nil { 6233 var zones []string 6234 err = json.Unmarshal(*v, &zones) 6235 if err != nil { 6236 return err 6237 } 6238 VM.Zones = &zones 6239 } 6240 case "id": 6241 if v != nil { 6242 var ID string 6243 err = json.Unmarshal(*v, &ID) 6244 if err != nil { 6245 return err 6246 } 6247 VM.ID = &ID 6248 } 6249 case "name": 6250 if v != nil { 6251 var name string 6252 err = json.Unmarshal(*v, &name) 6253 if err != nil { 6254 return err 6255 } 6256 VM.Name = &name 6257 } 6258 case "type": 6259 if v != nil { 6260 var typeVar string 6261 err = json.Unmarshal(*v, &typeVar) 6262 if err != nil { 6263 return err 6264 } 6265 VM.Type = &typeVar 6266 } 6267 case "location": 6268 if v != nil { 6269 var location string 6270 err = json.Unmarshal(*v, &location) 6271 if err != nil { 6272 return err 6273 } 6274 VM.Location = &location 6275 } 6276 case "tags": 6277 if v != nil { 6278 var tags map[string]*string 6279 err = json.Unmarshal(*v, &tags) 6280 if err != nil { 6281 return err 6282 } 6283 VM.Tags = tags 6284 } 6285 } 6286 } 6287 6288 return nil 6289} 6290 6291// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 6292type VirtualMachineAgentInstanceView struct { 6293 // VMAgentVersion - The VM Agent full version. 6294 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 6295 // ExtensionHandlers - The virtual machine extension handler instance view. 6296 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 6297 // Statuses - The resource status information. 6298 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 6299} 6300 6301// VirtualMachineCaptureParameters capture Virtual Machine parameters. 6302type VirtualMachineCaptureParameters struct { 6303 // VhdPrefix - The captured virtual hard disk's name prefix. 6304 VhdPrefix *string `json:"vhdPrefix,omitempty"` 6305 // DestinationContainerName - The destination container name. 6306 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 6307 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 6308 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 6309} 6310 6311// VirtualMachineCaptureResult output of virtual machine capture operation. 6312type VirtualMachineCaptureResult struct { 6313 autorest.Response `json:"-"` 6314 // Schema - READ-ONLY; the schema of the captured virtual machine 6315 Schema *string `json:"$schema,omitempty"` 6316 // ContentVersion - READ-ONLY; the version of the content 6317 ContentVersion *string `json:"contentVersion,omitempty"` 6318 // Parameters - READ-ONLY; parameters of the captured virtual machine 6319 Parameters interface{} `json:"parameters,omitempty"` 6320 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 6321 Resources *[]interface{} `json:"resources,omitempty"` 6322 // ID - Resource Id 6323 ID *string `json:"id,omitempty"` 6324} 6325 6326// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 6327func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 6328 objectMap := make(map[string]interface{}) 6329 if vmcr.ID != nil { 6330 objectMap["id"] = vmcr.ID 6331 } 6332 return json.Marshal(objectMap) 6333} 6334 6335// VirtualMachineExtension describes a Virtual Machine Extension. 6336type VirtualMachineExtension struct { 6337 autorest.Response `json:"-"` 6338 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 6339 // ID - READ-ONLY; Resource Id 6340 ID *string `json:"id,omitempty"` 6341 // Name - READ-ONLY; Resource name 6342 Name *string `json:"name,omitempty"` 6343 // Type - READ-ONLY; Resource type 6344 Type *string `json:"type,omitempty"` 6345 // Location - Resource location 6346 Location *string `json:"location,omitempty"` 6347 // Tags - Resource tags 6348 Tags map[string]*string `json:"tags"` 6349} 6350 6351// MarshalJSON is the custom marshaler for VirtualMachineExtension. 6352func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 6353 objectMap := make(map[string]interface{}) 6354 if vme.VirtualMachineExtensionProperties != nil { 6355 objectMap["properties"] = vme.VirtualMachineExtensionProperties 6356 } 6357 if vme.Location != nil { 6358 objectMap["location"] = vme.Location 6359 } 6360 if vme.Tags != nil { 6361 objectMap["tags"] = vme.Tags 6362 } 6363 return json.Marshal(objectMap) 6364} 6365 6366// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 6367func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 6368 var m map[string]*json.RawMessage 6369 err := json.Unmarshal(body, &m) 6370 if err != nil { 6371 return err 6372 } 6373 for k, v := range m { 6374 switch k { 6375 case "properties": 6376 if v != nil { 6377 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 6378 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 6379 if err != nil { 6380 return err 6381 } 6382 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 6383 } 6384 case "id": 6385 if v != nil { 6386 var ID string 6387 err = json.Unmarshal(*v, &ID) 6388 if err != nil { 6389 return err 6390 } 6391 vme.ID = &ID 6392 } 6393 case "name": 6394 if v != nil { 6395 var name string 6396 err = json.Unmarshal(*v, &name) 6397 if err != nil { 6398 return err 6399 } 6400 vme.Name = &name 6401 } 6402 case "type": 6403 if v != nil { 6404 var typeVar string 6405 err = json.Unmarshal(*v, &typeVar) 6406 if err != nil { 6407 return err 6408 } 6409 vme.Type = &typeVar 6410 } 6411 case "location": 6412 if v != nil { 6413 var location string 6414 err = json.Unmarshal(*v, &location) 6415 if err != nil { 6416 return err 6417 } 6418 vme.Location = &location 6419 } 6420 case "tags": 6421 if v != nil { 6422 var tags map[string]*string 6423 err = json.Unmarshal(*v, &tags) 6424 if err != nil { 6425 return err 6426 } 6427 vme.Tags = tags 6428 } 6429 } 6430 } 6431 6432 return nil 6433} 6434 6435// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 6436type VirtualMachineExtensionHandlerInstanceView struct { 6437 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6438 Type *string `json:"type,omitempty"` 6439 // TypeHandlerVersion - Specifies the version of the script handler. 6440 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6441 // Status - The extension handler status. 6442 Status *InstanceViewStatus `json:"status,omitempty"` 6443} 6444 6445// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 6446type VirtualMachineExtensionImage struct { 6447 autorest.Response `json:"-"` 6448 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 6449 // ID - READ-ONLY; Resource Id 6450 ID *string `json:"id,omitempty"` 6451 // Name - READ-ONLY; Resource name 6452 Name *string `json:"name,omitempty"` 6453 // Type - READ-ONLY; Resource type 6454 Type *string `json:"type,omitempty"` 6455 // Location - Resource location 6456 Location *string `json:"location,omitempty"` 6457 // Tags - Resource tags 6458 Tags map[string]*string `json:"tags"` 6459} 6460 6461// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 6462func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 6463 objectMap := make(map[string]interface{}) 6464 if vmei.VirtualMachineExtensionImageProperties != nil { 6465 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 6466 } 6467 if vmei.Location != nil { 6468 objectMap["location"] = vmei.Location 6469 } 6470 if vmei.Tags != nil { 6471 objectMap["tags"] = vmei.Tags 6472 } 6473 return json.Marshal(objectMap) 6474} 6475 6476// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 6477func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 6478 var m map[string]*json.RawMessage 6479 err := json.Unmarshal(body, &m) 6480 if err != nil { 6481 return err 6482 } 6483 for k, v := range m { 6484 switch k { 6485 case "properties": 6486 if v != nil { 6487 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 6488 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 6489 if err != nil { 6490 return err 6491 } 6492 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 6493 } 6494 case "id": 6495 if v != nil { 6496 var ID string 6497 err = json.Unmarshal(*v, &ID) 6498 if err != nil { 6499 return err 6500 } 6501 vmei.ID = &ID 6502 } 6503 case "name": 6504 if v != nil { 6505 var name string 6506 err = json.Unmarshal(*v, &name) 6507 if err != nil { 6508 return err 6509 } 6510 vmei.Name = &name 6511 } 6512 case "type": 6513 if v != nil { 6514 var typeVar string 6515 err = json.Unmarshal(*v, &typeVar) 6516 if err != nil { 6517 return err 6518 } 6519 vmei.Type = &typeVar 6520 } 6521 case "location": 6522 if v != nil { 6523 var location string 6524 err = json.Unmarshal(*v, &location) 6525 if err != nil { 6526 return err 6527 } 6528 vmei.Location = &location 6529 } 6530 case "tags": 6531 if v != nil { 6532 var tags map[string]*string 6533 err = json.Unmarshal(*v, &tags) 6534 if err != nil { 6535 return err 6536 } 6537 vmei.Tags = tags 6538 } 6539 } 6540 } 6541 6542 return nil 6543} 6544 6545// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 6546type VirtualMachineExtensionImageProperties struct { 6547 // OperatingSystem - The operating system this extension supports. 6548 OperatingSystem *string `json:"operatingSystem,omitempty"` 6549 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 6550 ComputeRole *string `json:"computeRole,omitempty"` 6551 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 6552 HandlerSchema *string `json:"handlerSchema,omitempty"` 6553 // VMScaleSetEnabled - Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. 6554 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 6555 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 6556 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 6557} 6558 6559// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 6560type VirtualMachineExtensionInstanceView struct { 6561 // Name - The virtual machine extension name. 6562 Name *string `json:"name,omitempty"` 6563 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6564 Type *string `json:"type,omitempty"` 6565 // TypeHandlerVersion - Specifies the version of the script handler. 6566 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6567 // Substatuses - The resource status information. 6568 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 6569 // Statuses - The resource status information. 6570 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 6571} 6572 6573// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 6574type VirtualMachineExtensionProperties struct { 6575 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 6576 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 6577 // Publisher - The name of the extension handler publisher. 6578 Publisher *string `json:"publisher,omitempty"` 6579 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6580 Type *string `json:"type,omitempty"` 6581 // TypeHandlerVersion - Specifies the version of the script handler. 6582 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6583 // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. 6584 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 6585 // Settings - Json formatted public settings for the extension. 6586 Settings interface{} `json:"settings,omitempty"` 6587 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 6588 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 6589 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 6590 ProvisioningState *string `json:"provisioningState,omitempty"` 6591 // InstanceView - The virtual machine extension instance view. 6592 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 6593} 6594 6595// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 6596func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 6597 objectMap := make(map[string]interface{}) 6598 if vmep.ForceUpdateTag != nil { 6599 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 6600 } 6601 if vmep.Publisher != nil { 6602 objectMap["publisher"] = vmep.Publisher 6603 } 6604 if vmep.Type != nil { 6605 objectMap["type"] = vmep.Type 6606 } 6607 if vmep.TypeHandlerVersion != nil { 6608 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 6609 } 6610 if vmep.AutoUpgradeMinorVersion != nil { 6611 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 6612 } 6613 if vmep.Settings != nil { 6614 objectMap["settings"] = vmep.Settings 6615 } 6616 if vmep.ProtectedSettings != nil { 6617 objectMap["protectedSettings"] = vmep.ProtectedSettings 6618 } 6619 if vmep.InstanceView != nil { 6620 objectMap["instanceView"] = vmep.InstanceView 6621 } 6622 return json.Marshal(objectMap) 6623} 6624 6625// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 6626// a long-running operation. 6627type VirtualMachineExtensionsCreateOrUpdateFuture struct { 6628 azure.FutureAPI 6629 // Result returns the result of the asynchronous operation. 6630 // If the operation has not completed it will return an error. 6631 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 6632} 6633 6634// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6635func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6636 var azFuture azure.Future 6637 if err := json.Unmarshal(body, &azFuture); err != nil { 6638 return err 6639 } 6640 future.FutureAPI = &azFuture 6641 future.Result = future.result 6642 return nil 6643} 6644 6645// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 6646func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 6647 var done bool 6648 done, err = future.DoneWithContext(context.Background(), client) 6649 if err != nil { 6650 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6651 return 6652 } 6653 if !done { 6654 vme.Response.Response = future.Response() 6655 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 6656 return 6657 } 6658 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6659 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 6660 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 6661 if err != nil { 6662 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 6663 } 6664 } 6665 return 6666} 6667 6668// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 6669// long-running operation. 6670type VirtualMachineExtensionsDeleteFuture struct { 6671 azure.FutureAPI 6672 // Result returns the result of the asynchronous operation. 6673 // If the operation has not completed it will return an error. 6674 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 6675} 6676 6677// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6678func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 6679 var azFuture azure.Future 6680 if err := json.Unmarshal(body, &azFuture); err != nil { 6681 return err 6682 } 6683 future.FutureAPI = &azFuture 6684 future.Result = future.result 6685 return nil 6686} 6687 6688// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 6689func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 6690 var done bool 6691 done, err = future.DoneWithContext(context.Background(), client) 6692 if err != nil { 6693 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 6694 return 6695 } 6696 if !done { 6697 ar.Response = future.Response() 6698 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 6699 return 6700 } 6701 ar.Response = future.Response() 6702 return 6703} 6704 6705// VirtualMachineExtensionsListResult the List Extension operation response 6706type VirtualMachineExtensionsListResult struct { 6707 autorest.Response `json:"-"` 6708 // Value - The list of extensions 6709 Value *[]VirtualMachineExtension `json:"value,omitempty"` 6710} 6711 6712// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 6713// long-running operation. 6714type VirtualMachineExtensionsUpdateFuture struct { 6715 azure.FutureAPI 6716 // Result returns the result of the asynchronous operation. 6717 // If the operation has not completed it will return an error. 6718 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 6719} 6720 6721// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6722func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 6723 var azFuture azure.Future 6724 if err := json.Unmarshal(body, &azFuture); err != nil { 6725 return err 6726 } 6727 future.FutureAPI = &azFuture 6728 future.Result = future.result 6729 return nil 6730} 6731 6732// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 6733func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 6734 var done bool 6735 done, err = future.DoneWithContext(context.Background(), client) 6736 if err != nil { 6737 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 6738 return 6739 } 6740 if !done { 6741 vme.Response.Response = future.Response() 6742 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 6743 return 6744 } 6745 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6746 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 6747 vme, err = client.UpdateResponder(vme.Response.Response) 6748 if err != nil { 6749 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 6750 } 6751 } 6752 return 6753} 6754 6755// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 6756type VirtualMachineExtensionUpdate struct { 6757 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 6758 // Tags - Resource tags 6759 Tags map[string]*string `json:"tags"` 6760} 6761 6762// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 6763func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 6764 objectMap := make(map[string]interface{}) 6765 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 6766 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 6767 } 6768 if vmeu.Tags != nil { 6769 objectMap["tags"] = vmeu.Tags 6770 } 6771 return json.Marshal(objectMap) 6772} 6773 6774// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 6775func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 6776 var m map[string]*json.RawMessage 6777 err := json.Unmarshal(body, &m) 6778 if err != nil { 6779 return err 6780 } 6781 for k, v := range m { 6782 switch k { 6783 case "properties": 6784 if v != nil { 6785 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 6786 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 6787 if err != nil { 6788 return err 6789 } 6790 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 6791 } 6792 case "tags": 6793 if v != nil { 6794 var tags map[string]*string 6795 err = json.Unmarshal(*v, &tags) 6796 if err != nil { 6797 return err 6798 } 6799 vmeu.Tags = tags 6800 } 6801 } 6802 } 6803 6804 return nil 6805} 6806 6807// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 6808type VirtualMachineExtensionUpdateProperties struct { 6809 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 6810 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 6811 // Publisher - The name of the extension handler publisher. 6812 Publisher *string `json:"publisher,omitempty"` 6813 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6814 Type *string `json:"type,omitempty"` 6815 // TypeHandlerVersion - Specifies the version of the script handler. 6816 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6817 // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. 6818 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 6819 // Settings - Json formatted public settings for the extension. 6820 Settings interface{} `json:"settings,omitempty"` 6821 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 6822 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 6823} 6824 6825// VirtualMachineHealthStatus the health status of the VM. 6826type VirtualMachineHealthStatus struct { 6827 // Status - READ-ONLY; The health status information for the VM. 6828 Status *InstanceViewStatus `json:"status,omitempty"` 6829} 6830 6831// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. 6832func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { 6833 objectMap := make(map[string]interface{}) 6834 return json.Marshal(objectMap) 6835} 6836 6837// VirtualMachineIdentity identity for the virtual machine. 6838type VirtualMachineIdentity struct { 6839 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 6840 PrincipalID *string `json:"principalId,omitempty"` 6841 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 6842 TenantID *string `json:"tenantId,omitempty"` 6843 // Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' 6844 Type ResourceIdentityType `json:"type,omitempty"` 6845 // UserAssignedIdentities - The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 6846 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 6847} 6848 6849// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 6850func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 6851 objectMap := make(map[string]interface{}) 6852 if vmi.Type != "" { 6853 objectMap["type"] = vmi.Type 6854 } 6855 if vmi.UserAssignedIdentities != nil { 6856 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 6857 } 6858 return json.Marshal(objectMap) 6859} 6860 6861// VirtualMachineIdentityUserAssignedIdentitiesValue ... 6862type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 6863 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 6864 PrincipalID *string `json:"principalId,omitempty"` 6865 // ClientID - READ-ONLY; The client id of user assigned identity. 6866 ClientID *string `json:"clientId,omitempty"` 6867} 6868 6869// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. 6870func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 6871 objectMap := make(map[string]interface{}) 6872 return json.Marshal(objectMap) 6873} 6874 6875// VirtualMachineImage describes a Virtual Machine Image. 6876type VirtualMachineImage struct { 6877 autorest.Response `json:"-"` 6878 *VirtualMachineImageProperties `json:"properties,omitempty"` 6879 // Name - The name of the resource. 6880 Name *string `json:"name,omitempty"` 6881 // Location - The supported Azure location of the resource. 6882 Location *string `json:"location,omitempty"` 6883 // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). 6884 Tags map[string]*string `json:"tags"` 6885 // ID - Resource Id 6886 ID *string `json:"id,omitempty"` 6887} 6888 6889// MarshalJSON is the custom marshaler for VirtualMachineImage. 6890func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 6891 objectMap := make(map[string]interface{}) 6892 if vmi.VirtualMachineImageProperties != nil { 6893 objectMap["properties"] = vmi.VirtualMachineImageProperties 6894 } 6895 if vmi.Name != nil { 6896 objectMap["name"] = vmi.Name 6897 } 6898 if vmi.Location != nil { 6899 objectMap["location"] = vmi.Location 6900 } 6901 if vmi.Tags != nil { 6902 objectMap["tags"] = vmi.Tags 6903 } 6904 if vmi.ID != nil { 6905 objectMap["id"] = vmi.ID 6906 } 6907 return json.Marshal(objectMap) 6908} 6909 6910// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 6911func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 6912 var m map[string]*json.RawMessage 6913 err := json.Unmarshal(body, &m) 6914 if err != nil { 6915 return err 6916 } 6917 for k, v := range m { 6918 switch k { 6919 case "properties": 6920 if v != nil { 6921 var virtualMachineImageProperties VirtualMachineImageProperties 6922 err = json.Unmarshal(*v, &virtualMachineImageProperties) 6923 if err != nil { 6924 return err 6925 } 6926 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 6927 } 6928 case "name": 6929 if v != nil { 6930 var name string 6931 err = json.Unmarshal(*v, &name) 6932 if err != nil { 6933 return err 6934 } 6935 vmi.Name = &name 6936 } 6937 case "location": 6938 if v != nil { 6939 var location string 6940 err = json.Unmarshal(*v, &location) 6941 if err != nil { 6942 return err 6943 } 6944 vmi.Location = &location 6945 } 6946 case "tags": 6947 if v != nil { 6948 var tags map[string]*string 6949 err = json.Unmarshal(*v, &tags) 6950 if err != nil { 6951 return err 6952 } 6953 vmi.Tags = tags 6954 } 6955 case "id": 6956 if v != nil { 6957 var ID string 6958 err = json.Unmarshal(*v, &ID) 6959 if err != nil { 6960 return err 6961 } 6962 vmi.ID = &ID 6963 } 6964 } 6965 } 6966 6967 return nil 6968} 6969 6970// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 6971type VirtualMachineImageProperties struct { 6972 Plan *PurchasePlan `json:"plan,omitempty"` 6973 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 6974 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 6975 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 6976} 6977 6978// VirtualMachineImageResource virtual machine image resource information. 6979type VirtualMachineImageResource struct { 6980 // Name - The name of the resource. 6981 Name *string `json:"name,omitempty"` 6982 // Location - The supported Azure location of the resource. 6983 Location *string `json:"location,omitempty"` 6984 // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). 6985 Tags map[string]*string `json:"tags"` 6986 // ID - Resource Id 6987 ID *string `json:"id,omitempty"` 6988} 6989 6990// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 6991func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 6992 objectMap := make(map[string]interface{}) 6993 if vmir.Name != nil { 6994 objectMap["name"] = vmir.Name 6995 } 6996 if vmir.Location != nil { 6997 objectMap["location"] = vmir.Location 6998 } 6999 if vmir.Tags != nil { 7000 objectMap["tags"] = vmir.Tags 7001 } 7002 if vmir.ID != nil { 7003 objectMap["id"] = vmir.ID 7004 } 7005 return json.Marshal(objectMap) 7006} 7007 7008// VirtualMachineInstanceView the instance view of a virtual machine. 7009type VirtualMachineInstanceView struct { 7010 autorest.Response `json:"-"` 7011 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 7012 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 7013 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 7014 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 7015 // ComputerName - The computer name assigned to the virtual machine. 7016 ComputerName *string `json:"computerName,omitempty"` 7017 // OsName - The Operating System running on the virtual machine. 7018 OsName *string `json:"osName,omitempty"` 7019 // OsVersion - The version of Operating System running on the virtual machine. 7020 OsVersion *string `json:"osVersion,omitempty"` 7021 // RdpThumbPrint - The Remote desktop certificate thumbprint. 7022 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 7023 // VMAgent - The VM Agent running on the virtual machine. 7024 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 7025 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 7026 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 7027 // Disks - The virtual machine disk information. 7028 Disks *[]DiskInstanceView `json:"disks,omitempty"` 7029 // Extensions - The extensions information. 7030 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 7031 // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. 7032 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 7033 // Statuses - The resource status information. 7034 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 7035} 7036 7037// VirtualMachineListResult the List Virtual Machine operation response. 7038type VirtualMachineListResult struct { 7039 autorest.Response `json:"-"` 7040 // Value - The list of virtual machines. 7041 Value *[]VirtualMachine `json:"value,omitempty"` 7042 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 7043 NextLink *string `json:"nextLink,omitempty"` 7044} 7045 7046// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 7047type VirtualMachineListResultIterator struct { 7048 i int 7049 page VirtualMachineListResultPage 7050} 7051 7052// NextWithContext advances to the next value. If there was an error making 7053// the request the iterator does not advance and the error is returned. 7054func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 7055 if tracing.IsEnabled() { 7056 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 7057 defer func() { 7058 sc := -1 7059 if iter.Response().Response.Response != nil { 7060 sc = iter.Response().Response.Response.StatusCode 7061 } 7062 tracing.EndSpan(ctx, sc, err) 7063 }() 7064 } 7065 iter.i++ 7066 if iter.i < len(iter.page.Values()) { 7067 return nil 7068 } 7069 err = iter.page.NextWithContext(ctx) 7070 if err != nil { 7071 iter.i-- 7072 return err 7073 } 7074 iter.i = 0 7075 return nil 7076} 7077 7078// Next advances to the next value. If there was an error making 7079// the request the iterator does not advance and the error is returned. 7080// Deprecated: Use NextWithContext() instead. 7081func (iter *VirtualMachineListResultIterator) Next() error { 7082 return iter.NextWithContext(context.Background()) 7083} 7084 7085// NotDone returns true if the enumeration should be started or is not yet complete. 7086func (iter VirtualMachineListResultIterator) NotDone() bool { 7087 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7088} 7089 7090// Response returns the raw server response from the last page request. 7091func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 7092 return iter.page.Response() 7093} 7094 7095// Value returns the current value or a zero-initialized value if the 7096// iterator has advanced beyond the end of the collection. 7097func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 7098 if !iter.page.NotDone() { 7099 return VirtualMachine{} 7100 } 7101 return iter.page.Values()[iter.i] 7102} 7103 7104// Creates a new instance of the VirtualMachineListResultIterator type. 7105func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 7106 return VirtualMachineListResultIterator{page: page} 7107} 7108 7109// IsEmpty returns true if the ListResult contains no values. 7110func (vmlr VirtualMachineListResult) IsEmpty() bool { 7111 return vmlr.Value == nil || len(*vmlr.Value) == 0 7112} 7113 7114// hasNextLink returns true if the NextLink is not empty. 7115func (vmlr VirtualMachineListResult) hasNextLink() bool { 7116 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 7117} 7118 7119// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 7120// It returns nil if no more results exist. 7121func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 7122 if !vmlr.hasNextLink() { 7123 return nil, nil 7124 } 7125 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7126 autorest.AsJSON(), 7127 autorest.AsGet(), 7128 autorest.WithBaseURL(to.String(vmlr.NextLink))) 7129} 7130 7131// VirtualMachineListResultPage contains a page of VirtualMachine values. 7132type VirtualMachineListResultPage struct { 7133 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 7134 vmlr VirtualMachineListResult 7135} 7136 7137// NextWithContext advances to the next page of values. If there was an error making 7138// the request the page does not advance and the error is returned. 7139func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 7140 if tracing.IsEnabled() { 7141 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 7142 defer func() { 7143 sc := -1 7144 if page.Response().Response.Response != nil { 7145 sc = page.Response().Response.Response.StatusCode 7146 } 7147 tracing.EndSpan(ctx, sc, err) 7148 }() 7149 } 7150 for { 7151 next, err := page.fn(ctx, page.vmlr) 7152 if err != nil { 7153 return err 7154 } 7155 page.vmlr = next 7156 if !next.hasNextLink() || !next.IsEmpty() { 7157 break 7158 } 7159 } 7160 return nil 7161} 7162 7163// Next advances to the next page of values. If there was an error making 7164// the request the page does not advance and the error is returned. 7165// Deprecated: Use NextWithContext() instead. 7166func (page *VirtualMachineListResultPage) Next() error { 7167 return page.NextWithContext(context.Background()) 7168} 7169 7170// NotDone returns true if the page enumeration should be started or is not yet complete. 7171func (page VirtualMachineListResultPage) NotDone() bool { 7172 return !page.vmlr.IsEmpty() 7173} 7174 7175// Response returns the raw server response from the last page request. 7176func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 7177 return page.vmlr 7178} 7179 7180// Values returns the slice of values for the current page or nil if there are no values. 7181func (page VirtualMachineListResultPage) Values() []VirtualMachine { 7182 if page.vmlr.IsEmpty() { 7183 return nil 7184 } 7185 return *page.vmlr.Value 7186} 7187 7188// Creates a new instance of the VirtualMachineListResultPage type. 7189func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 7190 return VirtualMachineListResultPage{ 7191 fn: getNextPage, 7192 vmlr: cur, 7193 } 7194} 7195 7196// VirtualMachineProperties describes the properties of a Virtual Machine. 7197type VirtualMachineProperties struct { 7198 // HardwareProfile - Specifies the hardware settings for the virtual machine. 7199 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 7200 // StorageProfile - Specifies the storage settings for the virtual machine disks. 7201 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 7202 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 7203 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 7204 // OsProfile - Specifies the operating system settings for the virtual machine. 7205 OsProfile *OSProfile `json:"osProfile,omitempty"` 7206 // NetworkProfile - Specifies the network interfaces of the virtual machine. 7207 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 7208 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 7209 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 7210 // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. 7211 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 7212 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 7213 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 7214 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 7215 ProvisioningState *string `json:"provisioningState,omitempty"` 7216 // InstanceView - READ-ONLY; The virtual machine instance view. 7217 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 7218 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 7219 LicenseType *string `json:"licenseType,omitempty"` 7220 // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. 7221 VMID *string `json:"vmId,omitempty"` 7222} 7223 7224// MarshalJSON is the custom marshaler for VirtualMachineProperties. 7225func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 7226 objectMap := make(map[string]interface{}) 7227 if vmp.HardwareProfile != nil { 7228 objectMap["hardwareProfile"] = vmp.HardwareProfile 7229 } 7230 if vmp.StorageProfile != nil { 7231 objectMap["storageProfile"] = vmp.StorageProfile 7232 } 7233 if vmp.AdditionalCapabilities != nil { 7234 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 7235 } 7236 if vmp.OsProfile != nil { 7237 objectMap["osProfile"] = vmp.OsProfile 7238 } 7239 if vmp.NetworkProfile != nil { 7240 objectMap["networkProfile"] = vmp.NetworkProfile 7241 } 7242 if vmp.DiagnosticsProfile != nil { 7243 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 7244 } 7245 if vmp.AvailabilitySet != nil { 7246 objectMap["availabilitySet"] = vmp.AvailabilitySet 7247 } 7248 if vmp.ProximityPlacementGroup != nil { 7249 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 7250 } 7251 if vmp.LicenseType != nil { 7252 objectMap["licenseType"] = vmp.LicenseType 7253 } 7254 return json.Marshal(objectMap) 7255} 7256 7257// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 7258// will always be reimaged 7259type VirtualMachineReimageParameters struct { 7260 // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. 7261 TempDisk *bool `json:"tempDisk,omitempty"` 7262} 7263 7264// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 7265type VirtualMachineScaleSet struct { 7266 autorest.Response `json:"-"` 7267 // Sku - The virtual machine scale set sku. 7268 Sku *Sku `json:"sku,omitempty"` 7269 // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. 7270 Plan *Plan `json:"plan,omitempty"` 7271 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 7272 // Identity - The identity of the virtual machine scale set, if configured. 7273 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 7274 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. 7275 Zones *[]string `json:"zones,omitempty"` 7276 // ID - READ-ONLY; Resource Id 7277 ID *string `json:"id,omitempty"` 7278 // Name - READ-ONLY; Resource name 7279 Name *string `json:"name,omitempty"` 7280 // Type - READ-ONLY; Resource type 7281 Type *string `json:"type,omitempty"` 7282 // Location - Resource location 7283 Location *string `json:"location,omitempty"` 7284 // Tags - Resource tags 7285 Tags map[string]*string `json:"tags"` 7286} 7287 7288// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 7289func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 7290 objectMap := make(map[string]interface{}) 7291 if vmss.Sku != nil { 7292 objectMap["sku"] = vmss.Sku 7293 } 7294 if vmss.Plan != nil { 7295 objectMap["plan"] = vmss.Plan 7296 } 7297 if vmss.VirtualMachineScaleSetProperties != nil { 7298 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 7299 } 7300 if vmss.Identity != nil { 7301 objectMap["identity"] = vmss.Identity 7302 } 7303 if vmss.Zones != nil { 7304 objectMap["zones"] = vmss.Zones 7305 } 7306 if vmss.Location != nil { 7307 objectMap["location"] = vmss.Location 7308 } 7309 if vmss.Tags != nil { 7310 objectMap["tags"] = vmss.Tags 7311 } 7312 return json.Marshal(objectMap) 7313} 7314 7315// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 7316func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 7317 var m map[string]*json.RawMessage 7318 err := json.Unmarshal(body, &m) 7319 if err != nil { 7320 return err 7321 } 7322 for k, v := range m { 7323 switch k { 7324 case "sku": 7325 if v != nil { 7326 var sku Sku 7327 err = json.Unmarshal(*v, &sku) 7328 if err != nil { 7329 return err 7330 } 7331 vmss.Sku = &sku 7332 } 7333 case "plan": 7334 if v != nil { 7335 var plan Plan 7336 err = json.Unmarshal(*v, &plan) 7337 if err != nil { 7338 return err 7339 } 7340 vmss.Plan = &plan 7341 } 7342 case "properties": 7343 if v != nil { 7344 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 7345 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 7346 if err != nil { 7347 return err 7348 } 7349 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 7350 } 7351 case "identity": 7352 if v != nil { 7353 var identity VirtualMachineScaleSetIdentity 7354 err = json.Unmarshal(*v, &identity) 7355 if err != nil { 7356 return err 7357 } 7358 vmss.Identity = &identity 7359 } 7360 case "zones": 7361 if v != nil { 7362 var zones []string 7363 err = json.Unmarshal(*v, &zones) 7364 if err != nil { 7365 return err 7366 } 7367 vmss.Zones = &zones 7368 } 7369 case "id": 7370 if v != nil { 7371 var ID string 7372 err = json.Unmarshal(*v, &ID) 7373 if err != nil { 7374 return err 7375 } 7376 vmss.ID = &ID 7377 } 7378 case "name": 7379 if v != nil { 7380 var name string 7381 err = json.Unmarshal(*v, &name) 7382 if err != nil { 7383 return err 7384 } 7385 vmss.Name = &name 7386 } 7387 case "type": 7388 if v != nil { 7389 var typeVar string 7390 err = json.Unmarshal(*v, &typeVar) 7391 if err != nil { 7392 return err 7393 } 7394 vmss.Type = &typeVar 7395 } 7396 case "location": 7397 if v != nil { 7398 var location string 7399 err = json.Unmarshal(*v, &location) 7400 if err != nil { 7401 return err 7402 } 7403 vmss.Location = &location 7404 } 7405 case "tags": 7406 if v != nil { 7407 var tags map[string]*string 7408 err = json.Unmarshal(*v, &tags) 7409 if err != nil { 7410 return err 7411 } 7412 vmss.Tags = tags 7413 } 7414 } 7415 } 7416 7417 return nil 7418} 7419 7420// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 7421type VirtualMachineScaleSetDataDisk struct { 7422 // Name - The disk name. 7423 Name *string `json:"name,omitempty"` 7424 // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. 7425 Lun *int32 `json:"lun,omitempty"` 7426 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 7427 Caching CachingTypes `json:"caching,omitempty"` 7428 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 7429 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 7430 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 7431 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 7432 // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 7433 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7434 // ManagedDisk - The managed disk parameters. 7435 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 7436} 7437 7438// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 7439type VirtualMachineScaleSetExtension struct { 7440 autorest.Response `json:"-"` 7441 // Name - The name of the extension. 7442 Name *string `json:"name,omitempty"` 7443 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 7444 // ID - READ-ONLY; Resource Id 7445 ID *string `json:"id,omitempty"` 7446} 7447 7448// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 7449func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 7450 objectMap := make(map[string]interface{}) 7451 if vmsse.Name != nil { 7452 objectMap["name"] = vmsse.Name 7453 } 7454 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 7455 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 7456 } 7457 return json.Marshal(objectMap) 7458} 7459 7460// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 7461func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 7462 var m map[string]*json.RawMessage 7463 err := json.Unmarshal(body, &m) 7464 if err != nil { 7465 return err 7466 } 7467 for k, v := range m { 7468 switch k { 7469 case "name": 7470 if v != nil { 7471 var name string 7472 err = json.Unmarshal(*v, &name) 7473 if err != nil { 7474 return err 7475 } 7476 vmsse.Name = &name 7477 } 7478 case "properties": 7479 if v != nil { 7480 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 7481 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 7482 if err != nil { 7483 return err 7484 } 7485 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 7486 } 7487 case "id": 7488 if v != nil { 7489 var ID string 7490 err = json.Unmarshal(*v, &ID) 7491 if err != nil { 7492 return err 7493 } 7494 vmsse.ID = &ID 7495 } 7496 } 7497 } 7498 7499 return nil 7500} 7501 7502// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 7503type VirtualMachineScaleSetExtensionListResult struct { 7504 autorest.Response `json:"-"` 7505 // Value - The list of VM scale set extensions. 7506 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 7507 // NextLink - The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. 7508 NextLink *string `json:"nextLink,omitempty"` 7509} 7510 7511// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 7512// VirtualMachineScaleSetExtension values. 7513type VirtualMachineScaleSetExtensionListResultIterator struct { 7514 i int 7515 page VirtualMachineScaleSetExtensionListResultPage 7516} 7517 7518// NextWithContext advances to the next value. If there was an error making 7519// the request the iterator does not advance and the error is returned. 7520func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 7521 if tracing.IsEnabled() { 7522 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 7523 defer func() { 7524 sc := -1 7525 if iter.Response().Response.Response != nil { 7526 sc = iter.Response().Response.Response.StatusCode 7527 } 7528 tracing.EndSpan(ctx, sc, err) 7529 }() 7530 } 7531 iter.i++ 7532 if iter.i < len(iter.page.Values()) { 7533 return nil 7534 } 7535 err = iter.page.NextWithContext(ctx) 7536 if err != nil { 7537 iter.i-- 7538 return err 7539 } 7540 iter.i = 0 7541 return nil 7542} 7543 7544// Next advances to the next value. If there was an error making 7545// the request the iterator does not advance and the error is returned. 7546// Deprecated: Use NextWithContext() instead. 7547func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 7548 return iter.NextWithContext(context.Background()) 7549} 7550 7551// NotDone returns true if the enumeration should be started or is not yet complete. 7552func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 7553 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7554} 7555 7556// Response returns the raw server response from the last page request. 7557func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 7558 return iter.page.Response() 7559} 7560 7561// Value returns the current value or a zero-initialized value if the 7562// iterator has advanced beyond the end of the collection. 7563func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 7564 if !iter.page.NotDone() { 7565 return VirtualMachineScaleSetExtension{} 7566 } 7567 return iter.page.Values()[iter.i] 7568} 7569 7570// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 7571func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 7572 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 7573} 7574 7575// IsEmpty returns true if the ListResult contains no values. 7576func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 7577 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 7578} 7579 7580// hasNextLink returns true if the NextLink is not empty. 7581func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 7582 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 7583} 7584 7585// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 7586// It returns nil if no more results exist. 7587func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 7588 if !vmsselr.hasNextLink() { 7589 return nil, nil 7590 } 7591 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7592 autorest.AsJSON(), 7593 autorest.AsGet(), 7594 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 7595} 7596 7597// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 7598type VirtualMachineScaleSetExtensionListResultPage struct { 7599 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 7600 vmsselr VirtualMachineScaleSetExtensionListResult 7601} 7602 7603// NextWithContext advances to the next page of values. If there was an error making 7604// the request the page does not advance and the error is returned. 7605func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 7606 if tracing.IsEnabled() { 7607 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 7608 defer func() { 7609 sc := -1 7610 if page.Response().Response.Response != nil { 7611 sc = page.Response().Response.Response.StatusCode 7612 } 7613 tracing.EndSpan(ctx, sc, err) 7614 }() 7615 } 7616 for { 7617 next, err := page.fn(ctx, page.vmsselr) 7618 if err != nil { 7619 return err 7620 } 7621 page.vmsselr = next 7622 if !next.hasNextLink() || !next.IsEmpty() { 7623 break 7624 } 7625 } 7626 return nil 7627} 7628 7629// Next advances to the next page of values. If there was an error making 7630// the request the page does not advance and the error is returned. 7631// Deprecated: Use NextWithContext() instead. 7632func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 7633 return page.NextWithContext(context.Background()) 7634} 7635 7636// NotDone returns true if the page enumeration should be started or is not yet complete. 7637func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 7638 return !page.vmsselr.IsEmpty() 7639} 7640 7641// Response returns the raw server response from the last page request. 7642func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 7643 return page.vmsselr 7644} 7645 7646// Values returns the slice of values for the current page or nil if there are no values. 7647func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 7648 if page.vmsselr.IsEmpty() { 7649 return nil 7650 } 7651 return *page.vmsselr.Value 7652} 7653 7654// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 7655func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 7656 return VirtualMachineScaleSetExtensionListResultPage{ 7657 fn: getNextPage, 7658 vmsselr: cur, 7659 } 7660} 7661 7662// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 7663type VirtualMachineScaleSetExtensionProfile struct { 7664 // Extensions - The virtual machine scale set child extension resources. 7665 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 7666} 7667 7668// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 7669// Extension. 7670type VirtualMachineScaleSetExtensionProperties struct { 7671 // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. 7672 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 7673 // Publisher - The name of the extension handler publisher. 7674 Publisher *string `json:"publisher,omitempty"` 7675 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 7676 Type *string `json:"type,omitempty"` 7677 // TypeHandlerVersion - Specifies the version of the script handler. 7678 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 7679 // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. 7680 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 7681 // Settings - Json formatted public settings for the extension. 7682 Settings interface{} `json:"settings,omitempty"` 7683 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 7684 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 7685 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 7686 ProvisioningState *string `json:"provisioningState,omitempty"` 7687 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 7688 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 7689} 7690 7691// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 7692func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 7693 objectMap := make(map[string]interface{}) 7694 if vmssep.ForceUpdateTag != nil { 7695 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 7696 } 7697 if vmssep.Publisher != nil { 7698 objectMap["publisher"] = vmssep.Publisher 7699 } 7700 if vmssep.Type != nil { 7701 objectMap["type"] = vmssep.Type 7702 } 7703 if vmssep.TypeHandlerVersion != nil { 7704 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 7705 } 7706 if vmssep.AutoUpgradeMinorVersion != nil { 7707 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 7708 } 7709 if vmssep.Settings != nil { 7710 objectMap["settings"] = vmssep.Settings 7711 } 7712 if vmssep.ProtectedSettings != nil { 7713 objectMap["protectedSettings"] = vmssep.ProtectedSettings 7714 } 7715 if vmssep.ProvisionAfterExtensions != nil { 7716 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 7717 } 7718 return json.Marshal(objectMap) 7719} 7720 7721// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 7722// results of a long-running operation. 7723type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 7724 azure.FutureAPI 7725 // Result returns the result of the asynchronous operation. 7726 // If the operation has not completed it will return an error. 7727 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 7728} 7729 7730// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7731func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7732 var azFuture azure.Future 7733 if err := json.Unmarshal(body, &azFuture); err != nil { 7734 return err 7735 } 7736 future.FutureAPI = &azFuture 7737 future.Result = future.result 7738 return nil 7739} 7740 7741// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 7742func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 7743 var done bool 7744 done, err = future.DoneWithContext(context.Background(), client) 7745 if err != nil { 7746 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7747 return 7748 } 7749 if !done { 7750 vmsse.Response.Response = future.Response() 7751 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 7752 return 7753 } 7754 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7755 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 7756 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 7757 if err != nil { 7758 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 7759 } 7760 } 7761 return 7762} 7763 7764// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 7765// a long-running operation. 7766type VirtualMachineScaleSetExtensionsDeleteFuture struct { 7767 azure.FutureAPI 7768 // Result returns the result of the asynchronous operation. 7769 // If the operation has not completed it will return an error. 7770 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 7771} 7772 7773// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7774func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 7775 var azFuture azure.Future 7776 if err := json.Unmarshal(body, &azFuture); err != nil { 7777 return err 7778 } 7779 future.FutureAPI = &azFuture 7780 future.Result = future.result 7781 return nil 7782} 7783 7784// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 7785func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 7786 var done bool 7787 done, err = future.DoneWithContext(context.Background(), client) 7788 if err != nil { 7789 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 7790 return 7791 } 7792 if !done { 7793 ar.Response = future.Response() 7794 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 7795 return 7796 } 7797 ar.Response = future.Response() 7798 return 7799} 7800 7801// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 7802type VirtualMachineScaleSetIdentity struct { 7803 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 7804 PrincipalID *string `json:"principalId,omitempty"` 7805 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 7806 TenantID *string `json:"tenantId,omitempty"` 7807 // Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' 7808 Type ResourceIdentityType `json:"type,omitempty"` 7809 // UserAssignedIdentities - The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 7810 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 7811} 7812 7813// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 7814func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 7815 objectMap := make(map[string]interface{}) 7816 if vmssi.Type != "" { 7817 objectMap["type"] = vmssi.Type 7818 } 7819 if vmssi.UserAssignedIdentities != nil { 7820 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 7821 } 7822 return json.Marshal(objectMap) 7823} 7824 7825// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 7826type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 7827 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 7828 PrincipalID *string `json:"principalId,omitempty"` 7829 // ClientID - READ-ONLY; The client id of user assigned identity. 7830 ClientID *string `json:"clientId,omitempty"` 7831} 7832 7833// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. 7834func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 7835 objectMap := make(map[string]interface{}) 7836 return json.Marshal(objectMap) 7837} 7838 7839// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 7840type VirtualMachineScaleSetInstanceView struct { 7841 autorest.Response `json:"-"` 7842 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 7843 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 7844 // Extensions - READ-ONLY; The extensions information. 7845 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 7846 // Statuses - The resource status information. 7847 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 7848} 7849 7850// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 7851func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 7852 objectMap := make(map[string]interface{}) 7853 if vmssiv.Statuses != nil { 7854 objectMap["statuses"] = vmssiv.Statuses 7855 } 7856 return json.Marshal(objectMap) 7857} 7858 7859// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 7860// a virtual machine scale set. 7861type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 7862 // StatusesSummary - READ-ONLY; The extensions information. 7863 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 7864} 7865 7866// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. 7867func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 7868 objectMap := make(map[string]interface{}) 7869 return json.Marshal(objectMap) 7870} 7871 7872// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 7873// configuration. 7874type VirtualMachineScaleSetIPConfiguration struct { 7875 // Name - The IP configuration name. 7876 Name *string `json:"name,omitempty"` 7877 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 7878 // ID - Resource Id 7879 ID *string `json:"id,omitempty"` 7880} 7881 7882// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 7883func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 7884 objectMap := make(map[string]interface{}) 7885 if vmssic.Name != nil { 7886 objectMap["name"] = vmssic.Name 7887 } 7888 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 7889 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 7890 } 7891 if vmssic.ID != nil { 7892 objectMap["id"] = vmssic.ID 7893 } 7894 return json.Marshal(objectMap) 7895} 7896 7897// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 7898func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 7899 var m map[string]*json.RawMessage 7900 err := json.Unmarshal(body, &m) 7901 if err != nil { 7902 return err 7903 } 7904 for k, v := range m { 7905 switch k { 7906 case "name": 7907 if v != nil { 7908 var name string 7909 err = json.Unmarshal(*v, &name) 7910 if err != nil { 7911 return err 7912 } 7913 vmssic.Name = &name 7914 } 7915 case "properties": 7916 if v != nil { 7917 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 7918 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 7919 if err != nil { 7920 return err 7921 } 7922 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 7923 } 7924 case "id": 7925 if v != nil { 7926 var ID string 7927 err = json.Unmarshal(*v, &ID) 7928 if err != nil { 7929 return err 7930 } 7931 vmssic.ID = &ID 7932 } 7933 } 7934 } 7935 7936 return nil 7937} 7938 7939// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 7940// IP configuration properties. 7941type VirtualMachineScaleSetIPConfigurationProperties struct { 7942 // Subnet - Specifies the identifier of the subnet. 7943 Subnet *APIEntityReference `json:"subnet,omitempty"` 7944 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 7945 Primary *bool `json:"primary,omitempty"` 7946 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 7947 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 7948 // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 7949 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 7950 // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. 7951 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 7952 // ApplicationSecurityGroups - Specifies an array of references to application security group. 7953 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 7954 // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. 7955 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 7956 // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer 7957 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 7958} 7959 7960// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 7961type VirtualMachineScaleSetIPTag struct { 7962 // IPTagType - IP tag type. Example: FirstPartyUsage. 7963 IPTagType *string `json:"ipTagType,omitempty"` 7964 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 7965 Tag *string `json:"tag,omitempty"` 7966} 7967 7968// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 7969// operation response. 7970type VirtualMachineScaleSetListOSUpgradeHistory struct { 7971 autorest.Response `json:"-"` 7972 // Value - The list of OS upgrades performed on the virtual machine scale set. 7973 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 7974 // NextLink - The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. 7975 NextLink *string `json:"nextLink,omitempty"` 7976} 7977 7978// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 7979// UpgradeOperationHistoricalStatusInfo values. 7980type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 7981 i int 7982 page VirtualMachineScaleSetListOSUpgradeHistoryPage 7983} 7984 7985// NextWithContext advances to the next value. If there was an error making 7986// the request the iterator does not advance and the error is returned. 7987func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 7988 if tracing.IsEnabled() { 7989 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 7990 defer func() { 7991 sc := -1 7992 if iter.Response().Response.Response != nil { 7993 sc = iter.Response().Response.Response.StatusCode 7994 } 7995 tracing.EndSpan(ctx, sc, err) 7996 }() 7997 } 7998 iter.i++ 7999 if iter.i < len(iter.page.Values()) { 8000 return nil 8001 } 8002 err = iter.page.NextWithContext(ctx) 8003 if err != nil { 8004 iter.i-- 8005 return err 8006 } 8007 iter.i = 0 8008 return nil 8009} 8010 8011// Next advances to the next value. If there was an error making 8012// the request the iterator does not advance and the error is returned. 8013// Deprecated: Use NextWithContext() instead. 8014func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 8015 return iter.NextWithContext(context.Background()) 8016} 8017 8018// NotDone returns true if the enumeration should be started or is not yet complete. 8019func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 8020 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8021} 8022 8023// Response returns the raw server response from the last page request. 8024func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 8025 return iter.page.Response() 8026} 8027 8028// Value returns the current value or a zero-initialized value if the 8029// iterator has advanced beyond the end of the collection. 8030func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 8031 if !iter.page.NotDone() { 8032 return UpgradeOperationHistoricalStatusInfo{} 8033 } 8034 return iter.page.Values()[iter.i] 8035} 8036 8037// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 8038func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 8039 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 8040} 8041 8042// IsEmpty returns true if the ListResult contains no values. 8043func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 8044 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 8045} 8046 8047// hasNextLink returns true if the NextLink is not empty. 8048func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 8049 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 8050} 8051 8052// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 8053// It returns nil if no more results exist. 8054func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 8055 if !vmsslouh.hasNextLink() { 8056 return nil, nil 8057 } 8058 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8059 autorest.AsJSON(), 8060 autorest.AsGet(), 8061 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 8062} 8063 8064// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 8065// values. 8066type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 8067 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 8068 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 8069} 8070 8071// NextWithContext advances to the next page of values. If there was an error making 8072// the request the page does not advance and the error is returned. 8073func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 8074 if tracing.IsEnabled() { 8075 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 8076 defer func() { 8077 sc := -1 8078 if page.Response().Response.Response != nil { 8079 sc = page.Response().Response.Response.StatusCode 8080 } 8081 tracing.EndSpan(ctx, sc, err) 8082 }() 8083 } 8084 for { 8085 next, err := page.fn(ctx, page.vmsslouh) 8086 if err != nil { 8087 return err 8088 } 8089 page.vmsslouh = next 8090 if !next.hasNextLink() || !next.IsEmpty() { 8091 break 8092 } 8093 } 8094 return nil 8095} 8096 8097// Next advances to the next page of values. If there was an error making 8098// the request the page does not advance and the error is returned. 8099// Deprecated: Use NextWithContext() instead. 8100func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 8101 return page.NextWithContext(context.Background()) 8102} 8103 8104// NotDone returns true if the page enumeration should be started or is not yet complete. 8105func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 8106 return !page.vmsslouh.IsEmpty() 8107} 8108 8109// Response returns the raw server response from the last page request. 8110func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 8111 return page.vmsslouh 8112} 8113 8114// Values returns the slice of values for the current page or nil if there are no values. 8115func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 8116 if page.vmsslouh.IsEmpty() { 8117 return nil 8118 } 8119 return *page.vmsslouh.Value 8120} 8121 8122// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 8123func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 8124 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 8125 fn: getNextPage, 8126 vmsslouh: cur, 8127 } 8128} 8129 8130// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 8131type VirtualMachineScaleSetListResult struct { 8132 autorest.Response `json:"-"` 8133 // Value - The list of virtual machine scale sets. 8134 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 8135 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 8136 NextLink *string `json:"nextLink,omitempty"` 8137} 8138 8139// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 8140// values. 8141type VirtualMachineScaleSetListResultIterator struct { 8142 i int 8143 page VirtualMachineScaleSetListResultPage 8144} 8145 8146// NextWithContext advances to the next value. If there was an error making 8147// the request the iterator does not advance and the error is returned. 8148func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 8149 if tracing.IsEnabled() { 8150 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 8151 defer func() { 8152 sc := -1 8153 if iter.Response().Response.Response != nil { 8154 sc = iter.Response().Response.Response.StatusCode 8155 } 8156 tracing.EndSpan(ctx, sc, err) 8157 }() 8158 } 8159 iter.i++ 8160 if iter.i < len(iter.page.Values()) { 8161 return nil 8162 } 8163 err = iter.page.NextWithContext(ctx) 8164 if err != nil { 8165 iter.i-- 8166 return err 8167 } 8168 iter.i = 0 8169 return nil 8170} 8171 8172// Next advances to the next value. If there was an error making 8173// the request the iterator does not advance and the error is returned. 8174// Deprecated: Use NextWithContext() instead. 8175func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 8176 return iter.NextWithContext(context.Background()) 8177} 8178 8179// NotDone returns true if the enumeration should be started or is not yet complete. 8180func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 8181 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8182} 8183 8184// Response returns the raw server response from the last page request. 8185func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 8186 return iter.page.Response() 8187} 8188 8189// Value returns the current value or a zero-initialized value if the 8190// iterator has advanced beyond the end of the collection. 8191func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 8192 if !iter.page.NotDone() { 8193 return VirtualMachineScaleSet{} 8194 } 8195 return iter.page.Values()[iter.i] 8196} 8197 8198// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 8199func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 8200 return VirtualMachineScaleSetListResultIterator{page: page} 8201} 8202 8203// IsEmpty returns true if the ListResult contains no values. 8204func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 8205 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 8206} 8207 8208// hasNextLink returns true if the NextLink is not empty. 8209func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 8210 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 8211} 8212 8213// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 8214// It returns nil if no more results exist. 8215func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 8216 if !vmsslr.hasNextLink() { 8217 return nil, nil 8218 } 8219 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8220 autorest.AsJSON(), 8221 autorest.AsGet(), 8222 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 8223} 8224 8225// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 8226type VirtualMachineScaleSetListResultPage struct { 8227 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 8228 vmsslr VirtualMachineScaleSetListResult 8229} 8230 8231// NextWithContext advances to the next page of values. If there was an error making 8232// the request the page does not advance and the error is returned. 8233func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 8234 if tracing.IsEnabled() { 8235 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 8236 defer func() { 8237 sc := -1 8238 if page.Response().Response.Response != nil { 8239 sc = page.Response().Response.Response.StatusCode 8240 } 8241 tracing.EndSpan(ctx, sc, err) 8242 }() 8243 } 8244 for { 8245 next, err := page.fn(ctx, page.vmsslr) 8246 if err != nil { 8247 return err 8248 } 8249 page.vmsslr = next 8250 if !next.hasNextLink() || !next.IsEmpty() { 8251 break 8252 } 8253 } 8254 return nil 8255} 8256 8257// Next advances to the next page of values. If there was an error making 8258// the request the page does not advance and the error is returned. 8259// Deprecated: Use NextWithContext() instead. 8260func (page *VirtualMachineScaleSetListResultPage) Next() error { 8261 return page.NextWithContext(context.Background()) 8262} 8263 8264// NotDone returns true if the page enumeration should be started or is not yet complete. 8265func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 8266 return !page.vmsslr.IsEmpty() 8267} 8268 8269// Response returns the raw server response from the last page request. 8270func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 8271 return page.vmsslr 8272} 8273 8274// Values returns the slice of values for the current page or nil if there are no values. 8275func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 8276 if page.vmsslr.IsEmpty() { 8277 return nil 8278 } 8279 return *page.vmsslr.Value 8280} 8281 8282// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 8283func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 8284 return VirtualMachineScaleSetListResultPage{ 8285 fn: getNextPage, 8286 vmsslr: cur, 8287 } 8288} 8289 8290// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 8291type VirtualMachineScaleSetListSkusResult struct { 8292 autorest.Response `json:"-"` 8293 // Value - The list of skus available for the virtual machine scale set. 8294 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 8295 // NextLink - The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus. 8296 NextLink *string `json:"nextLink,omitempty"` 8297} 8298 8299// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 8300// VirtualMachineScaleSetSku values. 8301type VirtualMachineScaleSetListSkusResultIterator struct { 8302 i int 8303 page VirtualMachineScaleSetListSkusResultPage 8304} 8305 8306// NextWithContext advances to the next value. If there was an error making 8307// the request the iterator does not advance and the error is returned. 8308func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 8309 if tracing.IsEnabled() { 8310 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 8311 defer func() { 8312 sc := -1 8313 if iter.Response().Response.Response != nil { 8314 sc = iter.Response().Response.Response.StatusCode 8315 } 8316 tracing.EndSpan(ctx, sc, err) 8317 }() 8318 } 8319 iter.i++ 8320 if iter.i < len(iter.page.Values()) { 8321 return nil 8322 } 8323 err = iter.page.NextWithContext(ctx) 8324 if err != nil { 8325 iter.i-- 8326 return err 8327 } 8328 iter.i = 0 8329 return nil 8330} 8331 8332// Next advances to the next value. If there was an error making 8333// the request the iterator does not advance and the error is returned. 8334// Deprecated: Use NextWithContext() instead. 8335func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 8336 return iter.NextWithContext(context.Background()) 8337} 8338 8339// NotDone returns true if the enumeration should be started or is not yet complete. 8340func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 8341 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8342} 8343 8344// Response returns the raw server response from the last page request. 8345func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 8346 return iter.page.Response() 8347} 8348 8349// Value returns the current value or a zero-initialized value if the 8350// iterator has advanced beyond the end of the collection. 8351func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 8352 if !iter.page.NotDone() { 8353 return VirtualMachineScaleSetSku{} 8354 } 8355 return iter.page.Values()[iter.i] 8356} 8357 8358// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 8359func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 8360 return VirtualMachineScaleSetListSkusResultIterator{page: page} 8361} 8362 8363// IsEmpty returns true if the ListResult contains no values. 8364func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 8365 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 8366} 8367 8368// hasNextLink returns true if the NextLink is not empty. 8369func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 8370 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 8371} 8372 8373// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 8374// It returns nil if no more results exist. 8375func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 8376 if !vmsslsr.hasNextLink() { 8377 return nil, nil 8378 } 8379 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8380 autorest.AsJSON(), 8381 autorest.AsGet(), 8382 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 8383} 8384 8385// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 8386type VirtualMachineScaleSetListSkusResultPage struct { 8387 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 8388 vmsslsr VirtualMachineScaleSetListSkusResult 8389} 8390 8391// NextWithContext advances to the next page of values. If there was an error making 8392// the request the page does not advance and the error is returned. 8393func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 8394 if tracing.IsEnabled() { 8395 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 8396 defer func() { 8397 sc := -1 8398 if page.Response().Response.Response != nil { 8399 sc = page.Response().Response.Response.StatusCode 8400 } 8401 tracing.EndSpan(ctx, sc, err) 8402 }() 8403 } 8404 for { 8405 next, err := page.fn(ctx, page.vmsslsr) 8406 if err != nil { 8407 return err 8408 } 8409 page.vmsslsr = next 8410 if !next.hasNextLink() || !next.IsEmpty() { 8411 break 8412 } 8413 } 8414 return nil 8415} 8416 8417// Next advances to the next page of values. If there was an error making 8418// the request the page does not advance and the error is returned. 8419// Deprecated: Use NextWithContext() instead. 8420func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 8421 return page.NextWithContext(context.Background()) 8422} 8423 8424// NotDone returns true if the page enumeration should be started or is not yet complete. 8425func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 8426 return !page.vmsslsr.IsEmpty() 8427} 8428 8429// Response returns the raw server response from the last page request. 8430func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 8431 return page.vmsslsr 8432} 8433 8434// Values returns the slice of values for the current page or nil if there are no values. 8435func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 8436 if page.vmsslsr.IsEmpty() { 8437 return nil 8438 } 8439 return *page.vmsslsr.Value 8440} 8441 8442// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 8443func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 8444 return VirtualMachineScaleSetListSkusResultPage{ 8445 fn: getNextPage, 8446 vmsslsr: cur, 8447 } 8448} 8449 8450// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 8451type VirtualMachineScaleSetListWithLinkResult struct { 8452 autorest.Response `json:"-"` 8453 // Value - The list of virtual machine scale sets. 8454 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 8455 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets. 8456 NextLink *string `json:"nextLink,omitempty"` 8457} 8458 8459// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 8460// VirtualMachineScaleSet values. 8461type VirtualMachineScaleSetListWithLinkResultIterator struct { 8462 i int 8463 page VirtualMachineScaleSetListWithLinkResultPage 8464} 8465 8466// NextWithContext advances to the next value. If there was an error making 8467// the request the iterator does not advance and the error is returned. 8468func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 8469 if tracing.IsEnabled() { 8470 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 8471 defer func() { 8472 sc := -1 8473 if iter.Response().Response.Response != nil { 8474 sc = iter.Response().Response.Response.StatusCode 8475 } 8476 tracing.EndSpan(ctx, sc, err) 8477 }() 8478 } 8479 iter.i++ 8480 if iter.i < len(iter.page.Values()) { 8481 return nil 8482 } 8483 err = iter.page.NextWithContext(ctx) 8484 if err != nil { 8485 iter.i-- 8486 return err 8487 } 8488 iter.i = 0 8489 return nil 8490} 8491 8492// Next advances to the next value. If there was an error making 8493// the request the iterator does not advance and the error is returned. 8494// Deprecated: Use NextWithContext() instead. 8495func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 8496 return iter.NextWithContext(context.Background()) 8497} 8498 8499// NotDone returns true if the enumeration should be started or is not yet complete. 8500func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 8501 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8502} 8503 8504// Response returns the raw server response from the last page request. 8505func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 8506 return iter.page.Response() 8507} 8508 8509// Value returns the current value or a zero-initialized value if the 8510// iterator has advanced beyond the end of the collection. 8511func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 8512 if !iter.page.NotDone() { 8513 return VirtualMachineScaleSet{} 8514 } 8515 return iter.page.Values()[iter.i] 8516} 8517 8518// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 8519func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 8520 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 8521} 8522 8523// IsEmpty returns true if the ListResult contains no values. 8524func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 8525 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 8526} 8527 8528// hasNextLink returns true if the NextLink is not empty. 8529func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 8530 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 8531} 8532 8533// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 8534// It returns nil if no more results exist. 8535func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 8536 if !vmsslwlr.hasNextLink() { 8537 return nil, nil 8538 } 8539 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8540 autorest.AsJSON(), 8541 autorest.AsGet(), 8542 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 8543} 8544 8545// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 8546type VirtualMachineScaleSetListWithLinkResultPage struct { 8547 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 8548 vmsslwlr VirtualMachineScaleSetListWithLinkResult 8549} 8550 8551// NextWithContext advances to the next page of values. If there was an error making 8552// the request the page does not advance and the error is returned. 8553func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 8554 if tracing.IsEnabled() { 8555 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 8556 defer func() { 8557 sc := -1 8558 if page.Response().Response.Response != nil { 8559 sc = page.Response().Response.Response.StatusCode 8560 } 8561 tracing.EndSpan(ctx, sc, err) 8562 }() 8563 } 8564 for { 8565 next, err := page.fn(ctx, page.vmsslwlr) 8566 if err != nil { 8567 return err 8568 } 8569 page.vmsslwlr = next 8570 if !next.hasNextLink() || !next.IsEmpty() { 8571 break 8572 } 8573 } 8574 return nil 8575} 8576 8577// Next advances to the next page of values. If there was an error making 8578// the request the page does not advance and the error is returned. 8579// Deprecated: Use NextWithContext() instead. 8580func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 8581 return page.NextWithContext(context.Background()) 8582} 8583 8584// NotDone returns true if the page enumeration should be started or is not yet complete. 8585func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 8586 return !page.vmsslwlr.IsEmpty() 8587} 8588 8589// Response returns the raw server response from the last page request. 8590func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 8591 return page.vmsslwlr 8592} 8593 8594// Values returns the slice of values for the current page or nil if there are no values. 8595func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 8596 if page.vmsslwlr.IsEmpty() { 8597 return nil 8598 } 8599 return *page.vmsslwlr.Value 8600} 8601 8602// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 8603func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 8604 return VirtualMachineScaleSetListWithLinkResultPage{ 8605 fn: getNextPage, 8606 vmsslwlr: cur, 8607 } 8608} 8609 8610// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 8611type VirtualMachineScaleSetManagedDiskParameters struct { 8612 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 8613 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8614} 8615 8616// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 8617// network configurations. 8618type VirtualMachineScaleSetNetworkConfiguration struct { 8619 // Name - The network configuration name. 8620 Name *string `json:"name,omitempty"` 8621 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 8622 // ID - Resource Id 8623 ID *string `json:"id,omitempty"` 8624} 8625 8626// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 8627func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 8628 objectMap := make(map[string]interface{}) 8629 if vmssnc.Name != nil { 8630 objectMap["name"] = vmssnc.Name 8631 } 8632 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 8633 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 8634 } 8635 if vmssnc.ID != nil { 8636 objectMap["id"] = vmssnc.ID 8637 } 8638 return json.Marshal(objectMap) 8639} 8640 8641// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 8642func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 8643 var m map[string]*json.RawMessage 8644 err := json.Unmarshal(body, &m) 8645 if err != nil { 8646 return err 8647 } 8648 for k, v := range m { 8649 switch k { 8650 case "name": 8651 if v != nil { 8652 var name string 8653 err = json.Unmarshal(*v, &name) 8654 if err != nil { 8655 return err 8656 } 8657 vmssnc.Name = &name 8658 } 8659 case "properties": 8660 if v != nil { 8661 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 8662 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 8663 if err != nil { 8664 return err 8665 } 8666 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 8667 } 8668 case "id": 8669 if v != nil { 8670 var ID string 8671 err = json.Unmarshal(*v, &ID) 8672 if err != nil { 8673 return err 8674 } 8675 vmssnc.ID = &ID 8676 } 8677 } 8678 } 8679 8680 return nil 8681} 8682 8683// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 8684// configuration's DNS settings. 8685type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 8686 // DNSServers - List of DNS servers IP addresses 8687 DNSServers *[]string `json:"dnsServers,omitempty"` 8688} 8689 8690// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 8691// profile's IP configuration. 8692type VirtualMachineScaleSetNetworkConfigurationProperties struct { 8693 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 8694 Primary *bool `json:"primary,omitempty"` 8695 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 8696 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 8697 // NetworkSecurityGroup - The network security group. 8698 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 8699 // DNSSettings - The dns settings to be applied on the network interfaces. 8700 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 8701 // IPConfigurations - Specifies the IP configurations of the network interface. 8702 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 8703 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 8704 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 8705} 8706 8707// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 8708type VirtualMachineScaleSetNetworkProfile struct { 8709 // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. 8710 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 8711 // NetworkInterfaceConfigurations - The list of network configurations. 8712 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 8713} 8714 8715// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 8716type VirtualMachineScaleSetOSDisk struct { 8717 // Name - The disk name. 8718 Name *string `json:"name,omitempty"` 8719 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 8720 Caching CachingTypes `json:"caching,omitempty"` 8721 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 8722 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 8723 // CreateOption - Specifies how the virtual machines in the scale set should be created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 8724 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 8725 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 8726 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 8727 // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 8728 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8729 // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 8730 OsType OperatingSystemTypes `json:"osType,omitempty"` 8731 // Image - Specifies information about the unmanaged user image to base the scale set on. 8732 Image *VirtualHardDisk `json:"image,omitempty"` 8733 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 8734 VhdContainers *[]string `json:"vhdContainers,omitempty"` 8735 // ManagedDisk - The managed disk parameters. 8736 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 8737} 8738 8739// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 8740type VirtualMachineScaleSetOSProfile struct { 8741 // ComputerNamePrefix - Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. 8742 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 8743 // AdminUsername - Specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 8744 AdminUsername *string `json:"adminUsername,omitempty"` 8745 // AdminPassword - Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) 8746 AdminPassword *string `json:"adminPassword,omitempty"` 8747 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 8748 CustomData *string `json:"customData,omitempty"` 8749 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 8750 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 8751 // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 8752 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 8753 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 8754 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 8755} 8756 8757// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 8758type VirtualMachineScaleSetProperties struct { 8759 // UpgradePolicy - The upgrade policy. 8760 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 8761 // AutomaticRepairsPolicy - Policy for automatic repairs. 8762 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 8763 // VirtualMachineProfile - The virtual machine profile. 8764 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 8765 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 8766 ProvisioningState *string `json:"provisioningState,omitempty"` 8767 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 8768 Overprovision *bool `json:"overprovision,omitempty"` 8769 // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. 8770 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 8771 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 8772 UniqueID *string `json:"uniqueId,omitempty"` 8773 // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. 8774 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 8775 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 8776 ZoneBalance *bool `json:"zoneBalance,omitempty"` 8777 // PlatformFaultDomainCount - Fault Domain count for each placement group. 8778 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 8779 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 8780 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 8781} 8782 8783// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 8784func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 8785 objectMap := make(map[string]interface{}) 8786 if vmssp.UpgradePolicy != nil { 8787 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 8788 } 8789 if vmssp.AutomaticRepairsPolicy != nil { 8790 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 8791 } 8792 if vmssp.VirtualMachineProfile != nil { 8793 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 8794 } 8795 if vmssp.Overprovision != nil { 8796 objectMap["overprovision"] = vmssp.Overprovision 8797 } 8798 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 8799 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 8800 } 8801 if vmssp.SinglePlacementGroup != nil { 8802 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 8803 } 8804 if vmssp.ZoneBalance != nil { 8805 objectMap["zoneBalance"] = vmssp.ZoneBalance 8806 } 8807 if vmssp.PlatformFaultDomainCount != nil { 8808 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 8809 } 8810 if vmssp.ProximityPlacementGroup != nil { 8811 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 8812 } 8813 return json.Marshal(objectMap) 8814} 8815 8816// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 8817// Configuration's PublicIPAddress configuration 8818type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 8819 // Name - The publicIP address configuration name. 8820 Name *string `json:"name,omitempty"` 8821 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 8822} 8823 8824// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 8825func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 8826 objectMap := make(map[string]interface{}) 8827 if vmsspiac.Name != nil { 8828 objectMap["name"] = vmsspiac.Name 8829 } 8830 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 8831 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 8832 } 8833 return json.Marshal(objectMap) 8834} 8835 8836// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 8837func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 8838 var m map[string]*json.RawMessage 8839 err := json.Unmarshal(body, &m) 8840 if err != nil { 8841 return err 8842 } 8843 for k, v := range m { 8844 switch k { 8845 case "name": 8846 if v != nil { 8847 var name string 8848 err = json.Unmarshal(*v, &name) 8849 if err != nil { 8850 return err 8851 } 8852 vmsspiac.Name = &name 8853 } 8854 case "properties": 8855 if v != nil { 8856 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 8857 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 8858 if err != nil { 8859 return err 8860 } 8861 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 8862 } 8863 } 8864 } 8865 8866 return nil 8867} 8868 8869// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 8870// network configuration's DNS settings. 8871type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 8872 // DomainNameLabel - The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created 8873 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 8874} 8875 8876// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 8877// Configuration's PublicIPAddress configuration 8878type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 8879 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 8880 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 8881 // DNSSettings - The dns settings to be applied on the publicIP addresses . 8882 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 8883 // IPTags - The list of IP tags associated with the public IP address. 8884 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 8885 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 8886 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 8887} 8888 8889// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 8890type VirtualMachineScaleSetReimageParameters struct { 8891 // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. 8892 InstanceIds *[]string `json:"instanceIds,omitempty"` 8893 // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. 8894 TempDisk *bool `json:"tempDisk,omitempty"` 8895} 8896 8897// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 8898// results of a long-running operation. 8899type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 8900 azure.FutureAPI 8901 // Result returns the result of the asynchronous operation. 8902 // If the operation has not completed it will return an error. 8903 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 8904} 8905 8906// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8907func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 8908 var azFuture azure.Future 8909 if err := json.Unmarshal(body, &azFuture); err != nil { 8910 return err 8911 } 8912 future.FutureAPI = &azFuture 8913 future.Result = future.result 8914 return nil 8915} 8916 8917// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 8918func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 8919 var done bool 8920 done, err = future.DoneWithContext(context.Background(), client) 8921 if err != nil { 8922 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 8923 return 8924 } 8925 if !done { 8926 ar.Response = future.Response() 8927 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 8928 return 8929 } 8930 ar.Response = future.Response() 8931 return 8932} 8933 8934// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 8935// retrieving the results of a long-running operation. 8936type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 8937 azure.FutureAPI 8938 // Result returns the result of the asynchronous operation. 8939 // If the operation has not completed it will return an error. 8940 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 8941} 8942 8943// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8944func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 8945 var azFuture azure.Future 8946 if err := json.Unmarshal(body, &azFuture); err != nil { 8947 return err 8948 } 8949 future.FutureAPI = &azFuture 8950 future.Result = future.result 8951 return nil 8952} 8953 8954// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 8955func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 8956 var done bool 8957 done, err = future.DoneWithContext(context.Background(), client) 8958 if err != nil { 8959 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 8960 return 8961 } 8962 if !done { 8963 ar.Response = future.Response() 8964 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 8965 return 8966 } 8967 ar.Response = future.Response() 8968 return 8969} 8970 8971// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 8972// the results of a long-running operation. 8973type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 8974 azure.FutureAPI 8975 // Result returns the result of the asynchronous operation. 8976 // If the operation has not completed it will return an error. 8977 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 8978} 8979 8980// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8981func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 8982 var azFuture azure.Future 8983 if err := json.Unmarshal(body, &azFuture); err != nil { 8984 return err 8985 } 8986 future.FutureAPI = &azFuture 8987 future.Result = future.result 8988 return nil 8989} 8990 8991// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 8992func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 8993 var done bool 8994 done, err = future.DoneWithContext(context.Background(), client) 8995 if err != nil { 8996 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 8997 return 8998 } 8999 if !done { 9000 ar.Response = future.Response() 9001 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 9002 return 9003 } 9004 ar.Response = future.Response() 9005 return 9006} 9007 9008// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 9009// a long-running operation. 9010type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 9011 azure.FutureAPI 9012 // Result returns the result of the asynchronous operation. 9013 // If the operation has not completed it will return an error. 9014 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 9015} 9016 9017// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9018func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9019 var azFuture azure.Future 9020 if err := json.Unmarshal(body, &azFuture); err != nil { 9021 return err 9022 } 9023 future.FutureAPI = &azFuture 9024 future.Result = future.result 9025 return nil 9026} 9027 9028// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 9029func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 9030 var done bool 9031 done, err = future.DoneWithContext(context.Background(), client) 9032 if err != nil { 9033 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9034 return 9035 } 9036 if !done { 9037 vmss.Response.Response = future.Response() 9038 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 9039 return 9040 } 9041 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9042 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 9043 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 9044 if err != nil { 9045 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 9046 } 9047 } 9048 return 9049} 9050 9051// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 9052// long-running operation. 9053type VirtualMachineScaleSetsDeallocateFuture struct { 9054 azure.FutureAPI 9055 // Result returns the result of the asynchronous operation. 9056 // If the operation has not completed it will return an error. 9057 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9058} 9059 9060// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9061func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 9062 var azFuture azure.Future 9063 if err := json.Unmarshal(body, &azFuture); err != nil { 9064 return err 9065 } 9066 future.FutureAPI = &azFuture 9067 future.Result = future.result 9068 return nil 9069} 9070 9071// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 9072func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9073 var done bool 9074 done, err = future.DoneWithContext(context.Background(), client) 9075 if err != nil { 9076 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 9077 return 9078 } 9079 if !done { 9080 ar.Response = future.Response() 9081 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 9082 return 9083 } 9084 ar.Response = future.Response() 9085 return 9086} 9087 9088// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 9089// long-running operation. 9090type VirtualMachineScaleSetsDeleteFuture struct { 9091 azure.FutureAPI 9092 // Result returns the result of the asynchronous operation. 9093 // If the operation has not completed it will return an error. 9094 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9095} 9096 9097// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9098func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 9099 var azFuture azure.Future 9100 if err := json.Unmarshal(body, &azFuture); err != nil { 9101 return err 9102 } 9103 future.FutureAPI = &azFuture 9104 future.Result = future.result 9105 return nil 9106} 9107 9108// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 9109func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9110 var done bool 9111 done, err = future.DoneWithContext(context.Background(), client) 9112 if err != nil { 9113 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 9114 return 9115 } 9116 if !done { 9117 ar.Response = future.Response() 9118 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 9119 return 9120 } 9121 ar.Response = future.Response() 9122 return 9123} 9124 9125// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 9126// a long-running operation. 9127type VirtualMachineScaleSetsDeleteInstancesFuture struct { 9128 azure.FutureAPI 9129 // Result returns the result of the asynchronous operation. 9130 // If the operation has not completed it will return an error. 9131 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9132} 9133 9134// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9135func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 9136 var azFuture azure.Future 9137 if err := json.Unmarshal(body, &azFuture); err != nil { 9138 return err 9139 } 9140 future.FutureAPI = &azFuture 9141 future.Result = future.result 9142 return nil 9143} 9144 9145// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 9146func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9147 var done bool 9148 done, err = future.DoneWithContext(context.Background(), client) 9149 if err != nil { 9150 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 9151 return 9152 } 9153 if !done { 9154 ar.Response = future.Response() 9155 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 9156 return 9157 } 9158 ar.Response = future.Response() 9159 return 9160} 9161 9162// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 9163type VirtualMachineScaleSetSku struct { 9164 // ResourceType - READ-ONLY; The type of resource the sku applies to. 9165 ResourceType *string `json:"resourceType,omitempty"` 9166 // Sku - READ-ONLY; The Sku. 9167 Sku *Sku `json:"sku,omitempty"` 9168 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 9169 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 9170} 9171 9172// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. 9173func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { 9174 objectMap := make(map[string]interface{}) 9175 return json.Marshal(objectMap) 9176} 9177 9178// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 9179type VirtualMachineScaleSetSkuCapacity struct { 9180 // Minimum - READ-ONLY; The minimum capacity. 9181 Minimum *int64 `json:"minimum,omitempty"` 9182 // Maximum - READ-ONLY; The maximum capacity that can be set. 9183 Maximum *int64 `json:"maximum,omitempty"` 9184 // DefaultCapacity - READ-ONLY; The default capacity. 9185 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 9186 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 9187 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 9188} 9189 9190// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. 9191func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { 9192 objectMap := make(map[string]interface{}) 9193 return json.Marshal(objectMap) 9194} 9195 9196// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 9197// of a long-running operation. 9198type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 9199 azure.FutureAPI 9200 // Result returns the result of the asynchronous operation. 9201 // If the operation has not completed it will return an error. 9202 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9203} 9204 9205// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9206func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 9207 var azFuture azure.Future 9208 if err := json.Unmarshal(body, &azFuture); err != nil { 9209 return err 9210 } 9211 future.FutureAPI = &azFuture 9212 future.Result = future.result 9213 return nil 9214} 9215 9216// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 9217func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9218 var done bool 9219 done, err = future.DoneWithContext(context.Background(), client) 9220 if err != nil { 9221 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 9222 return 9223 } 9224 if !done { 9225 ar.Response = future.Response() 9226 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 9227 return 9228 } 9229 ar.Response = future.Response() 9230 return 9231} 9232 9233// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 9234// long-running operation. 9235type VirtualMachineScaleSetsPowerOffFuture struct { 9236 azure.FutureAPI 9237 // Result returns the result of the asynchronous operation. 9238 // If the operation has not completed it will return an error. 9239 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9240} 9241 9242// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9243func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 9244 var azFuture azure.Future 9245 if err := json.Unmarshal(body, &azFuture); err != nil { 9246 return err 9247 } 9248 future.FutureAPI = &azFuture 9249 future.Result = future.result 9250 return nil 9251} 9252 9253// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 9254func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9255 var done bool 9256 done, err = future.DoneWithContext(context.Background(), client) 9257 if err != nil { 9258 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 9259 return 9260 } 9261 if !done { 9262 ar.Response = future.Response() 9263 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 9264 return 9265 } 9266 ar.Response = future.Response() 9267 return 9268} 9269 9270// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 9271// long-running operation. 9272type VirtualMachineScaleSetsRedeployFuture struct { 9273 azure.FutureAPI 9274 // Result returns the result of the asynchronous operation. 9275 // If the operation has not completed it will return an error. 9276 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9277} 9278 9279// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9280func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 9281 var azFuture azure.Future 9282 if err := json.Unmarshal(body, &azFuture); err != nil { 9283 return err 9284 } 9285 future.FutureAPI = &azFuture 9286 future.Result = future.result 9287 return nil 9288} 9289 9290// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 9291func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9292 var done bool 9293 done, err = future.DoneWithContext(context.Background(), client) 9294 if err != nil { 9295 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 9296 return 9297 } 9298 if !done { 9299 ar.Response = future.Response() 9300 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 9301 return 9302 } 9303 ar.Response = future.Response() 9304 return 9305} 9306 9307// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 9308// long-running operation. 9309type VirtualMachineScaleSetsReimageAllFuture struct { 9310 azure.FutureAPI 9311 // Result returns the result of the asynchronous operation. 9312 // If the operation has not completed it will return an error. 9313 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9314} 9315 9316// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9317func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 9318 var azFuture azure.Future 9319 if err := json.Unmarshal(body, &azFuture); err != nil { 9320 return err 9321 } 9322 future.FutureAPI = &azFuture 9323 future.Result = future.result 9324 return nil 9325} 9326 9327// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 9328func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9329 var done bool 9330 done, err = future.DoneWithContext(context.Background(), client) 9331 if err != nil { 9332 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 9333 return 9334 } 9335 if !done { 9336 ar.Response = future.Response() 9337 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 9338 return 9339 } 9340 ar.Response = future.Response() 9341 return 9342} 9343 9344// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 9345// long-running operation. 9346type VirtualMachineScaleSetsReimageFuture struct { 9347 azure.FutureAPI 9348 // Result returns the result of the asynchronous operation. 9349 // If the operation has not completed it will return an error. 9350 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9351} 9352 9353// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9354func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 9355 var azFuture azure.Future 9356 if err := json.Unmarshal(body, &azFuture); err != nil { 9357 return err 9358 } 9359 future.FutureAPI = &azFuture 9360 future.Result = future.result 9361 return nil 9362} 9363 9364// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 9365func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9366 var done bool 9367 done, err = future.DoneWithContext(context.Background(), client) 9368 if err != nil { 9369 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 9370 return 9371 } 9372 if !done { 9373 ar.Response = future.Response() 9374 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 9375 return 9376 } 9377 ar.Response = future.Response() 9378 return 9379} 9380 9381// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 9382// long-running operation. 9383type VirtualMachineScaleSetsRestartFuture struct { 9384 azure.FutureAPI 9385 // Result returns the result of the asynchronous operation. 9386 // If the operation has not completed it will return an error. 9387 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9388} 9389 9390// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9391func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 9392 var azFuture azure.Future 9393 if err := json.Unmarshal(body, &azFuture); err != nil { 9394 return err 9395 } 9396 future.FutureAPI = &azFuture 9397 future.Result = future.result 9398 return nil 9399} 9400 9401// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 9402func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9403 var done bool 9404 done, err = future.DoneWithContext(context.Background(), client) 9405 if err != nil { 9406 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 9407 return 9408 } 9409 if !done { 9410 ar.Response = future.Response() 9411 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 9412 return 9413 } 9414 ar.Response = future.Response() 9415 return 9416} 9417 9418// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 9419// long-running operation. 9420type VirtualMachineScaleSetsStartFuture struct { 9421 azure.FutureAPI 9422 // Result returns the result of the asynchronous operation. 9423 // If the operation has not completed it will return an error. 9424 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9425} 9426 9427// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9428func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 9429 var azFuture azure.Future 9430 if err := json.Unmarshal(body, &azFuture); err != nil { 9431 return err 9432 } 9433 future.FutureAPI = &azFuture 9434 future.Result = future.result 9435 return nil 9436} 9437 9438// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 9439func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9440 var done bool 9441 done, err = future.DoneWithContext(context.Background(), client) 9442 if err != nil { 9443 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 9444 return 9445 } 9446 if !done { 9447 ar.Response = future.Response() 9448 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 9449 return 9450 } 9451 ar.Response = future.Response() 9452 return 9453} 9454 9455// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 9456type VirtualMachineScaleSetStorageProfile struct { 9457 // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. 9458 ImageReference *ImageReference `json:"imageReference,omitempty"` 9459 // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 9460 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 9461 // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 9462 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 9463} 9464 9465// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 9466// long-running operation. 9467type VirtualMachineScaleSetsUpdateFuture struct { 9468 azure.FutureAPI 9469 // Result returns the result of the asynchronous operation. 9470 // If the operation has not completed it will return an error. 9471 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 9472} 9473 9474// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9475func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 9476 var azFuture azure.Future 9477 if err := json.Unmarshal(body, &azFuture); err != nil { 9478 return err 9479 } 9480 future.FutureAPI = &azFuture 9481 future.Result = future.result 9482 return nil 9483} 9484 9485// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 9486func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 9487 var done bool 9488 done, err = future.DoneWithContext(context.Background(), client) 9489 if err != nil { 9490 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 9491 return 9492 } 9493 if !done { 9494 vmss.Response.Response = future.Response() 9495 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 9496 return 9497 } 9498 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9499 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 9500 vmss, err = client.UpdateResponder(vmss.Response.Response) 9501 if err != nil { 9502 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 9503 } 9504 } 9505 return 9506} 9507 9508// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 9509// a long-running operation. 9510type VirtualMachineScaleSetsUpdateInstancesFuture struct { 9511 azure.FutureAPI 9512 // Result returns the result of the asynchronous operation. 9513 // If the operation has not completed it will return an error. 9514 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9515} 9516 9517// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9518func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 9519 var azFuture azure.Future 9520 if err := json.Unmarshal(body, &azFuture); err != nil { 9521 return err 9522 } 9523 future.FutureAPI = &azFuture 9524 future.Result = future.result 9525 return nil 9526} 9527 9528// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 9529func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9530 var done bool 9531 done, err = future.DoneWithContext(context.Background(), client) 9532 if err != nil { 9533 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 9534 return 9535 } 9536 if !done { 9537 ar.Response = future.Response() 9538 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 9539 return 9540 } 9541 ar.Response = future.Response() 9542 return 9543} 9544 9545// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 9546type VirtualMachineScaleSetUpdate struct { 9547 // Sku - The virtual machine scale set sku. 9548 Sku *Sku `json:"sku,omitempty"` 9549 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 9550 Plan *Plan `json:"plan,omitempty"` 9551 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 9552 // Identity - The identity of the virtual machine scale set, if configured. 9553 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 9554 // Tags - Resource tags 9555 Tags map[string]*string `json:"tags"` 9556} 9557 9558// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 9559func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 9560 objectMap := make(map[string]interface{}) 9561 if vmssu.Sku != nil { 9562 objectMap["sku"] = vmssu.Sku 9563 } 9564 if vmssu.Plan != nil { 9565 objectMap["plan"] = vmssu.Plan 9566 } 9567 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 9568 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 9569 } 9570 if vmssu.Identity != nil { 9571 objectMap["identity"] = vmssu.Identity 9572 } 9573 if vmssu.Tags != nil { 9574 objectMap["tags"] = vmssu.Tags 9575 } 9576 return json.Marshal(objectMap) 9577} 9578 9579// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 9580func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 9581 var m map[string]*json.RawMessage 9582 err := json.Unmarshal(body, &m) 9583 if err != nil { 9584 return err 9585 } 9586 for k, v := range m { 9587 switch k { 9588 case "sku": 9589 if v != nil { 9590 var sku Sku 9591 err = json.Unmarshal(*v, &sku) 9592 if err != nil { 9593 return err 9594 } 9595 vmssu.Sku = &sku 9596 } 9597 case "plan": 9598 if v != nil { 9599 var plan Plan 9600 err = json.Unmarshal(*v, &plan) 9601 if err != nil { 9602 return err 9603 } 9604 vmssu.Plan = &plan 9605 } 9606 case "properties": 9607 if v != nil { 9608 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 9609 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 9610 if err != nil { 9611 return err 9612 } 9613 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 9614 } 9615 case "identity": 9616 if v != nil { 9617 var identity VirtualMachineScaleSetIdentity 9618 err = json.Unmarshal(*v, &identity) 9619 if err != nil { 9620 return err 9621 } 9622 vmssu.Identity = &identity 9623 } 9624 case "tags": 9625 if v != nil { 9626 var tags map[string]*string 9627 err = json.Unmarshal(*v, &tags) 9628 if err != nil { 9629 return err 9630 } 9631 vmssu.Tags = tags 9632 } 9633 } 9634 } 9635 9636 return nil 9637} 9638 9639// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 9640// configuration. 9641type VirtualMachineScaleSetUpdateIPConfiguration struct { 9642 // Name - The IP configuration name. 9643 Name *string `json:"name,omitempty"` 9644 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 9645 // ID - Resource Id 9646 ID *string `json:"id,omitempty"` 9647} 9648 9649// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 9650func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 9651 objectMap := make(map[string]interface{}) 9652 if vmssuic.Name != nil { 9653 objectMap["name"] = vmssuic.Name 9654 } 9655 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 9656 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 9657 } 9658 if vmssuic.ID != nil { 9659 objectMap["id"] = vmssuic.ID 9660 } 9661 return json.Marshal(objectMap) 9662} 9663 9664// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 9665func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 9666 var m map[string]*json.RawMessage 9667 err := json.Unmarshal(body, &m) 9668 if err != nil { 9669 return err 9670 } 9671 for k, v := range m { 9672 switch k { 9673 case "name": 9674 if v != nil { 9675 var name string 9676 err = json.Unmarshal(*v, &name) 9677 if err != nil { 9678 return err 9679 } 9680 vmssuic.Name = &name 9681 } 9682 case "properties": 9683 if v != nil { 9684 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 9685 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 9686 if err != nil { 9687 return err 9688 } 9689 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 9690 } 9691 case "id": 9692 if v != nil { 9693 var ID string 9694 err = json.Unmarshal(*v, &ID) 9695 if err != nil { 9696 return err 9697 } 9698 vmssuic.ID = &ID 9699 } 9700 } 9701 } 9702 9703 return nil 9704} 9705 9706// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 9707// profile's IP configuration properties. NOTE: The subnet of a scale set may be modified as long as the 9708// original subnet and the new subnet are in the same virtual network. 9709type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 9710 // Subnet - The subnet. 9711 Subnet *APIEntityReference `json:"subnet,omitempty"` 9712 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 9713 Primary *bool `json:"primary,omitempty"` 9714 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 9715 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 9716 // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 9717 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 9718 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 9719 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 9720 // ApplicationSecurityGroups - Specifies an array of references to application security group. 9721 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 9722 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 9723 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 9724 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 9725 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 9726} 9727 9728// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 9729// network configurations. 9730type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 9731 // Name - The network configuration name. 9732 Name *string `json:"name,omitempty"` 9733 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 9734 // ID - Resource Id 9735 ID *string `json:"id,omitempty"` 9736} 9737 9738// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 9739func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 9740 objectMap := make(map[string]interface{}) 9741 if vmssunc.Name != nil { 9742 objectMap["name"] = vmssunc.Name 9743 } 9744 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 9745 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 9746 } 9747 if vmssunc.ID != nil { 9748 objectMap["id"] = vmssunc.ID 9749 } 9750 return json.Marshal(objectMap) 9751} 9752 9753// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 9754func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 9755 var m map[string]*json.RawMessage 9756 err := json.Unmarshal(body, &m) 9757 if err != nil { 9758 return err 9759 } 9760 for k, v := range m { 9761 switch k { 9762 case "name": 9763 if v != nil { 9764 var name string 9765 err = json.Unmarshal(*v, &name) 9766 if err != nil { 9767 return err 9768 } 9769 vmssunc.Name = &name 9770 } 9771 case "properties": 9772 if v != nil { 9773 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 9774 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 9775 if err != nil { 9776 return err 9777 } 9778 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 9779 } 9780 case "id": 9781 if v != nil { 9782 var ID string 9783 err = json.Unmarshal(*v, &ID) 9784 if err != nil { 9785 return err 9786 } 9787 vmssunc.ID = &ID 9788 } 9789 } 9790 } 9791 9792 return nil 9793} 9794 9795// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 9796// updatable network profile's IP configuration.Use this object for updating network profile's IP 9797// Configuration. 9798type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 9799 // Primary - Whether this is a primary NIC on a virtual machine. 9800 Primary *bool `json:"primary,omitempty"` 9801 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 9802 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 9803 // NetworkSecurityGroup - The network security group. 9804 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 9805 // DNSSettings - The dns settings to be applied on the network interfaces. 9806 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 9807 // IPConfigurations - The virtual machine scale set IP Configuration. 9808 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 9809 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 9810 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 9811} 9812 9813// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 9814type VirtualMachineScaleSetUpdateNetworkProfile struct { 9815 // NetworkInterfaceConfigurations - The list of network configurations. 9816 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 9817} 9818 9819// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 9820// Object. This should be used for Updating VMSS OS Disk. 9821type VirtualMachineScaleSetUpdateOSDisk struct { 9822 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 9823 Caching CachingTypes `json:"caching,omitempty"` 9824 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 9825 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 9826 // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 9827 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9828 // Image - The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. 9829 Image *VirtualHardDisk `json:"image,omitempty"` 9830 // VhdContainers - The list of virtual hard disk container uris. 9831 VhdContainers *[]string `json:"vhdContainers,omitempty"` 9832 // ManagedDisk - The managed disk parameters. 9833 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 9834} 9835 9836// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 9837type VirtualMachineScaleSetUpdateOSProfile struct { 9838 // CustomData - A base-64 encoded string of custom data. 9839 CustomData *string `json:"customData,omitempty"` 9840 // WindowsConfiguration - The Windows Configuration of the OS profile. 9841 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 9842 // LinuxConfiguration - The Linux Configuration of the OS profile. 9843 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 9844 // Secrets - The List of certificates for addition to the VM. 9845 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 9846} 9847 9848// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 9849type VirtualMachineScaleSetUpdateProperties struct { 9850 // UpgradePolicy - The upgrade policy. 9851 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 9852 // AutomaticRepairsPolicy - Policy for automatic repairs. 9853 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 9854 // VirtualMachineProfile - The virtual machine profile. 9855 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 9856 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 9857 Overprovision *bool `json:"overprovision,omitempty"` 9858 // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. 9859 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 9860 // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. 9861 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 9862 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 9863 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 9864} 9865 9866// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 9867// Configuration's PublicIPAddress configuration 9868type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 9869 // Name - The publicIP address configuration name. 9870 Name *string `json:"name,omitempty"` 9871 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 9872} 9873 9874// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 9875func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 9876 objectMap := make(map[string]interface{}) 9877 if vmssupiac.Name != nil { 9878 objectMap["name"] = vmssupiac.Name 9879 } 9880 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 9881 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 9882 } 9883 return json.Marshal(objectMap) 9884} 9885 9886// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 9887func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 9888 var m map[string]*json.RawMessage 9889 err := json.Unmarshal(body, &m) 9890 if err != nil { 9891 return err 9892 } 9893 for k, v := range m { 9894 switch k { 9895 case "name": 9896 if v != nil { 9897 var name string 9898 err = json.Unmarshal(*v, &name) 9899 if err != nil { 9900 return err 9901 } 9902 vmssupiac.Name = &name 9903 } 9904 case "properties": 9905 if v != nil { 9906 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 9907 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 9908 if err != nil { 9909 return err 9910 } 9911 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 9912 } 9913 } 9914 } 9915 9916 return nil 9917} 9918 9919// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 9920// set IP Configuration's PublicIPAddress configuration 9921type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 9922 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 9923 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 9924 // DNSSettings - The dns settings to be applied on the publicIP addresses . 9925 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 9926} 9927 9928// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 9929type VirtualMachineScaleSetUpdateStorageProfile struct { 9930 // ImageReference - The image reference. 9931 ImageReference *ImageReference `json:"imageReference,omitempty"` 9932 // OsDisk - The OS disk. 9933 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 9934 // DataDisks - The data disks. 9935 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 9936} 9937 9938// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 9939type VirtualMachineScaleSetUpdateVMProfile struct { 9940 // OsProfile - The virtual machine scale set OS profile. 9941 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 9942 // StorageProfile - The virtual machine scale set storage profile. 9943 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 9944 // NetworkProfile - The virtual machine scale set network profile. 9945 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 9946 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 9947 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 9948 // ExtensionProfile - The virtual machine scale set extension profile. 9949 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 9950 // LicenseType - The license type, which is for bring your own license scenario. 9951 LicenseType *string `json:"licenseType,omitempty"` 9952} 9953 9954// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 9955type VirtualMachineScaleSetVM struct { 9956 autorest.Response `json:"-"` 9957 // InstanceID - READ-ONLY; The virtual machine instance ID. 9958 InstanceID *string `json:"instanceId,omitempty"` 9959 // Sku - READ-ONLY; The virtual machine SKU. 9960 Sku *Sku `json:"sku,omitempty"` 9961 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 9962 // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. 9963 Plan *Plan `json:"plan,omitempty"` 9964 // Resources - READ-ONLY; The virtual machine child extension resources. 9965 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 9966 // Zones - READ-ONLY; The virtual machine zones. 9967 Zones *[]string `json:"zones,omitempty"` 9968 // ID - READ-ONLY; Resource Id 9969 ID *string `json:"id,omitempty"` 9970 // Name - READ-ONLY; Resource name 9971 Name *string `json:"name,omitempty"` 9972 // Type - READ-ONLY; Resource type 9973 Type *string `json:"type,omitempty"` 9974 // Location - Resource location 9975 Location *string `json:"location,omitempty"` 9976 // Tags - Resource tags 9977 Tags map[string]*string `json:"tags"` 9978} 9979 9980// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 9981func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 9982 objectMap := make(map[string]interface{}) 9983 if vmssv.VirtualMachineScaleSetVMProperties != nil { 9984 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 9985 } 9986 if vmssv.Plan != nil { 9987 objectMap["plan"] = vmssv.Plan 9988 } 9989 if vmssv.Location != nil { 9990 objectMap["location"] = vmssv.Location 9991 } 9992 if vmssv.Tags != nil { 9993 objectMap["tags"] = vmssv.Tags 9994 } 9995 return json.Marshal(objectMap) 9996} 9997 9998// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 9999func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 10000 var m map[string]*json.RawMessage 10001 err := json.Unmarshal(body, &m) 10002 if err != nil { 10003 return err 10004 } 10005 for k, v := range m { 10006 switch k { 10007 case "instanceId": 10008 if v != nil { 10009 var instanceID string 10010 err = json.Unmarshal(*v, &instanceID) 10011 if err != nil { 10012 return err 10013 } 10014 vmssv.InstanceID = &instanceID 10015 } 10016 case "sku": 10017 if v != nil { 10018 var sku Sku 10019 err = json.Unmarshal(*v, &sku) 10020 if err != nil { 10021 return err 10022 } 10023 vmssv.Sku = &sku 10024 } 10025 case "properties": 10026 if v != nil { 10027 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 10028 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 10029 if err != nil { 10030 return err 10031 } 10032 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 10033 } 10034 case "plan": 10035 if v != nil { 10036 var plan Plan 10037 err = json.Unmarshal(*v, &plan) 10038 if err != nil { 10039 return err 10040 } 10041 vmssv.Plan = &plan 10042 } 10043 case "resources": 10044 if v != nil { 10045 var resources []VirtualMachineExtension 10046 err = json.Unmarshal(*v, &resources) 10047 if err != nil { 10048 return err 10049 } 10050 vmssv.Resources = &resources 10051 } 10052 case "zones": 10053 if v != nil { 10054 var zones []string 10055 err = json.Unmarshal(*v, &zones) 10056 if err != nil { 10057 return err 10058 } 10059 vmssv.Zones = &zones 10060 } 10061 case "id": 10062 if v != nil { 10063 var ID string 10064 err = json.Unmarshal(*v, &ID) 10065 if err != nil { 10066 return err 10067 } 10068 vmssv.ID = &ID 10069 } 10070 case "name": 10071 if v != nil { 10072 var name string 10073 err = json.Unmarshal(*v, &name) 10074 if err != nil { 10075 return err 10076 } 10077 vmssv.Name = &name 10078 } 10079 case "type": 10080 if v != nil { 10081 var typeVar string 10082 err = json.Unmarshal(*v, &typeVar) 10083 if err != nil { 10084 return err 10085 } 10086 vmssv.Type = &typeVar 10087 } 10088 case "location": 10089 if v != nil { 10090 var location string 10091 err = json.Unmarshal(*v, &location) 10092 if err != nil { 10093 return err 10094 } 10095 vmssv.Location = &location 10096 } 10097 case "tags": 10098 if v != nil { 10099 var tags map[string]*string 10100 err = json.Unmarshal(*v, &tags) 10101 if err != nil { 10102 return err 10103 } 10104 vmssv.Tags = tags 10105 } 10106 } 10107 } 10108 10109 return nil 10110} 10111 10112// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 10113// scale set. 10114type VirtualMachineScaleSetVMExtensionsSummary struct { 10115 // Name - READ-ONLY; The extension name. 10116 Name *string `json:"name,omitempty"` 10117 // StatusesSummary - READ-ONLY; The extensions information. 10118 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 10119} 10120 10121// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. 10122func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { 10123 objectMap := make(map[string]interface{}) 10124 return json.Marshal(objectMap) 10125} 10126 10127// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 10128// set. 10129type VirtualMachineScaleSetVMInstanceIDs struct { 10130 // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. 10131 InstanceIds *[]string `json:"instanceIds,omitempty"` 10132} 10133 10134// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 10135// scale set. 10136type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 10137 // InstanceIds - The virtual machine scale set instance ids. 10138 InstanceIds *[]string `json:"instanceIds,omitempty"` 10139} 10140 10141// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 10142type VirtualMachineScaleSetVMInstanceView struct { 10143 autorest.Response `json:"-"` 10144 // PlatformUpdateDomain - The Update Domain count. 10145 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 10146 // PlatformFaultDomain - The Fault Domain count. 10147 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 10148 // RdpThumbPrint - The Remote desktop certificate thumbprint. 10149 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 10150 // VMAgent - The VM Agent running on the virtual machine. 10151 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 10152 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 10153 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 10154 // Disks - The disks information. 10155 Disks *[]DiskInstanceView `json:"disks,omitempty"` 10156 // Extensions - The extensions information. 10157 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 10158 // VMHealth - READ-ONLY; The health status for the VM. 10159 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 10160 // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. 10161 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 10162 // Statuses - The resource status information. 10163 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 10164 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 10165 PlacementGroupID *string `json:"placementGroupId,omitempty"` 10166} 10167 10168// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 10169func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 10170 objectMap := make(map[string]interface{}) 10171 if vmssviv.PlatformUpdateDomain != nil { 10172 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 10173 } 10174 if vmssviv.PlatformFaultDomain != nil { 10175 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 10176 } 10177 if vmssviv.RdpThumbPrint != nil { 10178 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 10179 } 10180 if vmssviv.VMAgent != nil { 10181 objectMap["vmAgent"] = vmssviv.VMAgent 10182 } 10183 if vmssviv.MaintenanceRedeployStatus != nil { 10184 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 10185 } 10186 if vmssviv.Disks != nil { 10187 objectMap["disks"] = vmssviv.Disks 10188 } 10189 if vmssviv.Extensions != nil { 10190 objectMap["extensions"] = vmssviv.Extensions 10191 } 10192 if vmssviv.BootDiagnostics != nil { 10193 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 10194 } 10195 if vmssviv.Statuses != nil { 10196 objectMap["statuses"] = vmssviv.Statuses 10197 } 10198 if vmssviv.PlacementGroupID != nil { 10199 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 10200 } 10201 return json.Marshal(objectMap) 10202} 10203 10204// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 10205type VirtualMachineScaleSetVMListResult struct { 10206 autorest.Response `json:"-"` 10207 // Value - The list of virtual machine scale sets VMs. 10208 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 10209 // NextLink - The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs 10210 NextLink *string `json:"nextLink,omitempty"` 10211} 10212 10213// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 10214// VirtualMachineScaleSetVM values. 10215type VirtualMachineScaleSetVMListResultIterator struct { 10216 i int 10217 page VirtualMachineScaleSetVMListResultPage 10218} 10219 10220// NextWithContext advances to the next value. If there was an error making 10221// the request the iterator does not advance and the error is returned. 10222func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 10223 if tracing.IsEnabled() { 10224 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 10225 defer func() { 10226 sc := -1 10227 if iter.Response().Response.Response != nil { 10228 sc = iter.Response().Response.Response.StatusCode 10229 } 10230 tracing.EndSpan(ctx, sc, err) 10231 }() 10232 } 10233 iter.i++ 10234 if iter.i < len(iter.page.Values()) { 10235 return nil 10236 } 10237 err = iter.page.NextWithContext(ctx) 10238 if err != nil { 10239 iter.i-- 10240 return err 10241 } 10242 iter.i = 0 10243 return nil 10244} 10245 10246// Next advances to the next value. If there was an error making 10247// the request the iterator does not advance and the error is returned. 10248// Deprecated: Use NextWithContext() instead. 10249func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 10250 return iter.NextWithContext(context.Background()) 10251} 10252 10253// NotDone returns true if the enumeration should be started or is not yet complete. 10254func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 10255 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10256} 10257 10258// Response returns the raw server response from the last page request. 10259func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 10260 return iter.page.Response() 10261} 10262 10263// Value returns the current value or a zero-initialized value if the 10264// iterator has advanced beyond the end of the collection. 10265func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 10266 if !iter.page.NotDone() { 10267 return VirtualMachineScaleSetVM{} 10268 } 10269 return iter.page.Values()[iter.i] 10270} 10271 10272// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 10273func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 10274 return VirtualMachineScaleSetVMListResultIterator{page: page} 10275} 10276 10277// IsEmpty returns true if the ListResult contains no values. 10278func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 10279 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 10280} 10281 10282// hasNextLink returns true if the NextLink is not empty. 10283func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 10284 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 10285} 10286 10287// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 10288// It returns nil if no more results exist. 10289func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 10290 if !vmssvlr.hasNextLink() { 10291 return nil, nil 10292 } 10293 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10294 autorest.AsJSON(), 10295 autorest.AsGet(), 10296 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 10297} 10298 10299// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 10300type VirtualMachineScaleSetVMListResultPage struct { 10301 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 10302 vmssvlr VirtualMachineScaleSetVMListResult 10303} 10304 10305// NextWithContext advances to the next page of values. If there was an error making 10306// the request the page does not advance and the error is returned. 10307func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 10308 if tracing.IsEnabled() { 10309 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 10310 defer func() { 10311 sc := -1 10312 if page.Response().Response.Response != nil { 10313 sc = page.Response().Response.Response.StatusCode 10314 } 10315 tracing.EndSpan(ctx, sc, err) 10316 }() 10317 } 10318 for { 10319 next, err := page.fn(ctx, page.vmssvlr) 10320 if err != nil { 10321 return err 10322 } 10323 page.vmssvlr = next 10324 if !next.hasNextLink() || !next.IsEmpty() { 10325 break 10326 } 10327 } 10328 return nil 10329} 10330 10331// Next advances to the next page of values. If there was an error making 10332// the request the page does not advance and the error is returned. 10333// Deprecated: Use NextWithContext() instead. 10334func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 10335 return page.NextWithContext(context.Background()) 10336} 10337 10338// NotDone returns true if the page enumeration should be started or is not yet complete. 10339func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 10340 return !page.vmssvlr.IsEmpty() 10341} 10342 10343// Response returns the raw server response from the last page request. 10344func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 10345 return page.vmssvlr 10346} 10347 10348// Values returns the slice of values for the current page or nil if there are no values. 10349func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 10350 if page.vmssvlr.IsEmpty() { 10351 return nil 10352 } 10353 return *page.vmssvlr.Value 10354} 10355 10356// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 10357func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 10358 return VirtualMachineScaleSetVMListResultPage{ 10359 fn: getNextPage, 10360 vmssvlr: cur, 10361 } 10362} 10363 10364// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 10365type VirtualMachineScaleSetVMProfile struct { 10366 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 10367 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 10368 // StorageProfile - Specifies the storage settings for the virtual machine disks. 10369 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 10370 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. 10371 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10372 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 10373 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 10374 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 10375 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 10376 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 10377 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 10378 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 10379 LicenseType *string `json:"licenseType,omitempty"` 10380 // Priority - Specifies the priority for the virtual machines in the scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low' 10381 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 10382 // EvictionPolicy - Specifies the eviction policy for virtual machines in a low priority scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 10383 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 10384} 10385 10386// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 10387// machine. 10388type VirtualMachineScaleSetVMProperties struct { 10389 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 10390 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 10391 // VMID - READ-ONLY; Azure VM unique ID. 10392 VMID *string `json:"vmId,omitempty"` 10393 // InstanceView - READ-ONLY; The virtual machine instance view. 10394 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 10395 // HardwareProfile - Specifies the hardware settings for the virtual machine. 10396 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 10397 // StorageProfile - Specifies the storage settings for the virtual machine disks. 10398 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 10399 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. 10400 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10401 // OsProfile - Specifies the operating system settings for the virtual machine. 10402 OsProfile *OSProfile `json:"osProfile,omitempty"` 10403 // NetworkProfile - Specifies the network interfaces of the virtual machine. 10404 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 10405 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 10406 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 10407 // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. 10408 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 10409 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10410 ProvisioningState *string `json:"provisioningState,omitempty"` 10411 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 10412 LicenseType *string `json:"licenseType,omitempty"` 10413} 10414 10415// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 10416func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 10417 objectMap := make(map[string]interface{}) 10418 if vmssvp.HardwareProfile != nil { 10419 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 10420 } 10421 if vmssvp.StorageProfile != nil { 10422 objectMap["storageProfile"] = vmssvp.StorageProfile 10423 } 10424 if vmssvp.AdditionalCapabilities != nil { 10425 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 10426 } 10427 if vmssvp.OsProfile != nil { 10428 objectMap["osProfile"] = vmssvp.OsProfile 10429 } 10430 if vmssvp.NetworkProfile != nil { 10431 objectMap["networkProfile"] = vmssvp.NetworkProfile 10432 } 10433 if vmssvp.DiagnosticsProfile != nil { 10434 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 10435 } 10436 if vmssvp.AvailabilitySet != nil { 10437 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 10438 } 10439 if vmssvp.LicenseType != nil { 10440 objectMap["licenseType"] = vmssvp.LicenseType 10441 } 10442 return json.Marshal(objectMap) 10443} 10444 10445// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 10446type VirtualMachineScaleSetVMReimageParameters struct { 10447 // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. 10448 TempDisk *bool `json:"tempDisk,omitempty"` 10449} 10450 10451// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 10452// long-running operation. 10453type VirtualMachineScaleSetVMsDeallocateFuture struct { 10454 azure.FutureAPI 10455 // Result returns the result of the asynchronous operation. 10456 // If the operation has not completed it will return an error. 10457 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10458} 10459 10460// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10461func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 10462 var azFuture azure.Future 10463 if err := json.Unmarshal(body, &azFuture); err != nil { 10464 return err 10465 } 10466 future.FutureAPI = &azFuture 10467 future.Result = future.result 10468 return nil 10469} 10470 10471// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 10472func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10473 var done bool 10474 done, err = future.DoneWithContext(context.Background(), client) 10475 if err != nil { 10476 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 10477 return 10478 } 10479 if !done { 10480 ar.Response = future.Response() 10481 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 10482 return 10483 } 10484 ar.Response = future.Response() 10485 return 10486} 10487 10488// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 10489// long-running operation. 10490type VirtualMachineScaleSetVMsDeleteFuture struct { 10491 azure.FutureAPI 10492 // Result returns the result of the asynchronous operation. 10493 // If the operation has not completed it will return an error. 10494 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10495} 10496 10497// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10498func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 10499 var azFuture azure.Future 10500 if err := json.Unmarshal(body, &azFuture); err != nil { 10501 return err 10502 } 10503 future.FutureAPI = &azFuture 10504 future.Result = future.result 10505 return nil 10506} 10507 10508// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 10509func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10510 var done bool 10511 done, err = future.DoneWithContext(context.Background(), client) 10512 if err != nil { 10513 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 10514 return 10515 } 10516 if !done { 10517 ar.Response = future.Response() 10518 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 10519 return 10520 } 10521 ar.Response = future.Response() 10522 return 10523} 10524 10525// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 10526// results of a long-running operation. 10527type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 10528 azure.FutureAPI 10529 // Result returns the result of the asynchronous operation. 10530 // If the operation has not completed it will return an error. 10531 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10532} 10533 10534// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10535func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 10536 var azFuture azure.Future 10537 if err := json.Unmarshal(body, &azFuture); err != nil { 10538 return err 10539 } 10540 future.FutureAPI = &azFuture 10541 future.Result = future.result 10542 return nil 10543} 10544 10545// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 10546func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10547 var done bool 10548 done, err = future.DoneWithContext(context.Background(), client) 10549 if err != nil { 10550 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 10551 return 10552 } 10553 if !done { 10554 ar.Response = future.Response() 10555 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 10556 return 10557 } 10558 ar.Response = future.Response() 10559 return 10560} 10561 10562// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 10563// long-running operation. 10564type VirtualMachineScaleSetVMsPowerOffFuture struct { 10565 azure.FutureAPI 10566 // Result returns the result of the asynchronous operation. 10567 // If the operation has not completed it will return an error. 10568 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10569} 10570 10571// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10572func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 10573 var azFuture azure.Future 10574 if err := json.Unmarshal(body, &azFuture); err != nil { 10575 return err 10576 } 10577 future.FutureAPI = &azFuture 10578 future.Result = future.result 10579 return nil 10580} 10581 10582// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 10583func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10584 var done bool 10585 done, err = future.DoneWithContext(context.Background(), client) 10586 if err != nil { 10587 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 10588 return 10589 } 10590 if !done { 10591 ar.Response = future.Response() 10592 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 10593 return 10594 } 10595 ar.Response = future.Response() 10596 return 10597} 10598 10599// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 10600// long-running operation. 10601type VirtualMachineScaleSetVMsRedeployFuture struct { 10602 azure.FutureAPI 10603 // Result returns the result of the asynchronous operation. 10604 // If the operation has not completed it will return an error. 10605 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10606} 10607 10608// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10609func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 10610 var azFuture azure.Future 10611 if err := json.Unmarshal(body, &azFuture); err != nil { 10612 return err 10613 } 10614 future.FutureAPI = &azFuture 10615 future.Result = future.result 10616 return nil 10617} 10618 10619// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 10620func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10621 var done bool 10622 done, err = future.DoneWithContext(context.Background(), client) 10623 if err != nil { 10624 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 10625 return 10626 } 10627 if !done { 10628 ar.Response = future.Response() 10629 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 10630 return 10631 } 10632 ar.Response = future.Response() 10633 return 10634} 10635 10636// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 10637// long-running operation. 10638type VirtualMachineScaleSetVMsReimageAllFuture struct { 10639 azure.FutureAPI 10640 // Result returns the result of the asynchronous operation. 10641 // If the operation has not completed it will return an error. 10642 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10643} 10644 10645// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10646func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 10647 var azFuture azure.Future 10648 if err := json.Unmarshal(body, &azFuture); err != nil { 10649 return err 10650 } 10651 future.FutureAPI = &azFuture 10652 future.Result = future.result 10653 return nil 10654} 10655 10656// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 10657func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10658 var done bool 10659 done, err = future.DoneWithContext(context.Background(), client) 10660 if err != nil { 10661 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 10662 return 10663 } 10664 if !done { 10665 ar.Response = future.Response() 10666 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 10667 return 10668 } 10669 ar.Response = future.Response() 10670 return 10671} 10672 10673// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 10674// long-running operation. 10675type VirtualMachineScaleSetVMsReimageFuture struct { 10676 azure.FutureAPI 10677 // Result returns the result of the asynchronous operation. 10678 // If the operation has not completed it will return an error. 10679 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10680} 10681 10682// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10683func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 10684 var azFuture azure.Future 10685 if err := json.Unmarshal(body, &azFuture); err != nil { 10686 return err 10687 } 10688 future.FutureAPI = &azFuture 10689 future.Result = future.result 10690 return nil 10691} 10692 10693// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 10694func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10695 var done bool 10696 done, err = future.DoneWithContext(context.Background(), client) 10697 if err != nil { 10698 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 10699 return 10700 } 10701 if !done { 10702 ar.Response = future.Response() 10703 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 10704 return 10705 } 10706 ar.Response = future.Response() 10707 return 10708} 10709 10710// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 10711// long-running operation. 10712type VirtualMachineScaleSetVMsRestartFuture struct { 10713 azure.FutureAPI 10714 // Result returns the result of the asynchronous operation. 10715 // If the operation has not completed it will return an error. 10716 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10717} 10718 10719// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10720func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 10721 var azFuture azure.Future 10722 if err := json.Unmarshal(body, &azFuture); err != nil { 10723 return err 10724 } 10725 future.FutureAPI = &azFuture 10726 future.Result = future.result 10727 return nil 10728} 10729 10730// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 10731func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10732 var done bool 10733 done, err = future.DoneWithContext(context.Background(), client) 10734 if err != nil { 10735 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 10736 return 10737 } 10738 if !done { 10739 ar.Response = future.Response() 10740 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 10741 return 10742 } 10743 ar.Response = future.Response() 10744 return 10745} 10746 10747// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 10748// long-running operation. 10749type VirtualMachineScaleSetVMsRunCommandFuture struct { 10750 azure.FutureAPI 10751 // Result returns the result of the asynchronous operation. 10752 // If the operation has not completed it will return an error. 10753 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 10754} 10755 10756// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10757func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { 10758 var azFuture azure.Future 10759 if err := json.Unmarshal(body, &azFuture); err != nil { 10760 return err 10761 } 10762 future.FutureAPI = &azFuture 10763 future.Result = future.result 10764 return nil 10765} 10766 10767// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. 10768func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { 10769 var done bool 10770 done, err = future.DoneWithContext(context.Background(), client) 10771 if err != nil { 10772 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") 10773 return 10774 } 10775 if !done { 10776 rcr.Response.Response = future.Response() 10777 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") 10778 return 10779 } 10780 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10781 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 10782 rcr, err = client.RunCommandResponder(rcr.Response.Response) 10783 if err != nil { 10784 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 10785 } 10786 } 10787 return 10788} 10789 10790// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 10791// long-running operation. 10792type VirtualMachineScaleSetVMsStartFuture struct { 10793 azure.FutureAPI 10794 // Result returns the result of the asynchronous operation. 10795 // If the operation has not completed it will return an error. 10796 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10797} 10798 10799// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10800func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 10801 var azFuture azure.Future 10802 if err := json.Unmarshal(body, &azFuture); err != nil { 10803 return err 10804 } 10805 future.FutureAPI = &azFuture 10806 future.Result = future.result 10807 return nil 10808} 10809 10810// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 10811func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10812 var done bool 10813 done, err = future.DoneWithContext(context.Background(), client) 10814 if err != nil { 10815 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 10816 return 10817 } 10818 if !done { 10819 ar.Response = future.Response() 10820 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 10821 return 10822 } 10823 ar.Response = future.Response() 10824 return 10825} 10826 10827// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 10828// long-running operation. 10829type VirtualMachineScaleSetVMsUpdateFuture struct { 10830 azure.FutureAPI 10831 // Result returns the result of the asynchronous operation. 10832 // If the operation has not completed it will return an error. 10833 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 10834} 10835 10836// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10837func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 10838 var azFuture azure.Future 10839 if err := json.Unmarshal(body, &azFuture); err != nil { 10840 return err 10841 } 10842 future.FutureAPI = &azFuture 10843 future.Result = future.result 10844 return nil 10845} 10846 10847// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 10848func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 10849 var done bool 10850 done, err = future.DoneWithContext(context.Background(), client) 10851 if err != nil { 10852 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 10853 return 10854 } 10855 if !done { 10856 vmssv.Response.Response = future.Response() 10857 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 10858 return 10859 } 10860 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10861 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 10862 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 10863 if err != nil { 10864 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 10865 } 10866 } 10867 return 10868} 10869 10870// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 10871// operation. 10872type VirtualMachinesCaptureFuture struct { 10873 azure.FutureAPI 10874 // Result returns the result of the asynchronous operation. 10875 // If the operation has not completed it will return an error. 10876 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 10877} 10878 10879// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10880func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 10881 var azFuture azure.Future 10882 if err := json.Unmarshal(body, &azFuture); err != nil { 10883 return err 10884 } 10885 future.FutureAPI = &azFuture 10886 future.Result = future.result 10887 return nil 10888} 10889 10890// result is the default implementation for VirtualMachinesCaptureFuture.Result. 10891func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 10892 var done bool 10893 done, err = future.DoneWithContext(context.Background(), client) 10894 if err != nil { 10895 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 10896 return 10897 } 10898 if !done { 10899 vmcr.Response.Response = future.Response() 10900 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 10901 return 10902 } 10903 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10904 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 10905 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 10906 if err != nil { 10907 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 10908 } 10909 } 10910 return 10911} 10912 10913// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 10914// long-running operation. 10915type VirtualMachinesConvertToManagedDisksFuture struct { 10916 azure.FutureAPI 10917 // Result returns the result of the asynchronous operation. 10918 // If the operation has not completed it will return an error. 10919 Result func(VirtualMachinesClient) (autorest.Response, error) 10920} 10921 10922// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10923func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 10924 var azFuture azure.Future 10925 if err := json.Unmarshal(body, &azFuture); err != nil { 10926 return err 10927 } 10928 future.FutureAPI = &azFuture 10929 future.Result = future.result 10930 return nil 10931} 10932 10933// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 10934func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 10935 var done bool 10936 done, err = future.DoneWithContext(context.Background(), client) 10937 if err != nil { 10938 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 10939 return 10940 } 10941 if !done { 10942 ar.Response = future.Response() 10943 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 10944 return 10945 } 10946 ar.Response = future.Response() 10947 return 10948} 10949 10950// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 10951// long-running operation. 10952type VirtualMachinesCreateOrUpdateFuture struct { 10953 azure.FutureAPI 10954 // Result returns the result of the asynchronous operation. 10955 // If the operation has not completed it will return an error. 10956 Result func(VirtualMachinesClient) (VirtualMachine, error) 10957} 10958 10959// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10960func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10961 var azFuture azure.Future 10962 if err := json.Unmarshal(body, &azFuture); err != nil { 10963 return err 10964 } 10965 future.FutureAPI = &azFuture 10966 future.Result = future.result 10967 return nil 10968} 10969 10970// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 10971func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 10972 var done bool 10973 done, err = future.DoneWithContext(context.Background(), client) 10974 if err != nil { 10975 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10976 return 10977 } 10978 if !done { 10979 VM.Response.Response = future.Response() 10980 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 10981 return 10982 } 10983 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10984 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 10985 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 10986 if err != nil { 10987 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 10988 } 10989 } 10990 return 10991} 10992 10993// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 10994// long-running operation. 10995type VirtualMachinesDeallocateFuture struct { 10996 azure.FutureAPI 10997 // Result returns the result of the asynchronous operation. 10998 // If the operation has not completed it will return an error. 10999 Result func(VirtualMachinesClient) (autorest.Response, error) 11000} 11001 11002// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11003func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 11004 var azFuture azure.Future 11005 if err := json.Unmarshal(body, &azFuture); err != nil { 11006 return err 11007 } 11008 future.FutureAPI = &azFuture 11009 future.Result = future.result 11010 return nil 11011} 11012 11013// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 11014func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11015 var done bool 11016 done, err = future.DoneWithContext(context.Background(), client) 11017 if err != nil { 11018 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 11019 return 11020 } 11021 if !done { 11022 ar.Response = future.Response() 11023 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 11024 return 11025 } 11026 ar.Response = future.Response() 11027 return 11028} 11029 11030// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11031// operation. 11032type VirtualMachinesDeleteFuture struct { 11033 azure.FutureAPI 11034 // Result returns the result of the asynchronous operation. 11035 // If the operation has not completed it will return an error. 11036 Result func(VirtualMachinesClient) (autorest.Response, error) 11037} 11038 11039// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11040func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 11041 var azFuture azure.Future 11042 if err := json.Unmarshal(body, &azFuture); err != nil { 11043 return err 11044 } 11045 future.FutureAPI = &azFuture 11046 future.Result = future.result 11047 return nil 11048} 11049 11050// result is the default implementation for VirtualMachinesDeleteFuture.Result. 11051func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11052 var done bool 11053 done, err = future.DoneWithContext(context.Background(), client) 11054 if err != nil { 11055 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 11056 return 11057 } 11058 if !done { 11059 ar.Response = future.Response() 11060 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 11061 return 11062 } 11063 ar.Response = future.Response() 11064 return 11065} 11066 11067// VirtualMachineSize describes the properties of a VM size. 11068type VirtualMachineSize struct { 11069 // Name - The name of the virtual machine size. 11070 Name *string `json:"name,omitempty"` 11071 // NumberOfCores - The number of cores supported by the virtual machine size. 11072 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 11073 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 11074 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 11075 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 11076 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 11077 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 11078 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 11079 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 11080 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 11081} 11082 11083// VirtualMachineSizeListResult the List Virtual Machine operation response. 11084type VirtualMachineSizeListResult struct { 11085 autorest.Response `json:"-"` 11086 // Value - The list of virtual machine sizes. 11087 Value *[]VirtualMachineSize `json:"value,omitempty"` 11088} 11089 11090// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 11091// long-running operation. 11092type VirtualMachinesPerformMaintenanceFuture struct { 11093 azure.FutureAPI 11094 // Result returns the result of the asynchronous operation. 11095 // If the operation has not completed it will return an error. 11096 Result func(VirtualMachinesClient) (autorest.Response, error) 11097} 11098 11099// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11100func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 11101 var azFuture azure.Future 11102 if err := json.Unmarshal(body, &azFuture); err != nil { 11103 return err 11104 } 11105 future.FutureAPI = &azFuture 11106 future.Result = future.result 11107 return nil 11108} 11109 11110// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 11111func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11112 var done bool 11113 done, err = future.DoneWithContext(context.Background(), client) 11114 if err != nil { 11115 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 11116 return 11117 } 11118 if !done { 11119 ar.Response = future.Response() 11120 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 11121 return 11122 } 11123 ar.Response = future.Response() 11124 return 11125} 11126 11127// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 11128// operation. 11129type VirtualMachinesPowerOffFuture struct { 11130 azure.FutureAPI 11131 // Result returns the result of the asynchronous operation. 11132 // If the operation has not completed it will return an error. 11133 Result func(VirtualMachinesClient) (autorest.Response, error) 11134} 11135 11136// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11137func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 11138 var azFuture azure.Future 11139 if err := json.Unmarshal(body, &azFuture); err != nil { 11140 return err 11141 } 11142 future.FutureAPI = &azFuture 11143 future.Result = future.result 11144 return nil 11145} 11146 11147// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 11148func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11149 var done bool 11150 done, err = future.DoneWithContext(context.Background(), client) 11151 if err != nil { 11152 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 11153 return 11154 } 11155 if !done { 11156 ar.Response = future.Response() 11157 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 11158 return 11159 } 11160 ar.Response = future.Response() 11161 return 11162} 11163 11164// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 11165// operation. 11166type VirtualMachinesRedeployFuture struct { 11167 azure.FutureAPI 11168 // Result returns the result of the asynchronous operation. 11169 // If the operation has not completed it will return an error. 11170 Result func(VirtualMachinesClient) (autorest.Response, error) 11171} 11172 11173// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11174func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 11175 var azFuture azure.Future 11176 if err := json.Unmarshal(body, &azFuture); err != nil { 11177 return err 11178 } 11179 future.FutureAPI = &azFuture 11180 future.Result = future.result 11181 return nil 11182} 11183 11184// result is the default implementation for VirtualMachinesRedeployFuture.Result. 11185func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11186 var done bool 11187 done, err = future.DoneWithContext(context.Background(), client) 11188 if err != nil { 11189 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 11190 return 11191 } 11192 if !done { 11193 ar.Response = future.Response() 11194 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 11195 return 11196 } 11197 ar.Response = future.Response() 11198 return 11199} 11200 11201// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 11202// operation. 11203type VirtualMachinesReimageFuture struct { 11204 azure.FutureAPI 11205 // Result returns the result of the asynchronous operation. 11206 // If the operation has not completed it will return an error. 11207 Result func(VirtualMachinesClient) (autorest.Response, error) 11208} 11209 11210// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11211func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 11212 var azFuture azure.Future 11213 if err := json.Unmarshal(body, &azFuture); err != nil { 11214 return err 11215 } 11216 future.FutureAPI = &azFuture 11217 future.Result = future.result 11218 return nil 11219} 11220 11221// result is the default implementation for VirtualMachinesReimageFuture.Result. 11222func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11223 var done bool 11224 done, err = future.DoneWithContext(context.Background(), client) 11225 if err != nil { 11226 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 11227 return 11228 } 11229 if !done { 11230 ar.Response = future.Response() 11231 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 11232 return 11233 } 11234 ar.Response = future.Response() 11235 return 11236} 11237 11238// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 11239// operation. 11240type VirtualMachinesRestartFuture struct { 11241 azure.FutureAPI 11242 // Result returns the result of the asynchronous operation. 11243 // If the operation has not completed it will return an error. 11244 Result func(VirtualMachinesClient) (autorest.Response, error) 11245} 11246 11247// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11248func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 11249 var azFuture azure.Future 11250 if err := json.Unmarshal(body, &azFuture); err != nil { 11251 return err 11252 } 11253 future.FutureAPI = &azFuture 11254 future.Result = future.result 11255 return nil 11256} 11257 11258// result is the default implementation for VirtualMachinesRestartFuture.Result. 11259func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11260 var done bool 11261 done, err = future.DoneWithContext(context.Background(), client) 11262 if err != nil { 11263 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 11264 return 11265 } 11266 if !done { 11267 ar.Response = future.Response() 11268 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 11269 return 11270 } 11271 ar.Response = future.Response() 11272 return 11273} 11274 11275// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 11276// long-running operation. 11277type VirtualMachinesRunCommandFuture struct { 11278 azure.FutureAPI 11279 // Result returns the result of the asynchronous operation. 11280 // If the operation has not completed it will return an error. 11281 Result func(VirtualMachinesClient) (RunCommandResult, error) 11282} 11283 11284// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11285func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { 11286 var azFuture azure.Future 11287 if err := json.Unmarshal(body, &azFuture); err != nil { 11288 return err 11289 } 11290 future.FutureAPI = &azFuture 11291 future.Result = future.result 11292 return nil 11293} 11294 11295// result is the default implementation for VirtualMachinesRunCommandFuture.Result. 11296func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { 11297 var done bool 11298 done, err = future.DoneWithContext(context.Background(), client) 11299 if err != nil { 11300 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") 11301 return 11302 } 11303 if !done { 11304 rcr.Response.Response = future.Response() 11305 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") 11306 return 11307 } 11308 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11309 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 11310 rcr, err = client.RunCommandResponder(rcr.Response.Response) 11311 if err != nil { 11312 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 11313 } 11314 } 11315 return 11316} 11317 11318// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 11319// operation. 11320type VirtualMachinesStartFuture struct { 11321 azure.FutureAPI 11322 // Result returns the result of the asynchronous operation. 11323 // If the operation has not completed it will return an error. 11324 Result func(VirtualMachinesClient) (autorest.Response, error) 11325} 11326 11327// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11328func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 11329 var azFuture azure.Future 11330 if err := json.Unmarshal(body, &azFuture); err != nil { 11331 return err 11332 } 11333 future.FutureAPI = &azFuture 11334 future.Result = future.result 11335 return nil 11336} 11337 11338// result is the default implementation for VirtualMachinesStartFuture.Result. 11339func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11340 var done bool 11341 done, err = future.DoneWithContext(context.Background(), client) 11342 if err != nil { 11343 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 11344 return 11345 } 11346 if !done { 11347 ar.Response = future.Response() 11348 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 11349 return 11350 } 11351 ar.Response = future.Response() 11352 return 11353} 11354 11355// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 11356// status summary. 11357type VirtualMachineStatusCodeCount struct { 11358 // Code - READ-ONLY; The instance view status code. 11359 Code *string `json:"code,omitempty"` 11360 // Count - READ-ONLY; The number of instances having a particular status code. 11361 Count *int32 `json:"count,omitempty"` 11362} 11363 11364// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. 11365func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { 11366 objectMap := make(map[string]interface{}) 11367 return json.Marshal(objectMap) 11368} 11369 11370// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 11371// operation. 11372type VirtualMachinesUpdateFuture struct { 11373 azure.FutureAPI 11374 // Result returns the result of the asynchronous operation. 11375 // If the operation has not completed it will return an error. 11376 Result func(VirtualMachinesClient) (VirtualMachine, error) 11377} 11378 11379// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11380func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 11381 var azFuture azure.Future 11382 if err := json.Unmarshal(body, &azFuture); err != nil { 11383 return err 11384 } 11385 future.FutureAPI = &azFuture 11386 future.Result = future.result 11387 return nil 11388} 11389 11390// result is the default implementation for VirtualMachinesUpdateFuture.Result. 11391func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 11392 var done bool 11393 done, err = future.DoneWithContext(context.Background(), client) 11394 if err != nil { 11395 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 11396 return 11397 } 11398 if !done { 11399 VM.Response.Response = future.Response() 11400 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 11401 return 11402 } 11403 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11404 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 11405 VM, err = client.UpdateResponder(VM.Response.Response) 11406 if err != nil { 11407 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 11408 } 11409 } 11410 return 11411} 11412 11413// VirtualMachineUpdate describes a Virtual Machine Update. 11414type VirtualMachineUpdate struct { 11415 // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. 11416 Plan *Plan `json:"plan,omitempty"` 11417 *VirtualMachineProperties `json:"properties,omitempty"` 11418 // Identity - The identity of the virtual machine, if configured. 11419 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 11420 // Zones - The virtual machine zones. 11421 Zones *[]string `json:"zones,omitempty"` 11422 // Tags - Resource tags 11423 Tags map[string]*string `json:"tags"` 11424} 11425 11426// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 11427func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 11428 objectMap := make(map[string]interface{}) 11429 if vmu.Plan != nil { 11430 objectMap["plan"] = vmu.Plan 11431 } 11432 if vmu.VirtualMachineProperties != nil { 11433 objectMap["properties"] = vmu.VirtualMachineProperties 11434 } 11435 if vmu.Identity != nil { 11436 objectMap["identity"] = vmu.Identity 11437 } 11438 if vmu.Zones != nil { 11439 objectMap["zones"] = vmu.Zones 11440 } 11441 if vmu.Tags != nil { 11442 objectMap["tags"] = vmu.Tags 11443 } 11444 return json.Marshal(objectMap) 11445} 11446 11447// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 11448func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 11449 var m map[string]*json.RawMessage 11450 err := json.Unmarshal(body, &m) 11451 if err != nil { 11452 return err 11453 } 11454 for k, v := range m { 11455 switch k { 11456 case "plan": 11457 if v != nil { 11458 var plan Plan 11459 err = json.Unmarshal(*v, &plan) 11460 if err != nil { 11461 return err 11462 } 11463 vmu.Plan = &plan 11464 } 11465 case "properties": 11466 if v != nil { 11467 var virtualMachineProperties VirtualMachineProperties 11468 err = json.Unmarshal(*v, &virtualMachineProperties) 11469 if err != nil { 11470 return err 11471 } 11472 vmu.VirtualMachineProperties = &virtualMachineProperties 11473 } 11474 case "identity": 11475 if v != nil { 11476 var identity VirtualMachineIdentity 11477 err = json.Unmarshal(*v, &identity) 11478 if err != nil { 11479 return err 11480 } 11481 vmu.Identity = &identity 11482 } 11483 case "zones": 11484 if v != nil { 11485 var zones []string 11486 err = json.Unmarshal(*v, &zones) 11487 if err != nil { 11488 return err 11489 } 11490 vmu.Zones = &zones 11491 } 11492 case "tags": 11493 if v != nil { 11494 var tags map[string]*string 11495 err = json.Unmarshal(*v, &tags) 11496 if err != nil { 11497 return err 11498 } 11499 vmu.Tags = tags 11500 } 11501 } 11502 } 11503 11504 return nil 11505} 11506 11507// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 11508type WindowsConfiguration struct { 11509 // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine. <br><br> When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. 11510 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 11511 // EnableAutomaticUpdates - Indicates whether virtual machine is enabled for automatic Windows updates. Default value is true. <br><br> For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. 11512 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 11513 // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" 11514 TimeZone *string `json:"timeZone,omitempty"` 11515 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 11516 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 11517 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 11518 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 11519} 11520 11521// WinRMConfiguration describes Windows Remote Management configuration of the VM 11522type WinRMConfiguration struct { 11523 // Listeners - The list of Windows Remote Management listeners 11524 Listeners *[]WinRMListener `json:"listeners,omitempty"` 11525} 11526 11527// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 11528type WinRMListener struct { 11529 // Protocol - Specifies the protocol of listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 11530 Protocol ProtocolTypes `json:"protocol,omitempty"` 11531 // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>} 11532 CertificateURL *string `json:"certificateUrl,omitempty"` 11533} 11534