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/2019-07-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. <br><br> If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. 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// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 492// api-version: 2019-03-01. 493type BillingProfile struct { 494 // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum api-version: 2019-03-01. 495 MaxPrice *float64 `json:"maxPrice,omitempty"` 496} 497 498// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 499// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 500// Azure also enables you to see a screenshot of the VM from the hypervisor. 501type BootDiagnostics struct { 502 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 503 Enabled *bool `json:"enabled,omitempty"` 504 // StorageURI - Uri of the storage account to use for placing the console output and screenshot. 505 StorageURI *string `json:"storageUri,omitempty"` 506} 507 508// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 509type BootDiagnosticsInstanceView struct { 510 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. 511 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 512 // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri. 513 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 514 // 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. 515 Status *InstanceViewStatus `json:"status,omitempty"` 516} 517 518// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. 519func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { 520 objectMap := make(map[string]interface{}) 521 return json.Marshal(objectMap) 522} 523 524// CloudError an error response from the Compute service. 525type CloudError struct { 526 Error *APIError `json:"error,omitempty"` 527} 528 529// ContainerService container service. 530type ContainerService struct { 531 autorest.Response `json:"-"` 532 *ContainerServiceProperties `json:"properties,omitempty"` 533 // ID - READ-ONLY; Resource Id 534 ID *string `json:"id,omitempty"` 535 // Name - READ-ONLY; Resource name 536 Name *string `json:"name,omitempty"` 537 // Type - READ-ONLY; Resource type 538 Type *string `json:"type,omitempty"` 539 // Location - Resource location 540 Location *string `json:"location,omitempty"` 541 // Tags - Resource tags 542 Tags map[string]*string `json:"tags"` 543} 544 545// MarshalJSON is the custom marshaler for ContainerService. 546func (cs ContainerService) MarshalJSON() ([]byte, error) { 547 objectMap := make(map[string]interface{}) 548 if cs.ContainerServiceProperties != nil { 549 objectMap["properties"] = cs.ContainerServiceProperties 550 } 551 if cs.Location != nil { 552 objectMap["location"] = cs.Location 553 } 554 if cs.Tags != nil { 555 objectMap["tags"] = cs.Tags 556 } 557 return json.Marshal(objectMap) 558} 559 560// UnmarshalJSON is the custom unmarshaler for ContainerService struct. 561func (cs *ContainerService) UnmarshalJSON(body []byte) error { 562 var m map[string]*json.RawMessage 563 err := json.Unmarshal(body, &m) 564 if err != nil { 565 return err 566 } 567 for k, v := range m { 568 switch k { 569 case "properties": 570 if v != nil { 571 var containerServiceProperties ContainerServiceProperties 572 err = json.Unmarshal(*v, &containerServiceProperties) 573 if err != nil { 574 return err 575 } 576 cs.ContainerServiceProperties = &containerServiceProperties 577 } 578 case "id": 579 if v != nil { 580 var ID string 581 err = json.Unmarshal(*v, &ID) 582 if err != nil { 583 return err 584 } 585 cs.ID = &ID 586 } 587 case "name": 588 if v != nil { 589 var name string 590 err = json.Unmarshal(*v, &name) 591 if err != nil { 592 return err 593 } 594 cs.Name = &name 595 } 596 case "type": 597 if v != nil { 598 var typeVar string 599 err = json.Unmarshal(*v, &typeVar) 600 if err != nil { 601 return err 602 } 603 cs.Type = &typeVar 604 } 605 case "location": 606 if v != nil { 607 var location string 608 err = json.Unmarshal(*v, &location) 609 if err != nil { 610 return err 611 } 612 cs.Location = &location 613 } 614 case "tags": 615 if v != nil { 616 var tags map[string]*string 617 err = json.Unmarshal(*v, &tags) 618 if err != nil { 619 return err 620 } 621 cs.Tags = tags 622 } 623 } 624 } 625 626 return nil 627} 628 629// ContainerServiceAgentPoolProfile profile for the container service agent pool. 630type ContainerServiceAgentPoolProfile struct { 631 // Name - Unique name of the agent pool profile in the context of the subscription and resource group. 632 Name *string `json:"name,omitempty"` 633 // 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. 634 Count *int32 `json:"count,omitempty"` 635 // 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' 636 VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` 637 // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. 638 DNSPrefix *string `json:"dnsPrefix,omitempty"` 639 // Fqdn - READ-ONLY; FQDN for the agent pool. 640 Fqdn *string `json:"fqdn,omitempty"` 641} 642 643// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. 644func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { 645 objectMap := make(map[string]interface{}) 646 if csapp.Name != nil { 647 objectMap["name"] = csapp.Name 648 } 649 if csapp.Count != nil { 650 objectMap["count"] = csapp.Count 651 } 652 if csapp.VMSize != "" { 653 objectMap["vmSize"] = csapp.VMSize 654 } 655 if csapp.DNSPrefix != nil { 656 objectMap["dnsPrefix"] = csapp.DNSPrefix 657 } 658 return json.Marshal(objectMap) 659} 660 661// ContainerServiceCustomProfile properties to configure a custom container service cluster. 662type ContainerServiceCustomProfile struct { 663 // Orchestrator - The name of the custom orchestrator to use. 664 Orchestrator *string `json:"orchestrator,omitempty"` 665} 666 667// ContainerServiceDiagnosticsProfile ... 668type ContainerServiceDiagnosticsProfile struct { 669 // VMDiagnostics - Profile for the container service VM diagnostic agent. 670 VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` 671} 672 673// ContainerServiceLinuxProfile profile for Linux VMs in the container service cluster. 674type ContainerServiceLinuxProfile struct { 675 // AdminUsername - The administrator username to use for Linux VMs. 676 AdminUsername *string `json:"adminUsername,omitempty"` 677 // SSH - The ssh key configuration for Linux VMs. 678 SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` 679} 680 681// ContainerServiceListResult the response from the List Container Services operation. 682type ContainerServiceListResult struct { 683 autorest.Response `json:"-"` 684 // Value - the list of container services. 685 Value *[]ContainerService `json:"value,omitempty"` 686 // NextLink - The URL to get the next set of container service results. 687 NextLink *string `json:"nextLink,omitempty"` 688} 689 690// ContainerServiceListResultIterator provides access to a complete listing of ContainerService values. 691type ContainerServiceListResultIterator struct { 692 i int 693 page ContainerServiceListResultPage 694} 695 696// NextWithContext advances to the next value. If there was an error making 697// the request the iterator does not advance and the error is returned. 698func (iter *ContainerServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 699 if tracing.IsEnabled() { 700 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultIterator.NextWithContext") 701 defer func() { 702 sc := -1 703 if iter.Response().Response.Response != nil { 704 sc = iter.Response().Response.Response.StatusCode 705 } 706 tracing.EndSpan(ctx, sc, err) 707 }() 708 } 709 iter.i++ 710 if iter.i < len(iter.page.Values()) { 711 return nil 712 } 713 err = iter.page.NextWithContext(ctx) 714 if err != nil { 715 iter.i-- 716 return err 717 } 718 iter.i = 0 719 return nil 720} 721 722// Next advances to the next value. If there was an error making 723// the request the iterator does not advance and the error is returned. 724// Deprecated: Use NextWithContext() instead. 725func (iter *ContainerServiceListResultIterator) Next() error { 726 return iter.NextWithContext(context.Background()) 727} 728 729// NotDone returns true if the enumeration should be started or is not yet complete. 730func (iter ContainerServiceListResultIterator) NotDone() bool { 731 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 732} 733 734// Response returns the raw server response from the last page request. 735func (iter ContainerServiceListResultIterator) Response() ContainerServiceListResult { 736 return iter.page.Response() 737} 738 739// Value returns the current value or a zero-initialized value if the 740// iterator has advanced beyond the end of the collection. 741func (iter ContainerServiceListResultIterator) Value() ContainerService { 742 if !iter.page.NotDone() { 743 return ContainerService{} 744 } 745 return iter.page.Values()[iter.i] 746} 747 748// Creates a new instance of the ContainerServiceListResultIterator type. 749func NewContainerServiceListResultIterator(page ContainerServiceListResultPage) ContainerServiceListResultIterator { 750 return ContainerServiceListResultIterator{page: page} 751} 752 753// IsEmpty returns true if the ListResult contains no values. 754func (cslr ContainerServiceListResult) IsEmpty() bool { 755 return cslr.Value == nil || len(*cslr.Value) == 0 756} 757 758// hasNextLink returns true if the NextLink is not empty. 759func (cslr ContainerServiceListResult) hasNextLink() bool { 760 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 761} 762 763// containerServiceListResultPreparer prepares a request to retrieve the next set of results. 764// It returns nil if no more results exist. 765func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 766 if !cslr.hasNextLink() { 767 return nil, nil 768 } 769 return autorest.Prepare((&http.Request{}).WithContext(ctx), 770 autorest.AsJSON(), 771 autorest.AsGet(), 772 autorest.WithBaseURL(to.String(cslr.NextLink))) 773} 774 775// ContainerServiceListResultPage contains a page of ContainerService values. 776type ContainerServiceListResultPage struct { 777 fn func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error) 778 cslr ContainerServiceListResult 779} 780 781// NextWithContext advances to the next page of values. If there was an error making 782// the request the page does not advance and the error is returned. 783func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 784 if tracing.IsEnabled() { 785 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultPage.NextWithContext") 786 defer func() { 787 sc := -1 788 if page.Response().Response.Response != nil { 789 sc = page.Response().Response.Response.StatusCode 790 } 791 tracing.EndSpan(ctx, sc, err) 792 }() 793 } 794 for { 795 next, err := page.fn(ctx, page.cslr) 796 if err != nil { 797 return err 798 } 799 page.cslr = next 800 if !next.hasNextLink() || !next.IsEmpty() { 801 break 802 } 803 } 804 return nil 805} 806 807// Next advances to the next page of values. If there was an error making 808// the request the page does not advance and the error is returned. 809// Deprecated: Use NextWithContext() instead. 810func (page *ContainerServiceListResultPage) Next() error { 811 return page.NextWithContext(context.Background()) 812} 813 814// NotDone returns true if the page enumeration should be started or is not yet complete. 815func (page ContainerServiceListResultPage) NotDone() bool { 816 return !page.cslr.IsEmpty() 817} 818 819// Response returns the raw server response from the last page request. 820func (page ContainerServiceListResultPage) Response() ContainerServiceListResult { 821 return page.cslr 822} 823 824// Values returns the slice of values for the current page or nil if there are no values. 825func (page ContainerServiceListResultPage) Values() []ContainerService { 826 if page.cslr.IsEmpty() { 827 return nil 828 } 829 return *page.cslr.Value 830} 831 832// Creates a new instance of the ContainerServiceListResultPage type. 833func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { 834 return ContainerServiceListResultPage{ 835 fn: getNextPage, 836 cslr: cur, 837 } 838} 839 840// ContainerServiceMasterProfile profile for the container service master. 841type ContainerServiceMasterProfile struct { 842 // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 843 Count *int32 `json:"count,omitempty"` 844 // DNSPrefix - DNS prefix to be used to create the FQDN for master. 845 DNSPrefix *string `json:"dnsPrefix,omitempty"` 846 // Fqdn - READ-ONLY; FQDN for the master. 847 Fqdn *string `json:"fqdn,omitempty"` 848} 849 850// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. 851func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { 852 objectMap := make(map[string]interface{}) 853 if csmp.Count != nil { 854 objectMap["count"] = csmp.Count 855 } 856 if csmp.DNSPrefix != nil { 857 objectMap["dnsPrefix"] = csmp.DNSPrefix 858 } 859 return json.Marshal(objectMap) 860} 861 862// ContainerServiceOrchestratorProfile profile for the container service orchestrator. 863type ContainerServiceOrchestratorProfile struct { 864 // 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' 865 OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` 866} 867 868// ContainerServiceProperties properties of the container service. 869type ContainerServiceProperties struct { 870 // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. 871 ProvisioningState *string `json:"provisioningState,omitempty"` 872 // OrchestratorProfile - Properties of the orchestrator. 873 OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` 874 // CustomProfile - Properties for custom clusters. 875 CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` 876 // ServicePrincipalProfile - Properties for cluster service principals. 877 ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 878 // MasterProfile - Properties of master agents. 879 MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` 880 // AgentPoolProfiles - Properties of the agent pool. 881 AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` 882 // WindowsProfile - Properties of Windows VMs. 883 WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` 884 // LinuxProfile - Properties of Linux VMs. 885 LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` 886 // DiagnosticsProfile - Properties of the diagnostic agent. 887 DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 888} 889 890// MarshalJSON is the custom marshaler for ContainerServiceProperties. 891func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { 892 objectMap := make(map[string]interface{}) 893 if csp.OrchestratorProfile != nil { 894 objectMap["orchestratorProfile"] = csp.OrchestratorProfile 895 } 896 if csp.CustomProfile != nil { 897 objectMap["customProfile"] = csp.CustomProfile 898 } 899 if csp.ServicePrincipalProfile != nil { 900 objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile 901 } 902 if csp.MasterProfile != nil { 903 objectMap["masterProfile"] = csp.MasterProfile 904 } 905 if csp.AgentPoolProfiles != nil { 906 objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles 907 } 908 if csp.WindowsProfile != nil { 909 objectMap["windowsProfile"] = csp.WindowsProfile 910 } 911 if csp.LinuxProfile != nil { 912 objectMap["linuxProfile"] = csp.LinuxProfile 913 } 914 if csp.DiagnosticsProfile != nil { 915 objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile 916 } 917 return json.Marshal(objectMap) 918} 919 920// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 921// long-running operation. 922type ContainerServicesCreateOrUpdateFuture struct { 923 azure.FutureAPI 924 // Result returns the result of the asynchronous operation. 925 // If the operation has not completed it will return an error. 926 Result func(ContainerServicesClient) (ContainerService, error) 927} 928 929// UnmarshalJSON is the custom unmarshaller for CreateFuture. 930func (future *ContainerServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 931 var azFuture azure.Future 932 if err := json.Unmarshal(body, &azFuture); err != nil { 933 return err 934 } 935 future.FutureAPI = &azFuture 936 future.Result = future.result 937 return nil 938} 939 940// result is the default implementation for ContainerServicesCreateOrUpdateFuture.Result. 941func (future *ContainerServicesCreateOrUpdateFuture) result(client ContainerServicesClient) (cs ContainerService, err error) { 942 var done bool 943 done, err = future.DoneWithContext(context.Background(), client) 944 if err != nil { 945 err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 946 return 947 } 948 if !done { 949 cs.Response.Response = future.Response() 950 err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesCreateOrUpdateFuture") 951 return 952 } 953 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 954 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 955 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 956 if err != nil { 957 err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 958 } 959 } 960 return 961} 962 963// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 964// operation. 965type ContainerServicesDeleteFuture struct { 966 azure.FutureAPI 967 // Result returns the result of the asynchronous operation. 968 // If the operation has not completed it will return an error. 969 Result func(ContainerServicesClient) (autorest.Response, error) 970} 971 972// UnmarshalJSON is the custom unmarshaller for CreateFuture. 973func (future *ContainerServicesDeleteFuture) UnmarshalJSON(body []byte) error { 974 var azFuture azure.Future 975 if err := json.Unmarshal(body, &azFuture); err != nil { 976 return err 977 } 978 future.FutureAPI = &azFuture 979 future.Result = future.result 980 return nil 981} 982 983// result is the default implementation for ContainerServicesDeleteFuture.Result. 984func (future *ContainerServicesDeleteFuture) result(client ContainerServicesClient) (ar autorest.Response, err error) { 985 var done bool 986 done, err = future.DoneWithContext(context.Background(), client) 987 if err != nil { 988 err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", future.Response(), "Polling failure") 989 return 990 } 991 if !done { 992 ar.Response = future.Response() 993 err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesDeleteFuture") 994 return 995 } 996 ar.Response = future.Response() 997 return 998} 999 1000// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster 1001// to use for manipulating Azure APIs. 1002type ContainerServiceServicePrincipalProfile struct { 1003 // ClientID - The ID for the service principal. 1004 ClientID *string `json:"clientId,omitempty"` 1005 // Secret - The secret password associated with the service principal. 1006 Secret *string `json:"secret,omitempty"` 1007} 1008 1009// ContainerServiceSSHConfiguration SSH configuration for Linux-based VMs running on Azure. 1010type ContainerServiceSSHConfiguration struct { 1011 // PublicKeys - the list of SSH public keys used to authenticate with Linux-based VMs. 1012 PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` 1013} 1014 1015// ContainerServiceSSHPublicKey contains information about SSH certificate public key data. 1016type ContainerServiceSSHPublicKey struct { 1017 // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. 1018 KeyData *string `json:"keyData,omitempty"` 1019} 1020 1021// ContainerServiceVMDiagnostics profile for diagnostics on the container service VMs. 1022type ContainerServiceVMDiagnostics struct { 1023 // Enabled - Whether the VM diagnostic agent is provisioned on the VM. 1024 Enabled *bool `json:"enabled,omitempty"` 1025 // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. 1026 StorageURI *string `json:"storageUri,omitempty"` 1027} 1028 1029// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. 1030func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { 1031 objectMap := make(map[string]interface{}) 1032 if csvd.Enabled != nil { 1033 objectMap["enabled"] = csvd.Enabled 1034 } 1035 return json.Marshal(objectMap) 1036} 1037 1038// ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. 1039type ContainerServiceWindowsProfile struct { 1040 // AdminUsername - The administrator username to use for Windows VMs. 1041 AdminUsername *string `json:"adminUsername,omitempty"` 1042 // AdminPassword - The administrator password to use for Windows VMs. 1043 AdminPassword *string `json:"adminPassword,omitempty"` 1044} 1045 1046// CreationData data used when creating a disk. 1047type CreationData struct { 1048 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' 1049 CreateOption DiskCreateOption `json:"createOption,omitempty"` 1050 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 1051 StorageAccountID *string `json:"storageAccountId,omitempty"` 1052 // ImageReference - Disk source information. 1053 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 1054 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 1055 SourceURI *string `json:"sourceUri,omitempty"` 1056 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 1057 SourceResourceID *string `json:"sourceResourceId,omitempty"` 1058 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 1059 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 1060 // UploadSizeBytes - If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). 1061 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 1062} 1063 1064// MarshalJSON is the custom marshaler for CreationData. 1065func (cd CreationData) MarshalJSON() ([]byte, error) { 1066 objectMap := make(map[string]interface{}) 1067 if cd.CreateOption != "" { 1068 objectMap["createOption"] = cd.CreateOption 1069 } 1070 if cd.StorageAccountID != nil { 1071 objectMap["storageAccountId"] = cd.StorageAccountID 1072 } 1073 if cd.ImageReference != nil { 1074 objectMap["imageReference"] = cd.ImageReference 1075 } 1076 if cd.SourceURI != nil { 1077 objectMap["sourceUri"] = cd.SourceURI 1078 } 1079 if cd.SourceResourceID != nil { 1080 objectMap["sourceResourceId"] = cd.SourceResourceID 1081 } 1082 if cd.UploadSizeBytes != nil { 1083 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 1084 } 1085 return json.Marshal(objectMap) 1086} 1087 1088// DataDisk describes a data disk. 1089type DataDisk struct { 1090 // 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. 1091 Lun *int32 `json:"lun,omitempty"` 1092 // Name - The disk name. 1093 Name *string `json:"name,omitempty"` 1094 // Vhd - The virtual hard disk. 1095 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1096 // 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. 1097 Image *VirtualHardDisk `json:"image,omitempty"` 1098 // 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' 1099 Caching CachingTypes `json:"caching,omitempty"` 1100 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1101 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1102 // 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' 1103 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1104 // 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 1105 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1106 // ManagedDisk - The managed disk parameters. 1107 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1108 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 1109 ToBeDetached *bool `json:"toBeDetached,omitempty"` 1110 // DiskIOPSReadWrite - READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. 1111 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1112 // DiskMBpsReadWrite - READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. 1113 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 1114} 1115 1116// MarshalJSON is the custom marshaler for DataDisk. 1117func (dd DataDisk) MarshalJSON() ([]byte, error) { 1118 objectMap := make(map[string]interface{}) 1119 if dd.Lun != nil { 1120 objectMap["lun"] = dd.Lun 1121 } 1122 if dd.Name != nil { 1123 objectMap["name"] = dd.Name 1124 } 1125 if dd.Vhd != nil { 1126 objectMap["vhd"] = dd.Vhd 1127 } 1128 if dd.Image != nil { 1129 objectMap["image"] = dd.Image 1130 } 1131 if dd.Caching != "" { 1132 objectMap["caching"] = dd.Caching 1133 } 1134 if dd.WriteAcceleratorEnabled != nil { 1135 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 1136 } 1137 if dd.CreateOption != "" { 1138 objectMap["createOption"] = dd.CreateOption 1139 } 1140 if dd.DiskSizeGB != nil { 1141 objectMap["diskSizeGB"] = dd.DiskSizeGB 1142 } 1143 if dd.ManagedDisk != nil { 1144 objectMap["managedDisk"] = dd.ManagedDisk 1145 } 1146 if dd.ToBeDetached != nil { 1147 objectMap["toBeDetached"] = dd.ToBeDetached 1148 } 1149 return json.Marshal(objectMap) 1150} 1151 1152// DataDiskImage contains the data disk images information. 1153type DataDiskImage struct { 1154 // 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. 1155 Lun *int32 `json:"lun,omitempty"` 1156} 1157 1158// MarshalJSON is the custom marshaler for DataDiskImage. 1159func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { 1160 objectMap := make(map[string]interface{}) 1161 return json.Marshal(objectMap) 1162} 1163 1164// DedicatedHost specifies information about the Dedicated host. 1165type DedicatedHost struct { 1166 autorest.Response `json:"-"` 1167 *DedicatedHostProperties `json:"properties,omitempty"` 1168 // Sku - SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. 1169 Sku *Sku `json:"sku,omitempty"` 1170 // ID - READ-ONLY; Resource Id 1171 ID *string `json:"id,omitempty"` 1172 // Name - READ-ONLY; Resource name 1173 Name *string `json:"name,omitempty"` 1174 // Type - READ-ONLY; Resource type 1175 Type *string `json:"type,omitempty"` 1176 // Location - Resource location 1177 Location *string `json:"location,omitempty"` 1178 // Tags - Resource tags 1179 Tags map[string]*string `json:"tags"` 1180} 1181 1182// MarshalJSON is the custom marshaler for DedicatedHost. 1183func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 1184 objectMap := make(map[string]interface{}) 1185 if dh.DedicatedHostProperties != nil { 1186 objectMap["properties"] = dh.DedicatedHostProperties 1187 } 1188 if dh.Sku != nil { 1189 objectMap["sku"] = dh.Sku 1190 } 1191 if dh.Location != nil { 1192 objectMap["location"] = dh.Location 1193 } 1194 if dh.Tags != nil { 1195 objectMap["tags"] = dh.Tags 1196 } 1197 return json.Marshal(objectMap) 1198} 1199 1200// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 1201func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 1202 var m map[string]*json.RawMessage 1203 err := json.Unmarshal(body, &m) 1204 if err != nil { 1205 return err 1206 } 1207 for k, v := range m { 1208 switch k { 1209 case "properties": 1210 if v != nil { 1211 var dedicatedHostProperties DedicatedHostProperties 1212 err = json.Unmarshal(*v, &dedicatedHostProperties) 1213 if err != nil { 1214 return err 1215 } 1216 dh.DedicatedHostProperties = &dedicatedHostProperties 1217 } 1218 case "sku": 1219 if v != nil { 1220 var sku Sku 1221 err = json.Unmarshal(*v, &sku) 1222 if err != nil { 1223 return err 1224 } 1225 dh.Sku = &sku 1226 } 1227 case "id": 1228 if v != nil { 1229 var ID string 1230 err = json.Unmarshal(*v, &ID) 1231 if err != nil { 1232 return err 1233 } 1234 dh.ID = &ID 1235 } 1236 case "name": 1237 if v != nil { 1238 var name string 1239 err = json.Unmarshal(*v, &name) 1240 if err != nil { 1241 return err 1242 } 1243 dh.Name = &name 1244 } 1245 case "type": 1246 if v != nil { 1247 var typeVar string 1248 err = json.Unmarshal(*v, &typeVar) 1249 if err != nil { 1250 return err 1251 } 1252 dh.Type = &typeVar 1253 } 1254 case "location": 1255 if v != nil { 1256 var location string 1257 err = json.Unmarshal(*v, &location) 1258 if err != nil { 1259 return err 1260 } 1261 dh.Location = &location 1262 } 1263 case "tags": 1264 if v != nil { 1265 var tags map[string]*string 1266 err = json.Unmarshal(*v, &tags) 1267 if err != nil { 1268 return err 1269 } 1270 dh.Tags = tags 1271 } 1272 } 1273 } 1274 1275 return nil 1276} 1277 1278// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 1279// size. 1280type DedicatedHostAllocatableVM struct { 1281 // VMSize - VM size in terms of which the unutilized capacity is represented. 1282 VMSize *string `json:"vmSize,omitempty"` 1283 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 1284 Count *float64 `json:"count,omitempty"` 1285} 1286 1287// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 1288type DedicatedHostAvailableCapacity struct { 1289 // AllocatableVMs - The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. 1290 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 1291} 1292 1293// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 1294// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 1295// creation time. An existing dedicated host cannot be added to another dedicated host group. 1296type DedicatedHostGroup struct { 1297 autorest.Response `json:"-"` 1298 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1299 // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. 1300 Zones *[]string `json:"zones,omitempty"` 1301 // ID - READ-ONLY; Resource Id 1302 ID *string `json:"id,omitempty"` 1303 // Name - READ-ONLY; Resource name 1304 Name *string `json:"name,omitempty"` 1305 // Type - READ-ONLY; Resource type 1306 Type *string `json:"type,omitempty"` 1307 // Location - Resource location 1308 Location *string `json:"location,omitempty"` 1309 // Tags - Resource tags 1310 Tags map[string]*string `json:"tags"` 1311} 1312 1313// MarshalJSON is the custom marshaler for DedicatedHostGroup. 1314func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 1315 objectMap := make(map[string]interface{}) 1316 if dhg.DedicatedHostGroupProperties != nil { 1317 objectMap["properties"] = dhg.DedicatedHostGroupProperties 1318 } 1319 if dhg.Zones != nil { 1320 objectMap["zones"] = dhg.Zones 1321 } 1322 if dhg.Location != nil { 1323 objectMap["location"] = dhg.Location 1324 } 1325 if dhg.Tags != nil { 1326 objectMap["tags"] = dhg.Tags 1327 } 1328 return json.Marshal(objectMap) 1329} 1330 1331// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 1332func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 1333 var m map[string]*json.RawMessage 1334 err := json.Unmarshal(body, &m) 1335 if err != nil { 1336 return err 1337 } 1338 for k, v := range m { 1339 switch k { 1340 case "properties": 1341 if v != nil { 1342 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1343 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1344 if err != nil { 1345 return err 1346 } 1347 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1348 } 1349 case "zones": 1350 if v != nil { 1351 var zones []string 1352 err = json.Unmarshal(*v, &zones) 1353 if err != nil { 1354 return err 1355 } 1356 dhg.Zones = &zones 1357 } 1358 case "id": 1359 if v != nil { 1360 var ID string 1361 err = json.Unmarshal(*v, &ID) 1362 if err != nil { 1363 return err 1364 } 1365 dhg.ID = &ID 1366 } 1367 case "name": 1368 if v != nil { 1369 var name string 1370 err = json.Unmarshal(*v, &name) 1371 if err != nil { 1372 return err 1373 } 1374 dhg.Name = &name 1375 } 1376 case "type": 1377 if v != nil { 1378 var typeVar string 1379 err = json.Unmarshal(*v, &typeVar) 1380 if err != nil { 1381 return err 1382 } 1383 dhg.Type = &typeVar 1384 } 1385 case "location": 1386 if v != nil { 1387 var location string 1388 err = json.Unmarshal(*v, &location) 1389 if err != nil { 1390 return err 1391 } 1392 dhg.Location = &location 1393 } 1394 case "tags": 1395 if v != nil { 1396 var tags map[string]*string 1397 err = json.Unmarshal(*v, &tags) 1398 if err != nil { 1399 return err 1400 } 1401 dhg.Tags = tags 1402 } 1403 } 1404 } 1405 1406 return nil 1407} 1408 1409// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 1410type DedicatedHostGroupListResult struct { 1411 autorest.Response `json:"-"` 1412 // Value - The list of dedicated host groups 1413 Value *[]DedicatedHostGroup `json:"value,omitempty"` 1414 // NextLink - The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. 1415 NextLink *string `json:"nextLink,omitempty"` 1416} 1417 1418// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 1419type DedicatedHostGroupListResultIterator struct { 1420 i int 1421 page DedicatedHostGroupListResultPage 1422} 1423 1424// NextWithContext advances to the next value. If there was an error making 1425// the request the iterator does not advance and the error is returned. 1426func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 1427 if tracing.IsEnabled() { 1428 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 1429 defer func() { 1430 sc := -1 1431 if iter.Response().Response.Response != nil { 1432 sc = iter.Response().Response.Response.StatusCode 1433 } 1434 tracing.EndSpan(ctx, sc, err) 1435 }() 1436 } 1437 iter.i++ 1438 if iter.i < len(iter.page.Values()) { 1439 return nil 1440 } 1441 err = iter.page.NextWithContext(ctx) 1442 if err != nil { 1443 iter.i-- 1444 return err 1445 } 1446 iter.i = 0 1447 return nil 1448} 1449 1450// Next advances to the next value. If there was an error making 1451// the request the iterator does not advance and the error is returned. 1452// Deprecated: Use NextWithContext() instead. 1453func (iter *DedicatedHostGroupListResultIterator) Next() error { 1454 return iter.NextWithContext(context.Background()) 1455} 1456 1457// NotDone returns true if the enumeration should be started or is not yet complete. 1458func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 1459 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1460} 1461 1462// Response returns the raw server response from the last page request. 1463func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 1464 return iter.page.Response() 1465} 1466 1467// Value returns the current value or a zero-initialized value if the 1468// iterator has advanced beyond the end of the collection. 1469func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 1470 if !iter.page.NotDone() { 1471 return DedicatedHostGroup{} 1472 } 1473 return iter.page.Values()[iter.i] 1474} 1475 1476// Creates a new instance of the DedicatedHostGroupListResultIterator type. 1477func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 1478 return DedicatedHostGroupListResultIterator{page: page} 1479} 1480 1481// IsEmpty returns true if the ListResult contains no values. 1482func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 1483 return dhglr.Value == nil || len(*dhglr.Value) == 0 1484} 1485 1486// hasNextLink returns true if the NextLink is not empty. 1487func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 1488 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 1489} 1490 1491// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 1492// It returns nil if no more results exist. 1493func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 1494 if !dhglr.hasNextLink() { 1495 return nil, nil 1496 } 1497 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1498 autorest.AsJSON(), 1499 autorest.AsGet(), 1500 autorest.WithBaseURL(to.String(dhglr.NextLink))) 1501} 1502 1503// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 1504type DedicatedHostGroupListResultPage struct { 1505 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 1506 dhglr DedicatedHostGroupListResult 1507} 1508 1509// NextWithContext advances to the next page of values. If there was an error making 1510// the request the page does not advance and the error is returned. 1511func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1512 if tracing.IsEnabled() { 1513 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 1514 defer func() { 1515 sc := -1 1516 if page.Response().Response.Response != nil { 1517 sc = page.Response().Response.Response.StatusCode 1518 } 1519 tracing.EndSpan(ctx, sc, err) 1520 }() 1521 } 1522 for { 1523 next, err := page.fn(ctx, page.dhglr) 1524 if err != nil { 1525 return err 1526 } 1527 page.dhglr = next 1528 if !next.hasNextLink() || !next.IsEmpty() { 1529 break 1530 } 1531 } 1532 return nil 1533} 1534 1535// Next advances to the next page of values. If there was an error making 1536// the request the page does not advance and the error is returned. 1537// Deprecated: Use NextWithContext() instead. 1538func (page *DedicatedHostGroupListResultPage) Next() error { 1539 return page.NextWithContext(context.Background()) 1540} 1541 1542// NotDone returns true if the page enumeration should be started or is not yet complete. 1543func (page DedicatedHostGroupListResultPage) NotDone() bool { 1544 return !page.dhglr.IsEmpty() 1545} 1546 1547// Response returns the raw server response from the last page request. 1548func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 1549 return page.dhglr 1550} 1551 1552// Values returns the slice of values for the current page or nil if there are no values. 1553func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 1554 if page.dhglr.IsEmpty() { 1555 return nil 1556 } 1557 return *page.dhglr.Value 1558} 1559 1560// Creates a new instance of the DedicatedHostGroupListResultPage type. 1561func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 1562 return DedicatedHostGroupListResultPage{ 1563 fn: getNextPage, 1564 dhglr: cur, 1565 } 1566} 1567 1568// DedicatedHostGroupProperties dedicated Host Group Properties. 1569type DedicatedHostGroupProperties struct { 1570 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 1571 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 1572 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 1573 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 1574} 1575 1576// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 1577func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 1578 objectMap := make(map[string]interface{}) 1579 if dhgp.PlatformFaultDomainCount != nil { 1580 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 1581 } 1582 return json.Marshal(objectMap) 1583} 1584 1585// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 1586// should be assigned to. Only tags may be updated. 1587type DedicatedHostGroupUpdate struct { 1588 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1589 // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. 1590 Zones *[]string `json:"zones,omitempty"` 1591 // Tags - Resource tags 1592 Tags map[string]*string `json:"tags"` 1593} 1594 1595// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 1596func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 1597 objectMap := make(map[string]interface{}) 1598 if dhgu.DedicatedHostGroupProperties != nil { 1599 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 1600 } 1601 if dhgu.Zones != nil { 1602 objectMap["zones"] = dhgu.Zones 1603 } 1604 if dhgu.Tags != nil { 1605 objectMap["tags"] = dhgu.Tags 1606 } 1607 return json.Marshal(objectMap) 1608} 1609 1610// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 1611func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 1612 var m map[string]*json.RawMessage 1613 err := json.Unmarshal(body, &m) 1614 if err != nil { 1615 return err 1616 } 1617 for k, v := range m { 1618 switch k { 1619 case "properties": 1620 if v != nil { 1621 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1622 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1623 if err != nil { 1624 return err 1625 } 1626 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1627 } 1628 case "zones": 1629 if v != nil { 1630 var zones []string 1631 err = json.Unmarshal(*v, &zones) 1632 if err != nil { 1633 return err 1634 } 1635 dhgu.Zones = &zones 1636 } 1637 case "tags": 1638 if v != nil { 1639 var tags map[string]*string 1640 err = json.Unmarshal(*v, &tags) 1641 if err != nil { 1642 return err 1643 } 1644 dhgu.Tags = tags 1645 } 1646 } 1647 } 1648 1649 return nil 1650} 1651 1652// DedicatedHostInstanceView the instance view of a dedicated host. 1653type DedicatedHostInstanceView struct { 1654 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1655 AssetID *string `json:"assetId,omitempty"` 1656 // AvailableCapacity - Unutilized capacity of the dedicated host. 1657 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1658 // Statuses - The resource status information. 1659 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1660} 1661 1662// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 1663func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 1664 objectMap := make(map[string]interface{}) 1665 if dhiv.AvailableCapacity != nil { 1666 objectMap["availableCapacity"] = dhiv.AvailableCapacity 1667 } 1668 if dhiv.Statuses != nil { 1669 objectMap["statuses"] = dhiv.Statuses 1670 } 1671 return json.Marshal(objectMap) 1672} 1673 1674// DedicatedHostListResult the list dedicated host operation response. 1675type DedicatedHostListResult struct { 1676 autorest.Response `json:"-"` 1677 // Value - The list of dedicated hosts 1678 Value *[]DedicatedHost `json:"value,omitempty"` 1679 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 1680 NextLink *string `json:"nextLink,omitempty"` 1681} 1682 1683// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 1684type DedicatedHostListResultIterator struct { 1685 i int 1686 page DedicatedHostListResultPage 1687} 1688 1689// NextWithContext advances to the next value. If there was an error making 1690// the request the iterator does not advance and the error is returned. 1691func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 1692 if tracing.IsEnabled() { 1693 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 1694 defer func() { 1695 sc := -1 1696 if iter.Response().Response.Response != nil { 1697 sc = iter.Response().Response.Response.StatusCode 1698 } 1699 tracing.EndSpan(ctx, sc, err) 1700 }() 1701 } 1702 iter.i++ 1703 if iter.i < len(iter.page.Values()) { 1704 return nil 1705 } 1706 err = iter.page.NextWithContext(ctx) 1707 if err != nil { 1708 iter.i-- 1709 return err 1710 } 1711 iter.i = 0 1712 return nil 1713} 1714 1715// Next advances to the next value. If there was an error making 1716// the request the iterator does not advance and the error is returned. 1717// Deprecated: Use NextWithContext() instead. 1718func (iter *DedicatedHostListResultIterator) Next() error { 1719 return iter.NextWithContext(context.Background()) 1720} 1721 1722// NotDone returns true if the enumeration should be started or is not yet complete. 1723func (iter DedicatedHostListResultIterator) NotDone() bool { 1724 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1725} 1726 1727// Response returns the raw server response from the last page request. 1728func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 1729 return iter.page.Response() 1730} 1731 1732// Value returns the current value or a zero-initialized value if the 1733// iterator has advanced beyond the end of the collection. 1734func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 1735 if !iter.page.NotDone() { 1736 return DedicatedHost{} 1737 } 1738 return iter.page.Values()[iter.i] 1739} 1740 1741// Creates a new instance of the DedicatedHostListResultIterator type. 1742func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 1743 return DedicatedHostListResultIterator{page: page} 1744} 1745 1746// IsEmpty returns true if the ListResult contains no values. 1747func (dhlr DedicatedHostListResult) IsEmpty() bool { 1748 return dhlr.Value == nil || len(*dhlr.Value) == 0 1749} 1750 1751// hasNextLink returns true if the NextLink is not empty. 1752func (dhlr DedicatedHostListResult) hasNextLink() bool { 1753 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 1754} 1755 1756// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 1757// It returns nil if no more results exist. 1758func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 1759 if !dhlr.hasNextLink() { 1760 return nil, nil 1761 } 1762 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1763 autorest.AsJSON(), 1764 autorest.AsGet(), 1765 autorest.WithBaseURL(to.String(dhlr.NextLink))) 1766} 1767 1768// DedicatedHostListResultPage contains a page of DedicatedHost values. 1769type DedicatedHostListResultPage struct { 1770 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 1771 dhlr DedicatedHostListResult 1772} 1773 1774// NextWithContext advances to the next page of values. If there was an error making 1775// the request the page does not advance and the error is returned. 1776func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 1777 if tracing.IsEnabled() { 1778 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 1779 defer func() { 1780 sc := -1 1781 if page.Response().Response.Response != nil { 1782 sc = page.Response().Response.Response.StatusCode 1783 } 1784 tracing.EndSpan(ctx, sc, err) 1785 }() 1786 } 1787 for { 1788 next, err := page.fn(ctx, page.dhlr) 1789 if err != nil { 1790 return err 1791 } 1792 page.dhlr = next 1793 if !next.hasNextLink() || !next.IsEmpty() { 1794 break 1795 } 1796 } 1797 return nil 1798} 1799 1800// Next advances to the next page of values. If there was an error making 1801// the request the page does not advance and the error is returned. 1802// Deprecated: Use NextWithContext() instead. 1803func (page *DedicatedHostListResultPage) Next() error { 1804 return page.NextWithContext(context.Background()) 1805} 1806 1807// NotDone returns true if the page enumeration should be started or is not yet complete. 1808func (page DedicatedHostListResultPage) NotDone() bool { 1809 return !page.dhlr.IsEmpty() 1810} 1811 1812// Response returns the raw server response from the last page request. 1813func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 1814 return page.dhlr 1815} 1816 1817// Values returns the slice of values for the current page or nil if there are no values. 1818func (page DedicatedHostListResultPage) Values() []DedicatedHost { 1819 if page.dhlr.IsEmpty() { 1820 return nil 1821 } 1822 return *page.dhlr.Value 1823} 1824 1825// Creates a new instance of the DedicatedHostListResultPage type. 1826func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 1827 return DedicatedHostListResultPage{ 1828 fn: getNextPage, 1829 dhlr: cur, 1830 } 1831} 1832 1833// DedicatedHostProperties properties of the dedicated host. 1834type DedicatedHostProperties struct { 1835 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 1836 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 1837 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 1838 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 1839 // HostID - READ-ONLY; A unique id generated and assigned to the dedicated host by the platform. <br><br> Does not change throughout the lifetime of the host. 1840 HostID *string `json:"hostId,omitempty"` 1841 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 1842 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 1843 // LicenseType - Specifies the software license type that will be applied to the VMs deployed on the dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: **None**. Possible values include: 'DedicatedHostLicenseTypesNone', 'DedicatedHostLicenseTypesWindowsServerHybrid', 'DedicatedHostLicenseTypesWindowsServerPerpetual' 1844 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 1845 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 1846 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1847 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1848 ProvisioningState *string `json:"provisioningState,omitempty"` 1849 // InstanceView - READ-ONLY; The dedicated host instance view. 1850 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 1851} 1852 1853// MarshalJSON is the custom marshaler for DedicatedHostProperties. 1854func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 1855 objectMap := make(map[string]interface{}) 1856 if dhp.PlatformFaultDomain != nil { 1857 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 1858 } 1859 if dhp.AutoReplaceOnFailure != nil { 1860 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 1861 } 1862 if dhp.LicenseType != "" { 1863 objectMap["licenseType"] = dhp.LicenseType 1864 } 1865 return json.Marshal(objectMap) 1866} 1867 1868// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1869// long-running operation. 1870type DedicatedHostsCreateOrUpdateFuture struct { 1871 azure.FutureAPI 1872 // Result returns the result of the asynchronous operation. 1873 // If the operation has not completed it will return an error. 1874 Result func(DedicatedHostsClient) (DedicatedHost, error) 1875} 1876 1877// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1878func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1879 var azFuture azure.Future 1880 if err := json.Unmarshal(body, &azFuture); err != nil { 1881 return err 1882 } 1883 future.FutureAPI = &azFuture 1884 future.Result = future.result 1885 return nil 1886} 1887 1888// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. 1889func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 1890 var done bool 1891 done, err = future.DoneWithContext(context.Background(), client) 1892 if err != nil { 1893 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1894 return 1895 } 1896 if !done { 1897 dh.Response.Response = future.Response() 1898 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") 1899 return 1900 } 1901 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1902 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 1903 dh, err = client.CreateOrUpdateResponder(dh.Response.Response) 1904 if err != nil { 1905 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 1906 } 1907 } 1908 return 1909} 1910 1911// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1912// operation. 1913type DedicatedHostsDeleteFuture struct { 1914 azure.FutureAPI 1915 // Result returns the result of the asynchronous operation. 1916 // If the operation has not completed it will return an error. 1917 Result func(DedicatedHostsClient) (autorest.Response, error) 1918} 1919 1920// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1921func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { 1922 var azFuture azure.Future 1923 if err := json.Unmarshal(body, &azFuture); err != nil { 1924 return err 1925 } 1926 future.FutureAPI = &azFuture 1927 future.Result = future.result 1928 return nil 1929} 1930 1931// result is the default implementation for DedicatedHostsDeleteFuture.Result. 1932func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { 1933 var done bool 1934 done, err = future.DoneWithContext(context.Background(), client) 1935 if err != nil { 1936 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") 1937 return 1938 } 1939 if !done { 1940 ar.Response = future.Response() 1941 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") 1942 return 1943 } 1944 ar.Response = future.Response() 1945 return 1946} 1947 1948// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1949// operation. 1950type DedicatedHostsUpdateFuture struct { 1951 azure.FutureAPI 1952 // Result returns the result of the asynchronous operation. 1953 // If the operation has not completed it will return an error. 1954 Result func(DedicatedHostsClient) (DedicatedHost, error) 1955} 1956 1957// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1958func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { 1959 var azFuture azure.Future 1960 if err := json.Unmarshal(body, &azFuture); err != nil { 1961 return err 1962 } 1963 future.FutureAPI = &azFuture 1964 future.Result = future.result 1965 return nil 1966} 1967 1968// result is the default implementation for DedicatedHostsUpdateFuture.Result. 1969func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 1970 var done bool 1971 done, err = future.DoneWithContext(context.Background(), client) 1972 if err != nil { 1973 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") 1974 return 1975 } 1976 if !done { 1977 dh.Response.Response = future.Response() 1978 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") 1979 return 1980 } 1981 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1982 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 1983 dh, err = client.UpdateResponder(dh.Response.Response) 1984 if err != nil { 1985 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 1986 } 1987 } 1988 return 1989} 1990 1991// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 1992// licenseType may be updated. 1993type DedicatedHostUpdate struct { 1994 *DedicatedHostProperties `json:"properties,omitempty"` 1995 // Tags - Resource tags 1996 Tags map[string]*string `json:"tags"` 1997} 1998 1999// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 2000func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 2001 objectMap := make(map[string]interface{}) 2002 if dhu.DedicatedHostProperties != nil { 2003 objectMap["properties"] = dhu.DedicatedHostProperties 2004 } 2005 if dhu.Tags != nil { 2006 objectMap["tags"] = dhu.Tags 2007 } 2008 return json.Marshal(objectMap) 2009} 2010 2011// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 2012func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 2013 var m map[string]*json.RawMessage 2014 err := json.Unmarshal(body, &m) 2015 if err != nil { 2016 return err 2017 } 2018 for k, v := range m { 2019 switch k { 2020 case "properties": 2021 if v != nil { 2022 var dedicatedHostProperties DedicatedHostProperties 2023 err = json.Unmarshal(*v, &dedicatedHostProperties) 2024 if err != nil { 2025 return err 2026 } 2027 dhu.DedicatedHostProperties = &dedicatedHostProperties 2028 } 2029 case "tags": 2030 if v != nil { 2031 var tags map[string]*string 2032 err = json.Unmarshal(*v, &tags) 2033 if err != nil { 2034 return err 2035 } 2036 dhu.Tags = tags 2037 } 2038 } 2039 } 2040 2041 return nil 2042} 2043 2044// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2045// 2015-06-15. 2046type DiagnosticsProfile struct { 2047 // 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. 2048 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 2049} 2050 2051// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 2052// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 2053type DiffDiskSettings struct { 2054 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 2055 Option DiffDiskOptions `json:"option,omitempty"` 2056} 2057 2058// Disallowed describes the disallowed disk types. 2059type Disallowed struct { 2060 // DiskTypes - A list of disk types. 2061 DiskTypes *[]string `json:"diskTypes,omitempty"` 2062} 2063 2064// Disk disk resource. 2065type Disk struct { 2066 autorest.Response `json:"-"` 2067 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 2068 ManagedBy *string `json:"managedBy,omitempty"` 2069 Sku *DiskSku `json:"sku,omitempty"` 2070 // Zones - The Logical zone list for Disk. 2071 Zones *[]string `json:"zones,omitempty"` 2072 *DiskProperties `json:"properties,omitempty"` 2073 // ID - READ-ONLY; Resource Id 2074 ID *string `json:"id,omitempty"` 2075 // Name - READ-ONLY; Resource name 2076 Name *string `json:"name,omitempty"` 2077 // Type - READ-ONLY; Resource type 2078 Type *string `json:"type,omitempty"` 2079 // Location - Resource location 2080 Location *string `json:"location,omitempty"` 2081 // Tags - Resource tags 2082 Tags map[string]*string `json:"tags"` 2083} 2084 2085// MarshalJSON is the custom marshaler for Disk. 2086func (d Disk) MarshalJSON() ([]byte, error) { 2087 objectMap := make(map[string]interface{}) 2088 if d.Sku != nil { 2089 objectMap["sku"] = d.Sku 2090 } 2091 if d.Zones != nil { 2092 objectMap["zones"] = d.Zones 2093 } 2094 if d.DiskProperties != nil { 2095 objectMap["properties"] = d.DiskProperties 2096 } 2097 if d.Location != nil { 2098 objectMap["location"] = d.Location 2099 } 2100 if d.Tags != nil { 2101 objectMap["tags"] = d.Tags 2102 } 2103 return json.Marshal(objectMap) 2104} 2105 2106// UnmarshalJSON is the custom unmarshaler for Disk struct. 2107func (d *Disk) UnmarshalJSON(body []byte) error { 2108 var m map[string]*json.RawMessage 2109 err := json.Unmarshal(body, &m) 2110 if err != nil { 2111 return err 2112 } 2113 for k, v := range m { 2114 switch k { 2115 case "managedBy": 2116 if v != nil { 2117 var managedBy string 2118 err = json.Unmarshal(*v, &managedBy) 2119 if err != nil { 2120 return err 2121 } 2122 d.ManagedBy = &managedBy 2123 } 2124 case "sku": 2125 if v != nil { 2126 var sku DiskSku 2127 err = json.Unmarshal(*v, &sku) 2128 if err != nil { 2129 return err 2130 } 2131 d.Sku = &sku 2132 } 2133 case "zones": 2134 if v != nil { 2135 var zones []string 2136 err = json.Unmarshal(*v, &zones) 2137 if err != nil { 2138 return err 2139 } 2140 d.Zones = &zones 2141 } 2142 case "properties": 2143 if v != nil { 2144 var diskProperties DiskProperties 2145 err = json.Unmarshal(*v, &diskProperties) 2146 if err != nil { 2147 return err 2148 } 2149 d.DiskProperties = &diskProperties 2150 } 2151 case "id": 2152 if v != nil { 2153 var ID string 2154 err = json.Unmarshal(*v, &ID) 2155 if err != nil { 2156 return err 2157 } 2158 d.ID = &ID 2159 } 2160 case "name": 2161 if v != nil { 2162 var name string 2163 err = json.Unmarshal(*v, &name) 2164 if err != nil { 2165 return err 2166 } 2167 d.Name = &name 2168 } 2169 case "type": 2170 if v != nil { 2171 var typeVar string 2172 err = json.Unmarshal(*v, &typeVar) 2173 if err != nil { 2174 return err 2175 } 2176 d.Type = &typeVar 2177 } 2178 case "location": 2179 if v != nil { 2180 var location string 2181 err = json.Unmarshal(*v, &location) 2182 if err != nil { 2183 return err 2184 } 2185 d.Location = &location 2186 } 2187 case "tags": 2188 if v != nil { 2189 var tags map[string]*string 2190 err = json.Unmarshal(*v, &tags) 2191 if err != nil { 2192 return err 2193 } 2194 d.Tags = tags 2195 } 2196 } 2197 } 2198 2199 return nil 2200} 2201 2202// DiskEncryptionSet disk encryption set resource. 2203type DiskEncryptionSet struct { 2204 autorest.Response `json:"-"` 2205 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 2206 *EncryptionSetProperties `json:"properties,omitempty"` 2207 // ID - READ-ONLY; Resource Id 2208 ID *string `json:"id,omitempty"` 2209 // Name - READ-ONLY; Resource name 2210 Name *string `json:"name,omitempty"` 2211 // Type - READ-ONLY; Resource type 2212 Type *string `json:"type,omitempty"` 2213 // Location - Resource location 2214 Location *string `json:"location,omitempty"` 2215 // Tags - Resource tags 2216 Tags map[string]*string `json:"tags"` 2217} 2218 2219// MarshalJSON is the custom marshaler for DiskEncryptionSet. 2220func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 2221 objectMap := make(map[string]interface{}) 2222 if desVar.Identity != nil { 2223 objectMap["identity"] = desVar.Identity 2224 } 2225 if desVar.EncryptionSetProperties != nil { 2226 objectMap["properties"] = desVar.EncryptionSetProperties 2227 } 2228 if desVar.Location != nil { 2229 objectMap["location"] = desVar.Location 2230 } 2231 if desVar.Tags != nil { 2232 objectMap["tags"] = desVar.Tags 2233 } 2234 return json.Marshal(objectMap) 2235} 2236 2237// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 2238func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 2239 var m map[string]*json.RawMessage 2240 err := json.Unmarshal(body, &m) 2241 if err != nil { 2242 return err 2243 } 2244 for k, v := range m { 2245 switch k { 2246 case "identity": 2247 if v != nil { 2248 var identity EncryptionSetIdentity 2249 err = json.Unmarshal(*v, &identity) 2250 if err != nil { 2251 return err 2252 } 2253 desVar.Identity = &identity 2254 } 2255 case "properties": 2256 if v != nil { 2257 var encryptionSetProperties EncryptionSetProperties 2258 err = json.Unmarshal(*v, &encryptionSetProperties) 2259 if err != nil { 2260 return err 2261 } 2262 desVar.EncryptionSetProperties = &encryptionSetProperties 2263 } 2264 case "id": 2265 if v != nil { 2266 var ID string 2267 err = json.Unmarshal(*v, &ID) 2268 if err != nil { 2269 return err 2270 } 2271 desVar.ID = &ID 2272 } 2273 case "name": 2274 if v != nil { 2275 var name string 2276 err = json.Unmarshal(*v, &name) 2277 if err != nil { 2278 return err 2279 } 2280 desVar.Name = &name 2281 } 2282 case "type": 2283 if v != nil { 2284 var typeVar string 2285 err = json.Unmarshal(*v, &typeVar) 2286 if err != nil { 2287 return err 2288 } 2289 desVar.Type = &typeVar 2290 } 2291 case "location": 2292 if v != nil { 2293 var location string 2294 err = json.Unmarshal(*v, &location) 2295 if err != nil { 2296 return err 2297 } 2298 desVar.Location = &location 2299 } 2300 case "tags": 2301 if v != nil { 2302 var tags map[string]*string 2303 err = json.Unmarshal(*v, &tags) 2304 if err != nil { 2305 return err 2306 } 2307 desVar.Tags = tags 2308 } 2309 } 2310 } 2311 2312 return nil 2313} 2314 2315// DiskEncryptionSetList the List disk encryption set operation response. 2316type DiskEncryptionSetList struct { 2317 autorest.Response `json:"-"` 2318 // Value - A list of disk encryption sets. 2319 Value *[]DiskEncryptionSet `json:"value,omitempty"` 2320 // NextLink - The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets. 2321 NextLink *string `json:"nextLink,omitempty"` 2322} 2323 2324// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 2325type DiskEncryptionSetListIterator struct { 2326 i int 2327 page DiskEncryptionSetListPage 2328} 2329 2330// NextWithContext advances to the next value. If there was an error making 2331// the request the iterator does not advance and the error is returned. 2332func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 2333 if tracing.IsEnabled() { 2334 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 2335 defer func() { 2336 sc := -1 2337 if iter.Response().Response.Response != nil { 2338 sc = iter.Response().Response.Response.StatusCode 2339 } 2340 tracing.EndSpan(ctx, sc, err) 2341 }() 2342 } 2343 iter.i++ 2344 if iter.i < len(iter.page.Values()) { 2345 return nil 2346 } 2347 err = iter.page.NextWithContext(ctx) 2348 if err != nil { 2349 iter.i-- 2350 return err 2351 } 2352 iter.i = 0 2353 return nil 2354} 2355 2356// Next advances to the next value. If there was an error making 2357// the request the iterator does not advance and the error is returned. 2358// Deprecated: Use NextWithContext() instead. 2359func (iter *DiskEncryptionSetListIterator) Next() error { 2360 return iter.NextWithContext(context.Background()) 2361} 2362 2363// NotDone returns true if the enumeration should be started or is not yet complete. 2364func (iter DiskEncryptionSetListIterator) NotDone() bool { 2365 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2366} 2367 2368// Response returns the raw server response from the last page request. 2369func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 2370 return iter.page.Response() 2371} 2372 2373// Value returns the current value or a zero-initialized value if the 2374// iterator has advanced beyond the end of the collection. 2375func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 2376 if !iter.page.NotDone() { 2377 return DiskEncryptionSet{} 2378 } 2379 return iter.page.Values()[iter.i] 2380} 2381 2382// Creates a new instance of the DiskEncryptionSetListIterator type. 2383func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 2384 return DiskEncryptionSetListIterator{page: page} 2385} 2386 2387// IsEmpty returns true if the ListResult contains no values. 2388func (desl DiskEncryptionSetList) IsEmpty() bool { 2389 return desl.Value == nil || len(*desl.Value) == 0 2390} 2391 2392// hasNextLink returns true if the NextLink is not empty. 2393func (desl DiskEncryptionSetList) hasNextLink() bool { 2394 return desl.NextLink != nil && len(*desl.NextLink) != 0 2395} 2396 2397// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 2398// It returns nil if no more results exist. 2399func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 2400 if !desl.hasNextLink() { 2401 return nil, nil 2402 } 2403 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2404 autorest.AsJSON(), 2405 autorest.AsGet(), 2406 autorest.WithBaseURL(to.String(desl.NextLink))) 2407} 2408 2409// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 2410type DiskEncryptionSetListPage struct { 2411 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 2412 desl DiskEncryptionSetList 2413} 2414 2415// NextWithContext advances to the next page of values. If there was an error making 2416// the request the page does not advance and the error is returned. 2417func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 2418 if tracing.IsEnabled() { 2419 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 2420 defer func() { 2421 sc := -1 2422 if page.Response().Response.Response != nil { 2423 sc = page.Response().Response.Response.StatusCode 2424 } 2425 tracing.EndSpan(ctx, sc, err) 2426 }() 2427 } 2428 for { 2429 next, err := page.fn(ctx, page.desl) 2430 if err != nil { 2431 return err 2432 } 2433 page.desl = next 2434 if !next.hasNextLink() || !next.IsEmpty() { 2435 break 2436 } 2437 } 2438 return nil 2439} 2440 2441// Next advances to the next page of values. If there was an error making 2442// the request the page does not advance and the error is returned. 2443// Deprecated: Use NextWithContext() instead. 2444func (page *DiskEncryptionSetListPage) Next() error { 2445 return page.NextWithContext(context.Background()) 2446} 2447 2448// NotDone returns true if the page enumeration should be started or is not yet complete. 2449func (page DiskEncryptionSetListPage) NotDone() bool { 2450 return !page.desl.IsEmpty() 2451} 2452 2453// Response returns the raw server response from the last page request. 2454func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 2455 return page.desl 2456} 2457 2458// Values returns the slice of values for the current page or nil if there are no values. 2459func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 2460 if page.desl.IsEmpty() { 2461 return nil 2462 } 2463 return *page.desl.Value 2464} 2465 2466// Creates a new instance of the DiskEncryptionSetListPage type. 2467func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 2468 return DiskEncryptionSetListPage{ 2469 fn: getNextPage, 2470 desl: cur, 2471 } 2472} 2473 2474// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 2475// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 2476// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 2477type DiskEncryptionSetParameters struct { 2478 // ID - Resource Id 2479 ID *string `json:"id,omitempty"` 2480} 2481 2482// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2483// long-running operation. 2484type DiskEncryptionSetsCreateOrUpdateFuture struct { 2485 azure.FutureAPI 2486 // Result returns the result of the asynchronous operation. 2487 // If the operation has not completed it will return an error. 2488 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2489} 2490 2491// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2492func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2493 var azFuture azure.Future 2494 if err := json.Unmarshal(body, &azFuture); err != nil { 2495 return err 2496 } 2497 future.FutureAPI = &azFuture 2498 future.Result = future.result 2499 return nil 2500} 2501 2502// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. 2503func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 2504 var done bool 2505 done, err = future.DoneWithContext(context.Background(), client) 2506 if err != nil { 2507 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2508 return 2509 } 2510 if !done { 2511 desVar.Response.Response = future.Response() 2512 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") 2513 return 2514 } 2515 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2516 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 2517 desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) 2518 if err != nil { 2519 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 2520 } 2521 } 2522 return 2523} 2524 2525// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 2526// long-running operation. 2527type DiskEncryptionSetsDeleteFuture struct { 2528 azure.FutureAPI 2529 // Result returns the result of the asynchronous operation. 2530 // If the operation has not completed it will return an error. 2531 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 2532} 2533 2534// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2535func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { 2536 var azFuture azure.Future 2537 if err := json.Unmarshal(body, &azFuture); err != nil { 2538 return err 2539 } 2540 future.FutureAPI = &azFuture 2541 future.Result = future.result 2542 return nil 2543} 2544 2545// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. 2546func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { 2547 var done bool 2548 done, err = future.DoneWithContext(context.Background(), client) 2549 if err != nil { 2550 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") 2551 return 2552 } 2553 if !done { 2554 ar.Response = future.Response() 2555 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") 2556 return 2557 } 2558 ar.Response = future.Response() 2559 return 2560} 2561 2562// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 2563// long-running operation. 2564type DiskEncryptionSetsUpdateFuture struct { 2565 azure.FutureAPI 2566 // Result returns the result of the asynchronous operation. 2567 // If the operation has not completed it will return an error. 2568 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2569} 2570 2571// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2572func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { 2573 var azFuture azure.Future 2574 if err := json.Unmarshal(body, &azFuture); err != nil { 2575 return err 2576 } 2577 future.FutureAPI = &azFuture 2578 future.Result = future.result 2579 return nil 2580} 2581 2582// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. 2583func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 2584 var done bool 2585 done, err = future.DoneWithContext(context.Background(), client) 2586 if err != nil { 2587 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") 2588 return 2589 } 2590 if !done { 2591 desVar.Response.Response = future.Response() 2592 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") 2593 return 2594 } 2595 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2596 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 2597 desVar, err = client.UpdateResponder(desVar.Response.Response) 2598 if err != nil { 2599 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 2600 } 2601 } 2602 return 2603} 2604 2605// DiskEncryptionSettings describes a Encryption Settings for a Disk 2606type DiskEncryptionSettings struct { 2607 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 2608 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 2609 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 2610 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 2611 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 2612 Enabled *bool `json:"enabled,omitempty"` 2613} 2614 2615// DiskEncryptionSetUpdate disk encryption set update resource. 2616type DiskEncryptionSetUpdate struct { 2617 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 2618 // Tags - Resource tags 2619 Tags map[string]*string `json:"tags"` 2620} 2621 2622// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 2623func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 2624 objectMap := make(map[string]interface{}) 2625 if desu.DiskEncryptionSetUpdateProperties != nil { 2626 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 2627 } 2628 if desu.Tags != nil { 2629 objectMap["tags"] = desu.Tags 2630 } 2631 return json.Marshal(objectMap) 2632} 2633 2634// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 2635func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 2636 var m map[string]*json.RawMessage 2637 err := json.Unmarshal(body, &m) 2638 if err != nil { 2639 return err 2640 } 2641 for k, v := range m { 2642 switch k { 2643 case "properties": 2644 if v != nil { 2645 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 2646 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 2647 if err != nil { 2648 return err 2649 } 2650 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 2651 } 2652 case "tags": 2653 if v != nil { 2654 var tags map[string]*string 2655 err = json.Unmarshal(*v, &tags) 2656 if err != nil { 2657 return err 2658 } 2659 desu.Tags = tags 2660 } 2661 } 2662 } 2663 2664 return nil 2665} 2666 2667// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 2668type DiskEncryptionSetUpdateProperties struct { 2669 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2670} 2671 2672// DiskInstanceView the instance view of the disk. 2673type DiskInstanceView struct { 2674 // Name - The disk name. 2675 Name *string `json:"name,omitempty"` 2676 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 2677 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 2678 // Statuses - The resource status information. 2679 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2680} 2681 2682// DiskList the List Disks operation response. 2683type DiskList struct { 2684 autorest.Response `json:"-"` 2685 // Value - A list of disks. 2686 Value *[]Disk `json:"value,omitempty"` 2687 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 2688 NextLink *string `json:"nextLink,omitempty"` 2689} 2690 2691// DiskListIterator provides access to a complete listing of Disk values. 2692type DiskListIterator struct { 2693 i int 2694 page DiskListPage 2695} 2696 2697// NextWithContext advances to the next value. If there was an error making 2698// the request the iterator does not advance and the error is returned. 2699func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 2700 if tracing.IsEnabled() { 2701 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 2702 defer func() { 2703 sc := -1 2704 if iter.Response().Response.Response != nil { 2705 sc = iter.Response().Response.Response.StatusCode 2706 } 2707 tracing.EndSpan(ctx, sc, err) 2708 }() 2709 } 2710 iter.i++ 2711 if iter.i < len(iter.page.Values()) { 2712 return nil 2713 } 2714 err = iter.page.NextWithContext(ctx) 2715 if err != nil { 2716 iter.i-- 2717 return err 2718 } 2719 iter.i = 0 2720 return nil 2721} 2722 2723// Next advances to the next value. If there was an error making 2724// the request the iterator does not advance and the error is returned. 2725// Deprecated: Use NextWithContext() instead. 2726func (iter *DiskListIterator) Next() error { 2727 return iter.NextWithContext(context.Background()) 2728} 2729 2730// NotDone returns true if the enumeration should be started or is not yet complete. 2731func (iter DiskListIterator) NotDone() bool { 2732 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2733} 2734 2735// Response returns the raw server response from the last page request. 2736func (iter DiskListIterator) Response() DiskList { 2737 return iter.page.Response() 2738} 2739 2740// Value returns the current value or a zero-initialized value if the 2741// iterator has advanced beyond the end of the collection. 2742func (iter DiskListIterator) Value() Disk { 2743 if !iter.page.NotDone() { 2744 return Disk{} 2745 } 2746 return iter.page.Values()[iter.i] 2747} 2748 2749// Creates a new instance of the DiskListIterator type. 2750func NewDiskListIterator(page DiskListPage) DiskListIterator { 2751 return DiskListIterator{page: page} 2752} 2753 2754// IsEmpty returns true if the ListResult contains no values. 2755func (dl DiskList) IsEmpty() bool { 2756 return dl.Value == nil || len(*dl.Value) == 0 2757} 2758 2759// hasNextLink returns true if the NextLink is not empty. 2760func (dl DiskList) hasNextLink() bool { 2761 return dl.NextLink != nil && len(*dl.NextLink) != 0 2762} 2763 2764// diskListPreparer prepares a request to retrieve the next set of results. 2765// It returns nil if no more results exist. 2766func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 2767 if !dl.hasNextLink() { 2768 return nil, nil 2769 } 2770 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2771 autorest.AsJSON(), 2772 autorest.AsGet(), 2773 autorest.WithBaseURL(to.String(dl.NextLink))) 2774} 2775 2776// DiskListPage contains a page of Disk values. 2777type DiskListPage struct { 2778 fn func(context.Context, DiskList) (DiskList, error) 2779 dl DiskList 2780} 2781 2782// NextWithContext advances to the next page of values. If there was an error making 2783// the request the page does not advance and the error is returned. 2784func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 2785 if tracing.IsEnabled() { 2786 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 2787 defer func() { 2788 sc := -1 2789 if page.Response().Response.Response != nil { 2790 sc = page.Response().Response.Response.StatusCode 2791 } 2792 tracing.EndSpan(ctx, sc, err) 2793 }() 2794 } 2795 for { 2796 next, err := page.fn(ctx, page.dl) 2797 if err != nil { 2798 return err 2799 } 2800 page.dl = next 2801 if !next.hasNextLink() || !next.IsEmpty() { 2802 break 2803 } 2804 } 2805 return nil 2806} 2807 2808// Next advances to the next page of values. If there was an error making 2809// the request the page does not advance and the error is returned. 2810// Deprecated: Use NextWithContext() instead. 2811func (page *DiskListPage) Next() error { 2812 return page.NextWithContext(context.Background()) 2813} 2814 2815// NotDone returns true if the page enumeration should be started or is not yet complete. 2816func (page DiskListPage) NotDone() bool { 2817 return !page.dl.IsEmpty() 2818} 2819 2820// Response returns the raw server response from the last page request. 2821func (page DiskListPage) Response() DiskList { 2822 return page.dl 2823} 2824 2825// Values returns the slice of values for the current page or nil if there are no values. 2826func (page DiskListPage) Values() []Disk { 2827 if page.dl.IsEmpty() { 2828 return nil 2829 } 2830 return *page.dl.Value 2831} 2832 2833// Creates a new instance of the DiskListPage type. 2834func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 2835 return DiskListPage{ 2836 fn: getNextPage, 2837 dl: cur, 2838 } 2839} 2840 2841// DiskProperties disk resource properties. 2842type DiskProperties struct { 2843 // TimeCreated - READ-ONLY; The time when the disk was created. 2844 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2845 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 2846 OsType OperatingSystemTypes `json:"osType,omitempty"` 2847 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 2848 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 2849 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 2850 CreationData *CreationData `json:"creationData,omitempty"` 2851 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk 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. 2852 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2853 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 2854 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 2855 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 2856 UniqueID *string `json:"uniqueId,omitempty"` 2857 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2858 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2859 // ProvisioningState - READ-ONLY; The disk provisioning state. 2860 ProvisioningState *string `json:"provisioningState,omitempty"` 2861 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2862 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2863 // 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. 2864 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 2865 // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 2866 DiskState DiskState `json:"diskState,omitempty"` 2867 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2868 Encryption *Encryption `json:"encryption,omitempty"` 2869} 2870 2871// MarshalJSON is the custom marshaler for DiskProperties. 2872func (dp DiskProperties) MarshalJSON() ([]byte, error) { 2873 objectMap := make(map[string]interface{}) 2874 if dp.OsType != "" { 2875 objectMap["osType"] = dp.OsType 2876 } 2877 if dp.HyperVGeneration != "" { 2878 objectMap["hyperVGeneration"] = dp.HyperVGeneration 2879 } 2880 if dp.CreationData != nil { 2881 objectMap["creationData"] = dp.CreationData 2882 } 2883 if dp.DiskSizeGB != nil { 2884 objectMap["diskSizeGB"] = dp.DiskSizeGB 2885 } 2886 if dp.EncryptionSettingsCollection != nil { 2887 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 2888 } 2889 if dp.DiskIOPSReadWrite != nil { 2890 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 2891 } 2892 if dp.DiskMBpsReadWrite != nil { 2893 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 2894 } 2895 if dp.Encryption != nil { 2896 objectMap["encryption"] = dp.Encryption 2897 } 2898 return json.Marshal(objectMap) 2899} 2900 2901// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2902// operation. 2903type DisksCreateOrUpdateFuture struct { 2904 azure.FutureAPI 2905 // Result returns the result of the asynchronous operation. 2906 // If the operation has not completed it will return an error. 2907 Result func(DisksClient) (Disk, error) 2908} 2909 2910// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2911func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2912 var azFuture azure.Future 2913 if err := json.Unmarshal(body, &azFuture); err != nil { 2914 return err 2915 } 2916 future.FutureAPI = &azFuture 2917 future.Result = future.result 2918 return nil 2919} 2920 2921// result is the default implementation for DisksCreateOrUpdateFuture.Result. 2922func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 2923 var done bool 2924 done, err = future.DoneWithContext(context.Background(), client) 2925 if err != nil { 2926 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2927 return 2928 } 2929 if !done { 2930 d.Response.Response = future.Response() 2931 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 2932 return 2933 } 2934 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2935 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 2936 d, err = client.CreateOrUpdateResponder(d.Response.Response) 2937 if err != nil { 2938 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 2939 } 2940 } 2941 return 2942} 2943 2944// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2945type DisksDeleteFuture struct { 2946 azure.FutureAPI 2947 // Result returns the result of the asynchronous operation. 2948 // If the operation has not completed it will return an error. 2949 Result func(DisksClient) (autorest.Response, error) 2950} 2951 2952// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2953func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 2954 var azFuture azure.Future 2955 if err := json.Unmarshal(body, &azFuture); err != nil { 2956 return err 2957 } 2958 future.FutureAPI = &azFuture 2959 future.Result = future.result 2960 return nil 2961} 2962 2963// result is the default implementation for DisksDeleteFuture.Result. 2964func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 2965 var done bool 2966 done, err = future.DoneWithContext(context.Background(), client) 2967 if err != nil { 2968 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 2969 return 2970 } 2971 if !done { 2972 ar.Response = future.Response() 2973 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 2974 return 2975 } 2976 ar.Response = future.Response() 2977 return 2978} 2979 2980// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2981// operation. 2982type DisksGrantAccessFuture struct { 2983 azure.FutureAPI 2984 // Result returns the result of the asynchronous operation. 2985 // If the operation has not completed it will return an error. 2986 Result func(DisksClient) (AccessURI, error) 2987} 2988 2989// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2990func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 2991 var azFuture azure.Future 2992 if err := json.Unmarshal(body, &azFuture); err != nil { 2993 return err 2994 } 2995 future.FutureAPI = &azFuture 2996 future.Result = future.result 2997 return nil 2998} 2999 3000// result is the default implementation for DisksGrantAccessFuture.Result. 3001func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 3002 var done bool 3003 done, err = future.DoneWithContext(context.Background(), client) 3004 if err != nil { 3005 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 3006 return 3007 } 3008 if !done { 3009 au.Response.Response = future.Response() 3010 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 3011 return 3012 } 3013 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3014 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 3015 au, err = client.GrantAccessResponder(au.Response.Response) 3016 if err != nil { 3017 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 3018 } 3019 } 3020 return 3021} 3022 3023// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 3024type DiskSku struct { 3025 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 3026 Name DiskStorageAccountTypes `json:"name,omitempty"` 3027 // Tier - READ-ONLY; The sku tier. 3028 Tier *string `json:"tier,omitempty"` 3029} 3030 3031// MarshalJSON is the custom marshaler for DiskSku. 3032func (ds DiskSku) MarshalJSON() ([]byte, error) { 3033 objectMap := make(map[string]interface{}) 3034 if ds.Name != "" { 3035 objectMap["name"] = ds.Name 3036 } 3037 return json.Marshal(objectMap) 3038} 3039 3040// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 3041// operation. 3042type DisksRevokeAccessFuture struct { 3043 azure.FutureAPI 3044 // Result returns the result of the asynchronous operation. 3045 // If the operation has not completed it will return an error. 3046 Result func(DisksClient) (autorest.Response, error) 3047} 3048 3049// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3050func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 3051 var azFuture azure.Future 3052 if err := json.Unmarshal(body, &azFuture); err != nil { 3053 return err 3054 } 3055 future.FutureAPI = &azFuture 3056 future.Result = future.result 3057 return nil 3058} 3059 3060// result is the default implementation for DisksRevokeAccessFuture.Result. 3061func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 3062 var done bool 3063 done, err = future.DoneWithContext(context.Background(), client) 3064 if err != nil { 3065 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 3066 return 3067 } 3068 if !done { 3069 ar.Response = future.Response() 3070 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 3071 return 3072 } 3073 ar.Response = future.Response() 3074 return 3075} 3076 3077// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3078type DisksUpdateFuture struct { 3079 azure.FutureAPI 3080 // Result returns the result of the asynchronous operation. 3081 // If the operation has not completed it will return an error. 3082 Result func(DisksClient) (Disk, error) 3083} 3084 3085// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3086func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 3087 var azFuture azure.Future 3088 if err := json.Unmarshal(body, &azFuture); err != nil { 3089 return err 3090 } 3091 future.FutureAPI = &azFuture 3092 future.Result = future.result 3093 return nil 3094} 3095 3096// result is the default implementation for DisksUpdateFuture.Result. 3097func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 3098 var done bool 3099 done, err = future.DoneWithContext(context.Background(), client) 3100 if err != nil { 3101 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 3102 return 3103 } 3104 if !done { 3105 d.Response.Response = future.Response() 3106 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 3107 return 3108 } 3109 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3110 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 3111 d, err = client.UpdateResponder(d.Response.Response) 3112 if err != nil { 3113 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 3114 } 3115 } 3116 return 3117} 3118 3119// DiskUpdate disk update resource. 3120type DiskUpdate struct { 3121 *DiskUpdateProperties `json:"properties,omitempty"` 3122 // Tags - Resource tags 3123 Tags map[string]*string `json:"tags"` 3124 Sku *DiskSku `json:"sku,omitempty"` 3125} 3126 3127// MarshalJSON is the custom marshaler for DiskUpdate. 3128func (du DiskUpdate) MarshalJSON() ([]byte, error) { 3129 objectMap := make(map[string]interface{}) 3130 if du.DiskUpdateProperties != nil { 3131 objectMap["properties"] = du.DiskUpdateProperties 3132 } 3133 if du.Tags != nil { 3134 objectMap["tags"] = du.Tags 3135 } 3136 if du.Sku != nil { 3137 objectMap["sku"] = du.Sku 3138 } 3139 return json.Marshal(objectMap) 3140} 3141 3142// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 3143func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 3144 var m map[string]*json.RawMessage 3145 err := json.Unmarshal(body, &m) 3146 if err != nil { 3147 return err 3148 } 3149 for k, v := range m { 3150 switch k { 3151 case "properties": 3152 if v != nil { 3153 var diskUpdateProperties DiskUpdateProperties 3154 err = json.Unmarshal(*v, &diskUpdateProperties) 3155 if err != nil { 3156 return err 3157 } 3158 du.DiskUpdateProperties = &diskUpdateProperties 3159 } 3160 case "tags": 3161 if v != nil { 3162 var tags map[string]*string 3163 err = json.Unmarshal(*v, &tags) 3164 if err != nil { 3165 return err 3166 } 3167 du.Tags = tags 3168 } 3169 case "sku": 3170 if v != nil { 3171 var sku DiskSku 3172 err = json.Unmarshal(*v, &sku) 3173 if err != nil { 3174 return err 3175 } 3176 du.Sku = &sku 3177 } 3178 } 3179 } 3180 3181 return nil 3182} 3183 3184// DiskUpdateProperties disk resource update properties. 3185type DiskUpdateProperties struct { 3186 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 3187 OsType OperatingSystemTypes `json:"osType,omitempty"` 3188 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk 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. 3189 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3190 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 3191 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 3192 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 3193 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 3194 // 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. 3195 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 3196 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 3197 Encryption *Encryption `json:"encryption,omitempty"` 3198} 3199 3200// Encryption encryption at rest settings for disk or snapshot 3201type Encryption struct { 3202 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 3203 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 3204 // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' 3205 Type EncryptionType `json:"type,omitempty"` 3206} 3207 3208// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 3209// the key vault before it can be used to encrypt disks. 3210type EncryptionSetIdentity struct { 3211 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' 3212 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 3213 // PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity 3214 PrincipalID *string `json:"principalId,omitempty"` 3215 // TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity 3216 TenantID *string `json:"tenantId,omitempty"` 3217} 3218 3219// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 3220func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 3221 objectMap := make(map[string]interface{}) 3222 if esi.Type != "" { 3223 objectMap["type"] = esi.Type 3224 } 3225 return json.Marshal(objectMap) 3226} 3227 3228// EncryptionSetProperties ... 3229type EncryptionSetProperties struct { 3230 // ActiveKey - The key vault key which is currently used by this disk encryption set. 3231 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 3232 // PreviousKeys - READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. 3233 PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` 3234 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 3235 ProvisioningState *string `json:"provisioningState,omitempty"` 3236} 3237 3238// MarshalJSON is the custom marshaler for EncryptionSetProperties. 3239func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 3240 objectMap := make(map[string]interface{}) 3241 if esp.ActiveKey != nil { 3242 objectMap["activeKey"] = esp.ActiveKey 3243 } 3244 return json.Marshal(objectMap) 3245} 3246 3247// EncryptionSettingsCollection encryption settings for disk or snapshot 3248type EncryptionSettingsCollection struct { 3249 // 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. 3250 Enabled *bool `json:"enabled,omitempty"` 3251 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 3252 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 3253 // EncryptionSettingsVersion - Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. 3254 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 3255} 3256 3257// EncryptionSettingsElement encryption settings for one disk volume. 3258type EncryptionSettingsElement struct { 3259 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 3260 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 3261 // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. 3262 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 3263} 3264 3265// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3266// operation. 3267type GalleriesCreateOrUpdateFuture struct { 3268 azure.FutureAPI 3269 // Result returns the result of the asynchronous operation. 3270 // If the operation has not completed it will return an error. 3271 Result func(GalleriesClient) (Gallery, error) 3272} 3273 3274// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3275func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3276 var azFuture azure.Future 3277 if err := json.Unmarshal(body, &azFuture); err != nil { 3278 return err 3279 } 3280 future.FutureAPI = &azFuture 3281 future.Result = future.result 3282 return nil 3283} 3284 3285// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. 3286func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 3287 var done bool 3288 done, err = future.DoneWithContext(context.Background(), client) 3289 if err != nil { 3290 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3291 return 3292 } 3293 if !done { 3294 g.Response.Response = future.Response() 3295 err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") 3296 return 3297 } 3298 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3299 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 3300 g, err = client.CreateOrUpdateResponder(g.Response.Response) 3301 if err != nil { 3302 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 3303 } 3304 } 3305 return 3306} 3307 3308// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3309// operation. 3310type GalleriesDeleteFuture struct { 3311 azure.FutureAPI 3312 // Result returns the result of the asynchronous operation. 3313 // If the operation has not completed it will return an error. 3314 Result func(GalleriesClient) (autorest.Response, error) 3315} 3316 3317// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3318func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { 3319 var azFuture azure.Future 3320 if err := json.Unmarshal(body, &azFuture); err != nil { 3321 return err 3322 } 3323 future.FutureAPI = &azFuture 3324 future.Result = future.result 3325 return nil 3326} 3327 3328// result is the default implementation for GalleriesDeleteFuture.Result. 3329func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { 3330 var done bool 3331 done, err = future.DoneWithContext(context.Background(), client) 3332 if err != nil { 3333 err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") 3334 return 3335 } 3336 if !done { 3337 ar.Response = future.Response() 3338 err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") 3339 return 3340 } 3341 ar.Response = future.Response() 3342 return 3343} 3344 3345// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3346// operation. 3347type GalleriesUpdateFuture struct { 3348 azure.FutureAPI 3349 // Result returns the result of the asynchronous operation. 3350 // If the operation has not completed it will return an error. 3351 Result func(GalleriesClient) (Gallery, error) 3352} 3353 3354// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3355func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { 3356 var azFuture azure.Future 3357 if err := json.Unmarshal(body, &azFuture); err != nil { 3358 return err 3359 } 3360 future.FutureAPI = &azFuture 3361 future.Result = future.result 3362 return nil 3363} 3364 3365// result is the default implementation for GalleriesUpdateFuture.Result. 3366func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 3367 var done bool 3368 done, err = future.DoneWithContext(context.Background(), client) 3369 if err != nil { 3370 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") 3371 return 3372 } 3373 if !done { 3374 g.Response.Response = future.Response() 3375 err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") 3376 return 3377 } 3378 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3379 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 3380 g, err = client.UpdateResponder(g.Response.Response) 3381 if err != nil { 3382 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 3383 } 3384 } 3385 return 3386} 3387 3388// Gallery specifies information about the Shared Image Gallery that you want to create or update. 3389type Gallery struct { 3390 autorest.Response `json:"-"` 3391 *GalleryProperties `json:"properties,omitempty"` 3392 // ID - READ-ONLY; Resource Id 3393 ID *string `json:"id,omitempty"` 3394 // Name - READ-ONLY; Resource name 3395 Name *string `json:"name,omitempty"` 3396 // Type - READ-ONLY; Resource type 3397 Type *string `json:"type,omitempty"` 3398 // Location - Resource location 3399 Location *string `json:"location,omitempty"` 3400 // Tags - Resource tags 3401 Tags map[string]*string `json:"tags"` 3402} 3403 3404// MarshalJSON is the custom marshaler for Gallery. 3405func (g Gallery) MarshalJSON() ([]byte, error) { 3406 objectMap := make(map[string]interface{}) 3407 if g.GalleryProperties != nil { 3408 objectMap["properties"] = g.GalleryProperties 3409 } 3410 if g.Location != nil { 3411 objectMap["location"] = g.Location 3412 } 3413 if g.Tags != nil { 3414 objectMap["tags"] = g.Tags 3415 } 3416 return json.Marshal(objectMap) 3417} 3418 3419// UnmarshalJSON is the custom unmarshaler for Gallery struct. 3420func (g *Gallery) UnmarshalJSON(body []byte) error { 3421 var m map[string]*json.RawMessage 3422 err := json.Unmarshal(body, &m) 3423 if err != nil { 3424 return err 3425 } 3426 for k, v := range m { 3427 switch k { 3428 case "properties": 3429 if v != nil { 3430 var galleryProperties GalleryProperties 3431 err = json.Unmarshal(*v, &galleryProperties) 3432 if err != nil { 3433 return err 3434 } 3435 g.GalleryProperties = &galleryProperties 3436 } 3437 case "id": 3438 if v != nil { 3439 var ID string 3440 err = json.Unmarshal(*v, &ID) 3441 if err != nil { 3442 return err 3443 } 3444 g.ID = &ID 3445 } 3446 case "name": 3447 if v != nil { 3448 var name string 3449 err = json.Unmarshal(*v, &name) 3450 if err != nil { 3451 return err 3452 } 3453 g.Name = &name 3454 } 3455 case "type": 3456 if v != nil { 3457 var typeVar string 3458 err = json.Unmarshal(*v, &typeVar) 3459 if err != nil { 3460 return err 3461 } 3462 g.Type = &typeVar 3463 } 3464 case "location": 3465 if v != nil { 3466 var location string 3467 err = json.Unmarshal(*v, &location) 3468 if err != nil { 3469 return err 3470 } 3471 g.Location = &location 3472 } 3473 case "tags": 3474 if v != nil { 3475 var tags map[string]*string 3476 err = json.Unmarshal(*v, &tags) 3477 if err != nil { 3478 return err 3479 } 3480 g.Tags = tags 3481 } 3482 } 3483 } 3484 3485 return nil 3486} 3487 3488// GalleryApplication specifies information about the gallery Application Definition that you want to 3489// create or update. 3490type GalleryApplication struct { 3491 autorest.Response `json:"-"` 3492 *GalleryApplicationProperties `json:"properties,omitempty"` 3493 // ID - READ-ONLY; Resource Id 3494 ID *string `json:"id,omitempty"` 3495 // Name - READ-ONLY; Resource name 3496 Name *string `json:"name,omitempty"` 3497 // Type - READ-ONLY; Resource type 3498 Type *string `json:"type,omitempty"` 3499 // Location - Resource location 3500 Location *string `json:"location,omitempty"` 3501 // Tags - Resource tags 3502 Tags map[string]*string `json:"tags"` 3503} 3504 3505// MarshalJSON is the custom marshaler for GalleryApplication. 3506func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 3507 objectMap := make(map[string]interface{}) 3508 if ga.GalleryApplicationProperties != nil { 3509 objectMap["properties"] = ga.GalleryApplicationProperties 3510 } 3511 if ga.Location != nil { 3512 objectMap["location"] = ga.Location 3513 } 3514 if ga.Tags != nil { 3515 objectMap["tags"] = ga.Tags 3516 } 3517 return json.Marshal(objectMap) 3518} 3519 3520// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 3521func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 3522 var m map[string]*json.RawMessage 3523 err := json.Unmarshal(body, &m) 3524 if err != nil { 3525 return err 3526 } 3527 for k, v := range m { 3528 switch k { 3529 case "properties": 3530 if v != nil { 3531 var galleryApplicationProperties GalleryApplicationProperties 3532 err = json.Unmarshal(*v, &galleryApplicationProperties) 3533 if err != nil { 3534 return err 3535 } 3536 ga.GalleryApplicationProperties = &galleryApplicationProperties 3537 } 3538 case "id": 3539 if v != nil { 3540 var ID string 3541 err = json.Unmarshal(*v, &ID) 3542 if err != nil { 3543 return err 3544 } 3545 ga.ID = &ID 3546 } 3547 case "name": 3548 if v != nil { 3549 var name string 3550 err = json.Unmarshal(*v, &name) 3551 if err != nil { 3552 return err 3553 } 3554 ga.Name = &name 3555 } 3556 case "type": 3557 if v != nil { 3558 var typeVar string 3559 err = json.Unmarshal(*v, &typeVar) 3560 if err != nil { 3561 return err 3562 } 3563 ga.Type = &typeVar 3564 } 3565 case "location": 3566 if v != nil { 3567 var location string 3568 err = json.Unmarshal(*v, &location) 3569 if err != nil { 3570 return err 3571 } 3572 ga.Location = &location 3573 } 3574 case "tags": 3575 if v != nil { 3576 var tags map[string]*string 3577 err = json.Unmarshal(*v, &tags) 3578 if err != nil { 3579 return err 3580 } 3581 ga.Tags = tags 3582 } 3583 } 3584 } 3585 3586 return nil 3587} 3588 3589// GalleryApplicationList the List Gallery Applications operation response. 3590type GalleryApplicationList struct { 3591 autorest.Response `json:"-"` 3592 // Value - A list of Gallery Applications. 3593 Value *[]GalleryApplication `json:"value,omitempty"` 3594 // NextLink - The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. 3595 NextLink *string `json:"nextLink,omitempty"` 3596} 3597 3598// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 3599type GalleryApplicationListIterator struct { 3600 i int 3601 page GalleryApplicationListPage 3602} 3603 3604// NextWithContext advances to the next value. If there was an error making 3605// the request the iterator does not advance and the error is returned. 3606func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 3607 if tracing.IsEnabled() { 3608 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 3609 defer func() { 3610 sc := -1 3611 if iter.Response().Response.Response != nil { 3612 sc = iter.Response().Response.Response.StatusCode 3613 } 3614 tracing.EndSpan(ctx, sc, err) 3615 }() 3616 } 3617 iter.i++ 3618 if iter.i < len(iter.page.Values()) { 3619 return nil 3620 } 3621 err = iter.page.NextWithContext(ctx) 3622 if err != nil { 3623 iter.i-- 3624 return err 3625 } 3626 iter.i = 0 3627 return nil 3628} 3629 3630// Next advances to the next value. If there was an error making 3631// the request the iterator does not advance and the error is returned. 3632// Deprecated: Use NextWithContext() instead. 3633func (iter *GalleryApplicationListIterator) Next() error { 3634 return iter.NextWithContext(context.Background()) 3635} 3636 3637// NotDone returns true if the enumeration should be started or is not yet complete. 3638func (iter GalleryApplicationListIterator) NotDone() bool { 3639 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3640} 3641 3642// Response returns the raw server response from the last page request. 3643func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 3644 return iter.page.Response() 3645} 3646 3647// Value returns the current value or a zero-initialized value if the 3648// iterator has advanced beyond the end of the collection. 3649func (iter GalleryApplicationListIterator) Value() GalleryApplication { 3650 if !iter.page.NotDone() { 3651 return GalleryApplication{} 3652 } 3653 return iter.page.Values()[iter.i] 3654} 3655 3656// Creates a new instance of the GalleryApplicationListIterator type. 3657func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 3658 return GalleryApplicationListIterator{page: page} 3659} 3660 3661// IsEmpty returns true if the ListResult contains no values. 3662func (gal GalleryApplicationList) IsEmpty() bool { 3663 return gal.Value == nil || len(*gal.Value) == 0 3664} 3665 3666// hasNextLink returns true if the NextLink is not empty. 3667func (gal GalleryApplicationList) hasNextLink() bool { 3668 return gal.NextLink != nil && len(*gal.NextLink) != 0 3669} 3670 3671// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 3672// It returns nil if no more results exist. 3673func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 3674 if !gal.hasNextLink() { 3675 return nil, nil 3676 } 3677 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3678 autorest.AsJSON(), 3679 autorest.AsGet(), 3680 autorest.WithBaseURL(to.String(gal.NextLink))) 3681} 3682 3683// GalleryApplicationListPage contains a page of GalleryApplication values. 3684type GalleryApplicationListPage struct { 3685 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 3686 gal GalleryApplicationList 3687} 3688 3689// NextWithContext advances to the next page of values. If there was an error making 3690// the request the page does not advance and the error is returned. 3691func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 3692 if tracing.IsEnabled() { 3693 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 3694 defer func() { 3695 sc := -1 3696 if page.Response().Response.Response != nil { 3697 sc = page.Response().Response.Response.StatusCode 3698 } 3699 tracing.EndSpan(ctx, sc, err) 3700 }() 3701 } 3702 for { 3703 next, err := page.fn(ctx, page.gal) 3704 if err != nil { 3705 return err 3706 } 3707 page.gal = next 3708 if !next.hasNextLink() || !next.IsEmpty() { 3709 break 3710 } 3711 } 3712 return nil 3713} 3714 3715// Next advances to the next page of values. If there was an error making 3716// the request the page does not advance and the error is returned. 3717// Deprecated: Use NextWithContext() instead. 3718func (page *GalleryApplicationListPage) Next() error { 3719 return page.NextWithContext(context.Background()) 3720} 3721 3722// NotDone returns true if the page enumeration should be started or is not yet complete. 3723func (page GalleryApplicationListPage) NotDone() bool { 3724 return !page.gal.IsEmpty() 3725} 3726 3727// Response returns the raw server response from the last page request. 3728func (page GalleryApplicationListPage) Response() GalleryApplicationList { 3729 return page.gal 3730} 3731 3732// Values returns the slice of values for the current page or nil if there are no values. 3733func (page GalleryApplicationListPage) Values() []GalleryApplication { 3734 if page.gal.IsEmpty() { 3735 return nil 3736 } 3737 return *page.gal.Value 3738} 3739 3740// Creates a new instance of the GalleryApplicationListPage type. 3741func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 3742 return GalleryApplicationListPage{ 3743 fn: getNextPage, 3744 gal: cur, 3745 } 3746} 3747 3748// GalleryApplicationProperties describes the properties of a gallery Application Definition. 3749type GalleryApplicationProperties struct { 3750 // Description - The description of this gallery Application Definition resource. This property is updatable. 3751 Description *string `json:"description,omitempty"` 3752 // Eula - The Eula agreement for the gallery Application Definition. 3753 Eula *string `json:"eula,omitempty"` 3754 // PrivacyStatementURI - The privacy statement uri. 3755 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 3756 // ReleaseNoteURI - The release note uri. 3757 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 3758 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 3759 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3760 // SupportedOSType - This property allows you to specify the supported type of the OS that application is built for. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 3761 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 3762} 3763 3764// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3765// long-running operation. 3766type GalleryApplicationsCreateOrUpdateFuture struct { 3767 azure.FutureAPI 3768 // Result returns the result of the asynchronous operation. 3769 // If the operation has not completed it will return an error. 3770 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3771} 3772 3773// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3774func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3775 var azFuture azure.Future 3776 if err := json.Unmarshal(body, &azFuture); err != nil { 3777 return err 3778 } 3779 future.FutureAPI = &azFuture 3780 future.Result = future.result 3781 return nil 3782} 3783 3784// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. 3785func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 3786 var done bool 3787 done, err = future.DoneWithContext(context.Background(), client) 3788 if err != nil { 3789 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3790 return 3791 } 3792 if !done { 3793 ga.Response.Response = future.Response() 3794 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") 3795 return 3796 } 3797 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3798 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 3799 ga, err = client.CreateOrUpdateResponder(ga.Response.Response) 3800 if err != nil { 3801 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 3802 } 3803 } 3804 return 3805} 3806 3807// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 3808// long-running operation. 3809type GalleryApplicationsDeleteFuture struct { 3810 azure.FutureAPI 3811 // Result returns the result of the asynchronous operation. 3812 // If the operation has not completed it will return an error. 3813 Result func(GalleryApplicationsClient) (autorest.Response, error) 3814} 3815 3816// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3817func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { 3818 var azFuture azure.Future 3819 if err := json.Unmarshal(body, &azFuture); err != nil { 3820 return err 3821 } 3822 future.FutureAPI = &azFuture 3823 future.Result = future.result 3824 return nil 3825} 3826 3827// result is the default implementation for GalleryApplicationsDeleteFuture.Result. 3828func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { 3829 var done bool 3830 done, err = future.DoneWithContext(context.Background(), client) 3831 if err != nil { 3832 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") 3833 return 3834 } 3835 if !done { 3836 ar.Response = future.Response() 3837 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") 3838 return 3839 } 3840 ar.Response = future.Response() 3841 return 3842} 3843 3844// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 3845// long-running operation. 3846type GalleryApplicationsUpdateFuture struct { 3847 azure.FutureAPI 3848 // Result returns the result of the asynchronous operation. 3849 // If the operation has not completed it will return an error. 3850 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3851} 3852 3853// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3854func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { 3855 var azFuture azure.Future 3856 if err := json.Unmarshal(body, &azFuture); err != nil { 3857 return err 3858 } 3859 future.FutureAPI = &azFuture 3860 future.Result = future.result 3861 return nil 3862} 3863 3864// result is the default implementation for GalleryApplicationsUpdateFuture.Result. 3865func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 3866 var done bool 3867 done, err = future.DoneWithContext(context.Background(), client) 3868 if err != nil { 3869 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") 3870 return 3871 } 3872 if !done { 3873 ga.Response.Response = future.Response() 3874 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") 3875 return 3876 } 3877 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3878 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 3879 ga, err = client.UpdateResponder(ga.Response.Response) 3880 if err != nil { 3881 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 3882 } 3883 } 3884 return 3885} 3886 3887// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 3888// update. 3889type GalleryApplicationUpdate struct { 3890 *GalleryApplicationProperties `json:"properties,omitempty"` 3891 // Tags - Resource tags 3892 Tags map[string]*string `json:"tags"` 3893} 3894 3895// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 3896func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 3897 objectMap := make(map[string]interface{}) 3898 if gau.GalleryApplicationProperties != nil { 3899 objectMap["properties"] = gau.GalleryApplicationProperties 3900 } 3901 if gau.Tags != nil { 3902 objectMap["tags"] = gau.Tags 3903 } 3904 return json.Marshal(objectMap) 3905} 3906 3907// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 3908func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 3909 var m map[string]*json.RawMessage 3910 err := json.Unmarshal(body, &m) 3911 if err != nil { 3912 return err 3913 } 3914 for k, v := range m { 3915 switch k { 3916 case "properties": 3917 if v != nil { 3918 var galleryApplicationProperties GalleryApplicationProperties 3919 err = json.Unmarshal(*v, &galleryApplicationProperties) 3920 if err != nil { 3921 return err 3922 } 3923 gau.GalleryApplicationProperties = &galleryApplicationProperties 3924 } 3925 case "tags": 3926 if v != nil { 3927 var tags map[string]*string 3928 err = json.Unmarshal(*v, &tags) 3929 if err != nil { 3930 return err 3931 } 3932 gau.Tags = tags 3933 } 3934 } 3935 } 3936 3937 return nil 3938} 3939 3940// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 3941// create or update. 3942type GalleryApplicationVersion struct { 3943 autorest.Response `json:"-"` 3944 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 3945 // ID - READ-ONLY; Resource Id 3946 ID *string `json:"id,omitempty"` 3947 // Name - READ-ONLY; Resource name 3948 Name *string `json:"name,omitempty"` 3949 // Type - READ-ONLY; Resource type 3950 Type *string `json:"type,omitempty"` 3951 // Location - Resource location 3952 Location *string `json:"location,omitempty"` 3953 // Tags - Resource tags 3954 Tags map[string]*string `json:"tags"` 3955} 3956 3957// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 3958func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 3959 objectMap := make(map[string]interface{}) 3960 if gav.GalleryApplicationVersionProperties != nil { 3961 objectMap["properties"] = gav.GalleryApplicationVersionProperties 3962 } 3963 if gav.Location != nil { 3964 objectMap["location"] = gav.Location 3965 } 3966 if gav.Tags != nil { 3967 objectMap["tags"] = gav.Tags 3968 } 3969 return json.Marshal(objectMap) 3970} 3971 3972// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 3973func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 3974 var m map[string]*json.RawMessage 3975 err := json.Unmarshal(body, &m) 3976 if err != nil { 3977 return err 3978 } 3979 for k, v := range m { 3980 switch k { 3981 case "properties": 3982 if v != nil { 3983 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 3984 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 3985 if err != nil { 3986 return err 3987 } 3988 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 3989 } 3990 case "id": 3991 if v != nil { 3992 var ID string 3993 err = json.Unmarshal(*v, &ID) 3994 if err != nil { 3995 return err 3996 } 3997 gav.ID = &ID 3998 } 3999 case "name": 4000 if v != nil { 4001 var name string 4002 err = json.Unmarshal(*v, &name) 4003 if err != nil { 4004 return err 4005 } 4006 gav.Name = &name 4007 } 4008 case "type": 4009 if v != nil { 4010 var typeVar string 4011 err = json.Unmarshal(*v, &typeVar) 4012 if err != nil { 4013 return err 4014 } 4015 gav.Type = &typeVar 4016 } 4017 case "location": 4018 if v != nil { 4019 var location string 4020 err = json.Unmarshal(*v, &location) 4021 if err != nil { 4022 return err 4023 } 4024 gav.Location = &location 4025 } 4026 case "tags": 4027 if v != nil { 4028 var tags map[string]*string 4029 err = json.Unmarshal(*v, &tags) 4030 if err != nil { 4031 return err 4032 } 4033 gav.Tags = tags 4034 } 4035 } 4036 } 4037 4038 return nil 4039} 4040 4041// GalleryApplicationVersionList the List Gallery Application version operation response. 4042type GalleryApplicationVersionList struct { 4043 autorest.Response `json:"-"` 4044 // Value - A list of gallery Application Versions. 4045 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 4046 // NextLink - The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. 4047 NextLink *string `json:"nextLink,omitempty"` 4048} 4049 4050// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 4051// values. 4052type GalleryApplicationVersionListIterator struct { 4053 i int 4054 page GalleryApplicationVersionListPage 4055} 4056 4057// NextWithContext advances to the next value. If there was an error making 4058// the request the iterator does not advance and the error is returned. 4059func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 4060 if tracing.IsEnabled() { 4061 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 4062 defer func() { 4063 sc := -1 4064 if iter.Response().Response.Response != nil { 4065 sc = iter.Response().Response.Response.StatusCode 4066 } 4067 tracing.EndSpan(ctx, sc, err) 4068 }() 4069 } 4070 iter.i++ 4071 if iter.i < len(iter.page.Values()) { 4072 return nil 4073 } 4074 err = iter.page.NextWithContext(ctx) 4075 if err != nil { 4076 iter.i-- 4077 return err 4078 } 4079 iter.i = 0 4080 return nil 4081} 4082 4083// Next advances to the next value. If there was an error making 4084// the request the iterator does not advance and the error is returned. 4085// Deprecated: Use NextWithContext() instead. 4086func (iter *GalleryApplicationVersionListIterator) Next() error { 4087 return iter.NextWithContext(context.Background()) 4088} 4089 4090// NotDone returns true if the enumeration should be started or is not yet complete. 4091func (iter GalleryApplicationVersionListIterator) NotDone() bool { 4092 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4093} 4094 4095// Response returns the raw server response from the last page request. 4096func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 4097 return iter.page.Response() 4098} 4099 4100// Value returns the current value or a zero-initialized value if the 4101// iterator has advanced beyond the end of the collection. 4102func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 4103 if !iter.page.NotDone() { 4104 return GalleryApplicationVersion{} 4105 } 4106 return iter.page.Values()[iter.i] 4107} 4108 4109// Creates a new instance of the GalleryApplicationVersionListIterator type. 4110func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 4111 return GalleryApplicationVersionListIterator{page: page} 4112} 4113 4114// IsEmpty returns true if the ListResult contains no values. 4115func (gavl GalleryApplicationVersionList) IsEmpty() bool { 4116 return gavl.Value == nil || len(*gavl.Value) == 0 4117} 4118 4119// hasNextLink returns true if the NextLink is not empty. 4120func (gavl GalleryApplicationVersionList) hasNextLink() bool { 4121 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 4122} 4123 4124// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 4125// It returns nil if no more results exist. 4126func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 4127 if !gavl.hasNextLink() { 4128 return nil, nil 4129 } 4130 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4131 autorest.AsJSON(), 4132 autorest.AsGet(), 4133 autorest.WithBaseURL(to.String(gavl.NextLink))) 4134} 4135 4136// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 4137type GalleryApplicationVersionListPage struct { 4138 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 4139 gavl GalleryApplicationVersionList 4140} 4141 4142// NextWithContext advances to the next page of values. If there was an error making 4143// the request the page does not advance and the error is returned. 4144func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 4145 if tracing.IsEnabled() { 4146 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 4147 defer func() { 4148 sc := -1 4149 if page.Response().Response.Response != nil { 4150 sc = page.Response().Response.Response.StatusCode 4151 } 4152 tracing.EndSpan(ctx, sc, err) 4153 }() 4154 } 4155 for { 4156 next, err := page.fn(ctx, page.gavl) 4157 if err != nil { 4158 return err 4159 } 4160 page.gavl = next 4161 if !next.hasNextLink() || !next.IsEmpty() { 4162 break 4163 } 4164 } 4165 return nil 4166} 4167 4168// Next advances to the next page of values. If there was an error making 4169// the request the page does not advance and the error is returned. 4170// Deprecated: Use NextWithContext() instead. 4171func (page *GalleryApplicationVersionListPage) Next() error { 4172 return page.NextWithContext(context.Background()) 4173} 4174 4175// NotDone returns true if the page enumeration should be started or is not yet complete. 4176func (page GalleryApplicationVersionListPage) NotDone() bool { 4177 return !page.gavl.IsEmpty() 4178} 4179 4180// Response returns the raw server response from the last page request. 4181func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 4182 return page.gavl 4183} 4184 4185// Values returns the slice of values for the current page or nil if there are no values. 4186func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 4187 if page.gavl.IsEmpty() { 4188 return nil 4189 } 4190 return *page.gavl.Value 4191} 4192 4193// Creates a new instance of the GalleryApplicationVersionListPage type. 4194func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 4195 return GalleryApplicationVersionListPage{ 4196 fn: getNextPage, 4197 gavl: cur, 4198 } 4199} 4200 4201// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. 4202type GalleryApplicationVersionProperties struct { 4203 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 4204 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 4205 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 4206 // ReplicationStatus - READ-ONLY 4207 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 4208} 4209 4210// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 4211func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 4212 objectMap := make(map[string]interface{}) 4213 if gavp.PublishingProfile != nil { 4214 objectMap["publishingProfile"] = gavp.PublishingProfile 4215 } 4216 return json.Marshal(objectMap) 4217} 4218 4219// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. 4220type GalleryApplicationVersionPublishingProfile struct { 4221 Source *UserArtifactSource `json:"source,omitempty"` 4222 // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. 4223 ContentType *string `json:"contentType,omitempty"` 4224 // EnableHealthCheck - Optional. Whether or not this application reports health. 4225 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 4226 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4227 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4228 // 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. 4229 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4230 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4231 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4232 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4233 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4234 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4235 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4236 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 4237 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4238} 4239 4240// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 4241func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 4242 objectMap := make(map[string]interface{}) 4243 if gavpp.Source != nil { 4244 objectMap["source"] = gavpp.Source 4245 } 4246 if gavpp.ContentType != nil { 4247 objectMap["contentType"] = gavpp.ContentType 4248 } 4249 if gavpp.EnableHealthCheck != nil { 4250 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 4251 } 4252 if gavpp.TargetRegions != nil { 4253 objectMap["targetRegions"] = gavpp.TargetRegions 4254 } 4255 if gavpp.ReplicaCount != nil { 4256 objectMap["replicaCount"] = gavpp.ReplicaCount 4257 } 4258 if gavpp.ExcludeFromLatest != nil { 4259 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 4260 } 4261 if gavpp.EndOfLifeDate != nil { 4262 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 4263 } 4264 if gavpp.StorageAccountType != "" { 4265 objectMap["storageAccountType"] = gavpp.StorageAccountType 4266 } 4267 return json.Marshal(objectMap) 4268} 4269 4270// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 4271// of a long-running operation. 4272type GalleryApplicationVersionsCreateOrUpdateFuture struct { 4273 azure.FutureAPI 4274 // Result returns the result of the asynchronous operation. 4275 // If the operation has not completed it will return an error. 4276 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4277} 4278 4279// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4280func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4281 var azFuture azure.Future 4282 if err := json.Unmarshal(body, &azFuture); err != nil { 4283 return err 4284 } 4285 future.FutureAPI = &azFuture 4286 future.Result = future.result 4287 return nil 4288} 4289 4290// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. 4291func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 4292 var done bool 4293 done, err = future.DoneWithContext(context.Background(), client) 4294 if err != nil { 4295 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4296 return 4297 } 4298 if !done { 4299 gav.Response.Response = future.Response() 4300 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") 4301 return 4302 } 4303 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4304 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 4305 gav, err = client.CreateOrUpdateResponder(gav.Response.Response) 4306 if err != nil { 4307 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 4308 } 4309 } 4310 return 4311} 4312 4313// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 4314// long-running operation. 4315type GalleryApplicationVersionsDeleteFuture struct { 4316 azure.FutureAPI 4317 // Result returns the result of the asynchronous operation. 4318 // If the operation has not completed it will return an error. 4319 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 4320} 4321 4322// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4323func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 4324 var azFuture azure.Future 4325 if err := json.Unmarshal(body, &azFuture); err != nil { 4326 return err 4327 } 4328 future.FutureAPI = &azFuture 4329 future.Result = future.result 4330 return nil 4331} 4332 4333// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. 4334func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { 4335 var done bool 4336 done, err = future.DoneWithContext(context.Background(), client) 4337 if err != nil { 4338 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 4339 return 4340 } 4341 if !done { 4342 ar.Response = future.Response() 4343 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") 4344 return 4345 } 4346 ar.Response = future.Response() 4347 return 4348} 4349 4350// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 4351// long-running operation. 4352type GalleryApplicationVersionsUpdateFuture struct { 4353 azure.FutureAPI 4354 // Result returns the result of the asynchronous operation. 4355 // If the operation has not completed it will return an error. 4356 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4357} 4358 4359// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4360func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 4361 var azFuture azure.Future 4362 if err := json.Unmarshal(body, &azFuture); err != nil { 4363 return err 4364 } 4365 future.FutureAPI = &azFuture 4366 future.Result = future.result 4367 return nil 4368} 4369 4370// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. 4371func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 4372 var done bool 4373 done, err = future.DoneWithContext(context.Background(), client) 4374 if err != nil { 4375 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 4376 return 4377 } 4378 if !done { 4379 gav.Response.Response = future.Response() 4380 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") 4381 return 4382 } 4383 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4384 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 4385 gav, err = client.UpdateResponder(gav.Response.Response) 4386 if err != nil { 4387 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 4388 } 4389 } 4390 return 4391} 4392 4393// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 4394// want to update. 4395type GalleryApplicationVersionUpdate struct { 4396 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 4397 // Tags - Resource tags 4398 Tags map[string]*string `json:"tags"` 4399} 4400 4401// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 4402func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 4403 objectMap := make(map[string]interface{}) 4404 if gavu.GalleryApplicationVersionProperties != nil { 4405 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 4406 } 4407 if gavu.Tags != nil { 4408 objectMap["tags"] = gavu.Tags 4409 } 4410 return json.Marshal(objectMap) 4411} 4412 4413// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 4414func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 4415 var m map[string]*json.RawMessage 4416 err := json.Unmarshal(body, &m) 4417 if err != nil { 4418 return err 4419 } 4420 for k, v := range m { 4421 switch k { 4422 case "properties": 4423 if v != nil { 4424 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 4425 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 4426 if err != nil { 4427 return err 4428 } 4429 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 4430 } 4431 case "tags": 4432 if v != nil { 4433 var tags map[string]*string 4434 err = json.Unmarshal(*v, &tags) 4435 if err != nil { 4436 return err 4437 } 4438 gavu.Tags = tags 4439 } 4440 } 4441 } 4442 4443 return nil 4444} 4445 4446// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 4447type GalleryArtifactPublishingProfileBase struct { 4448 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4449 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4450 // 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. 4451 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4452 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4453 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4454 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4455 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4456 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4457 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4458 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 4459 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4460} 4461 4462// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 4463func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 4464 objectMap := make(map[string]interface{}) 4465 if gappb.TargetRegions != nil { 4466 objectMap["targetRegions"] = gappb.TargetRegions 4467 } 4468 if gappb.ReplicaCount != nil { 4469 objectMap["replicaCount"] = gappb.ReplicaCount 4470 } 4471 if gappb.ExcludeFromLatest != nil { 4472 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 4473 } 4474 if gappb.EndOfLifeDate != nil { 4475 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 4476 } 4477 if gappb.StorageAccountType != "" { 4478 objectMap["storageAccountType"] = gappb.StorageAccountType 4479 } 4480 return json.Marshal(objectMap) 4481} 4482 4483// GalleryArtifactSource the source image from which the Image Version is going to be created. 4484type GalleryArtifactSource struct { 4485 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 4486} 4487 4488// GalleryArtifactVersionSource the gallery artifact version source. 4489type GalleryArtifactVersionSource struct { 4490 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. 4491 ID *string `json:"id,omitempty"` 4492} 4493 4494// GalleryDataDiskImage this is the data disk image. 4495type GalleryDataDiskImage struct { 4496 // Lun - 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. 4497 Lun *int32 `json:"lun,omitempty"` 4498 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 4499 SizeInGB *int32 `json:"sizeInGB,omitempty"` 4500 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 4501 HostCaching HostCaching `json:"hostCaching,omitempty"` 4502 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4503} 4504 4505// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 4506func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 4507 objectMap := make(map[string]interface{}) 4508 if gddi.Lun != nil { 4509 objectMap["lun"] = gddi.Lun 4510 } 4511 if gddi.HostCaching != "" { 4512 objectMap["hostCaching"] = gddi.HostCaching 4513 } 4514 if gddi.Source != nil { 4515 objectMap["source"] = gddi.Source 4516 } 4517 return json.Marshal(objectMap) 4518} 4519 4520// GalleryDiskImage this is the disk image base class. 4521type GalleryDiskImage struct { 4522 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 4523 SizeInGB *int32 `json:"sizeInGB,omitempty"` 4524 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 4525 HostCaching HostCaching `json:"hostCaching,omitempty"` 4526 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4527} 4528 4529// MarshalJSON is the custom marshaler for GalleryDiskImage. 4530func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 4531 objectMap := make(map[string]interface{}) 4532 if gdi.HostCaching != "" { 4533 objectMap["hostCaching"] = gdi.HostCaching 4534 } 4535 if gdi.Source != nil { 4536 objectMap["source"] = gdi.Source 4537 } 4538 return json.Marshal(objectMap) 4539} 4540 4541// GalleryIdentifier describes the gallery unique name. 4542type GalleryIdentifier struct { 4543 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 4544 UniqueName *string `json:"uniqueName,omitempty"` 4545} 4546 4547// MarshalJSON is the custom marshaler for GalleryIdentifier. 4548func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { 4549 objectMap := make(map[string]interface{}) 4550 return json.Marshal(objectMap) 4551} 4552 4553// GalleryImage specifies information about the gallery Image Definition that you want to create or update. 4554type GalleryImage struct { 4555 autorest.Response `json:"-"` 4556 *GalleryImageProperties `json:"properties,omitempty"` 4557 // ID - READ-ONLY; Resource Id 4558 ID *string `json:"id,omitempty"` 4559 // Name - READ-ONLY; Resource name 4560 Name *string `json:"name,omitempty"` 4561 // Type - READ-ONLY; Resource type 4562 Type *string `json:"type,omitempty"` 4563 // Location - Resource location 4564 Location *string `json:"location,omitempty"` 4565 // Tags - Resource tags 4566 Tags map[string]*string `json:"tags"` 4567} 4568 4569// MarshalJSON is the custom marshaler for GalleryImage. 4570func (gi GalleryImage) MarshalJSON() ([]byte, error) { 4571 objectMap := make(map[string]interface{}) 4572 if gi.GalleryImageProperties != nil { 4573 objectMap["properties"] = gi.GalleryImageProperties 4574 } 4575 if gi.Location != nil { 4576 objectMap["location"] = gi.Location 4577 } 4578 if gi.Tags != nil { 4579 objectMap["tags"] = gi.Tags 4580 } 4581 return json.Marshal(objectMap) 4582} 4583 4584// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 4585func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 4586 var m map[string]*json.RawMessage 4587 err := json.Unmarshal(body, &m) 4588 if err != nil { 4589 return err 4590 } 4591 for k, v := range m { 4592 switch k { 4593 case "properties": 4594 if v != nil { 4595 var galleryImageProperties GalleryImageProperties 4596 err = json.Unmarshal(*v, &galleryImageProperties) 4597 if err != nil { 4598 return err 4599 } 4600 gi.GalleryImageProperties = &galleryImageProperties 4601 } 4602 case "id": 4603 if v != nil { 4604 var ID string 4605 err = json.Unmarshal(*v, &ID) 4606 if err != nil { 4607 return err 4608 } 4609 gi.ID = &ID 4610 } 4611 case "name": 4612 if v != nil { 4613 var name string 4614 err = json.Unmarshal(*v, &name) 4615 if err != nil { 4616 return err 4617 } 4618 gi.Name = &name 4619 } 4620 case "type": 4621 if v != nil { 4622 var typeVar string 4623 err = json.Unmarshal(*v, &typeVar) 4624 if err != nil { 4625 return err 4626 } 4627 gi.Type = &typeVar 4628 } 4629 case "location": 4630 if v != nil { 4631 var location string 4632 err = json.Unmarshal(*v, &location) 4633 if err != nil { 4634 return err 4635 } 4636 gi.Location = &location 4637 } 4638 case "tags": 4639 if v != nil { 4640 var tags map[string]*string 4641 err = json.Unmarshal(*v, &tags) 4642 if err != nil { 4643 return err 4644 } 4645 gi.Tags = tags 4646 } 4647 } 4648 } 4649 4650 return nil 4651} 4652 4653// GalleryImageIdentifier this is the gallery Image Definition identifier. 4654type GalleryImageIdentifier struct { 4655 // Publisher - The name of the gallery Image Definition publisher. 4656 Publisher *string `json:"publisher,omitempty"` 4657 // Offer - The name of the gallery Image Definition offer. 4658 Offer *string `json:"offer,omitempty"` 4659 // Sku - The name of the gallery Image Definition SKU. 4660 Sku *string `json:"sku,omitempty"` 4661} 4662 4663// GalleryImageList the List Gallery Images operation response. 4664type GalleryImageList struct { 4665 autorest.Response `json:"-"` 4666 // Value - A list of Shared Image Gallery images. 4667 Value *[]GalleryImage `json:"value,omitempty"` 4668 // 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. 4669 NextLink *string `json:"nextLink,omitempty"` 4670} 4671 4672// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 4673type GalleryImageListIterator struct { 4674 i int 4675 page GalleryImageListPage 4676} 4677 4678// NextWithContext advances to the next value. If there was an error making 4679// the request the iterator does not advance and the error is returned. 4680func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 4681 if tracing.IsEnabled() { 4682 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 4683 defer func() { 4684 sc := -1 4685 if iter.Response().Response.Response != nil { 4686 sc = iter.Response().Response.Response.StatusCode 4687 } 4688 tracing.EndSpan(ctx, sc, err) 4689 }() 4690 } 4691 iter.i++ 4692 if iter.i < len(iter.page.Values()) { 4693 return nil 4694 } 4695 err = iter.page.NextWithContext(ctx) 4696 if err != nil { 4697 iter.i-- 4698 return err 4699 } 4700 iter.i = 0 4701 return nil 4702} 4703 4704// Next advances to the next value. If there was an error making 4705// the request the iterator does not advance and the error is returned. 4706// Deprecated: Use NextWithContext() instead. 4707func (iter *GalleryImageListIterator) Next() error { 4708 return iter.NextWithContext(context.Background()) 4709} 4710 4711// NotDone returns true if the enumeration should be started or is not yet complete. 4712func (iter GalleryImageListIterator) NotDone() bool { 4713 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4714} 4715 4716// Response returns the raw server response from the last page request. 4717func (iter GalleryImageListIterator) Response() GalleryImageList { 4718 return iter.page.Response() 4719} 4720 4721// Value returns the current value or a zero-initialized value if the 4722// iterator has advanced beyond the end of the collection. 4723func (iter GalleryImageListIterator) Value() GalleryImage { 4724 if !iter.page.NotDone() { 4725 return GalleryImage{} 4726 } 4727 return iter.page.Values()[iter.i] 4728} 4729 4730// Creates a new instance of the GalleryImageListIterator type. 4731func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 4732 return GalleryImageListIterator{page: page} 4733} 4734 4735// IsEmpty returns true if the ListResult contains no values. 4736func (gil GalleryImageList) IsEmpty() bool { 4737 return gil.Value == nil || len(*gil.Value) == 0 4738} 4739 4740// hasNextLink returns true if the NextLink is not empty. 4741func (gil GalleryImageList) hasNextLink() bool { 4742 return gil.NextLink != nil && len(*gil.NextLink) != 0 4743} 4744 4745// galleryImageListPreparer prepares a request to retrieve the next set of results. 4746// It returns nil if no more results exist. 4747func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 4748 if !gil.hasNextLink() { 4749 return nil, nil 4750 } 4751 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4752 autorest.AsJSON(), 4753 autorest.AsGet(), 4754 autorest.WithBaseURL(to.String(gil.NextLink))) 4755} 4756 4757// GalleryImageListPage contains a page of GalleryImage values. 4758type GalleryImageListPage struct { 4759 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 4760 gil GalleryImageList 4761} 4762 4763// NextWithContext advances to the next page of values. If there was an error making 4764// the request the page does not advance and the error is returned. 4765func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 4766 if tracing.IsEnabled() { 4767 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 4768 defer func() { 4769 sc := -1 4770 if page.Response().Response.Response != nil { 4771 sc = page.Response().Response.Response.StatusCode 4772 } 4773 tracing.EndSpan(ctx, sc, err) 4774 }() 4775 } 4776 for { 4777 next, err := page.fn(ctx, page.gil) 4778 if err != nil { 4779 return err 4780 } 4781 page.gil = next 4782 if !next.hasNextLink() || !next.IsEmpty() { 4783 break 4784 } 4785 } 4786 return nil 4787} 4788 4789// Next advances to the next page of values. If there was an error making 4790// the request the page does not advance and the error is returned. 4791// Deprecated: Use NextWithContext() instead. 4792func (page *GalleryImageListPage) Next() error { 4793 return page.NextWithContext(context.Background()) 4794} 4795 4796// NotDone returns true if the page enumeration should be started or is not yet complete. 4797func (page GalleryImageListPage) NotDone() bool { 4798 return !page.gil.IsEmpty() 4799} 4800 4801// Response returns the raw server response from the last page request. 4802func (page GalleryImageListPage) Response() GalleryImageList { 4803 return page.gil 4804} 4805 4806// Values returns the slice of values for the current page or nil if there are no values. 4807func (page GalleryImageListPage) Values() []GalleryImage { 4808 if page.gil.IsEmpty() { 4809 return nil 4810 } 4811 return *page.gil.Value 4812} 4813 4814// Creates a new instance of the GalleryImageListPage type. 4815func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 4816 return GalleryImageListPage{ 4817 fn: getNextPage, 4818 gil: cur, 4819 } 4820} 4821 4822// GalleryImageProperties describes the properties of a gallery Image Definition. 4823type GalleryImageProperties struct { 4824 // Description - The description of this gallery Image Definition resource. This property is updatable. 4825 Description *string `json:"description,omitempty"` 4826 // Eula - The Eula agreement for the gallery Image Definition. 4827 Eula *string `json:"eula,omitempty"` 4828 // PrivacyStatementURI - The privacy statement uri. 4829 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 4830 // ReleaseNoteURI - The release note uri. 4831 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 4832 // 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' 4833 OsType OperatingSystemTypes `json:"osType,omitempty"` 4834 // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' 4835 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 4836 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 4837 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4838 // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. 4839 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4840 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 4841 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 4842 Disallowed *Disallowed `json:"disallowed,omitempty"` 4843 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 4844 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 4845 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 4846} 4847 4848// MarshalJSON is the custom marshaler for GalleryImageProperties. 4849func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 4850 objectMap := make(map[string]interface{}) 4851 if gip.Description != nil { 4852 objectMap["description"] = gip.Description 4853 } 4854 if gip.Eula != nil { 4855 objectMap["eula"] = gip.Eula 4856 } 4857 if gip.PrivacyStatementURI != nil { 4858 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 4859 } 4860 if gip.ReleaseNoteURI != nil { 4861 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 4862 } 4863 if gip.OsType != "" { 4864 objectMap["osType"] = gip.OsType 4865 } 4866 if gip.OsState != "" { 4867 objectMap["osState"] = gip.OsState 4868 } 4869 if gip.HyperVGeneration != "" { 4870 objectMap["hyperVGeneration"] = gip.HyperVGeneration 4871 } 4872 if gip.EndOfLifeDate != nil { 4873 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 4874 } 4875 if gip.Identifier != nil { 4876 objectMap["identifier"] = gip.Identifier 4877 } 4878 if gip.Recommended != nil { 4879 objectMap["recommended"] = gip.Recommended 4880 } 4881 if gip.Disallowed != nil { 4882 objectMap["disallowed"] = gip.Disallowed 4883 } 4884 if gip.PurchasePlan != nil { 4885 objectMap["purchasePlan"] = gip.PurchasePlan 4886 } 4887 return json.Marshal(objectMap) 4888} 4889 4890// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4891// long-running operation. 4892type GalleryImagesCreateOrUpdateFuture struct { 4893 azure.FutureAPI 4894 // Result returns the result of the asynchronous operation. 4895 // If the operation has not completed it will return an error. 4896 Result func(GalleryImagesClient) (GalleryImage, error) 4897} 4898 4899// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4900func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4901 var azFuture azure.Future 4902 if err := json.Unmarshal(body, &azFuture); err != nil { 4903 return err 4904 } 4905 future.FutureAPI = &azFuture 4906 future.Result = future.result 4907 return nil 4908} 4909 4910// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. 4911func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 4912 var done bool 4913 done, err = future.DoneWithContext(context.Background(), client) 4914 if err != nil { 4915 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4916 return 4917 } 4918 if !done { 4919 gi.Response.Response = future.Response() 4920 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") 4921 return 4922 } 4923 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4924 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 4925 gi, err = client.CreateOrUpdateResponder(gi.Response.Response) 4926 if err != nil { 4927 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 4928 } 4929 } 4930 return 4931} 4932 4933// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4934// operation. 4935type GalleryImagesDeleteFuture struct { 4936 azure.FutureAPI 4937 // Result returns the result of the asynchronous operation. 4938 // If the operation has not completed it will return an error. 4939 Result func(GalleryImagesClient) (autorest.Response, error) 4940} 4941 4942// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4943func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { 4944 var azFuture azure.Future 4945 if err := json.Unmarshal(body, &azFuture); err != nil { 4946 return err 4947 } 4948 future.FutureAPI = &azFuture 4949 future.Result = future.result 4950 return nil 4951} 4952 4953// result is the default implementation for GalleryImagesDeleteFuture.Result. 4954func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { 4955 var done bool 4956 done, err = future.DoneWithContext(context.Background(), client) 4957 if err != nil { 4958 err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") 4959 return 4960 } 4961 if !done { 4962 ar.Response = future.Response() 4963 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") 4964 return 4965 } 4966 ar.Response = future.Response() 4967 return 4968} 4969 4970// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4971// operation. 4972type GalleryImagesUpdateFuture struct { 4973 azure.FutureAPI 4974 // Result returns the result of the asynchronous operation. 4975 // If the operation has not completed it will return an error. 4976 Result func(GalleryImagesClient) (GalleryImage, error) 4977} 4978 4979// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4980func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { 4981 var azFuture azure.Future 4982 if err := json.Unmarshal(body, &azFuture); err != nil { 4983 return err 4984 } 4985 future.FutureAPI = &azFuture 4986 future.Result = future.result 4987 return nil 4988} 4989 4990// result is the default implementation for GalleryImagesUpdateFuture.Result. 4991func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 4992 var done bool 4993 done, err = future.DoneWithContext(context.Background(), client) 4994 if err != nil { 4995 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") 4996 return 4997 } 4998 if !done { 4999 gi.Response.Response = future.Response() 5000 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") 5001 return 5002 } 5003 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5004 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 5005 gi, err = client.UpdateResponder(gi.Response.Response) 5006 if err != nil { 5007 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 5008 } 5009 } 5010 return 5011} 5012 5013// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. 5014type GalleryImageUpdate struct { 5015 *GalleryImageProperties `json:"properties,omitempty"` 5016 // Tags - Resource tags 5017 Tags map[string]*string `json:"tags"` 5018} 5019 5020// MarshalJSON is the custom marshaler for GalleryImageUpdate. 5021func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 5022 objectMap := make(map[string]interface{}) 5023 if giu.GalleryImageProperties != nil { 5024 objectMap["properties"] = giu.GalleryImageProperties 5025 } 5026 if giu.Tags != nil { 5027 objectMap["tags"] = giu.Tags 5028 } 5029 return json.Marshal(objectMap) 5030} 5031 5032// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 5033func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 5034 var m map[string]*json.RawMessage 5035 err := json.Unmarshal(body, &m) 5036 if err != nil { 5037 return err 5038 } 5039 for k, v := range m { 5040 switch k { 5041 case "properties": 5042 if v != nil { 5043 var galleryImageProperties GalleryImageProperties 5044 err = json.Unmarshal(*v, &galleryImageProperties) 5045 if err != nil { 5046 return err 5047 } 5048 giu.GalleryImageProperties = &galleryImageProperties 5049 } 5050 case "tags": 5051 if v != nil { 5052 var tags map[string]*string 5053 err = json.Unmarshal(*v, &tags) 5054 if err != nil { 5055 return err 5056 } 5057 giu.Tags = tags 5058 } 5059 } 5060 } 5061 5062 return nil 5063} 5064 5065// GalleryImageVersion specifies information about the gallery Image Version that you want to create or 5066// update. 5067type GalleryImageVersion struct { 5068 autorest.Response `json:"-"` 5069 *GalleryImageVersionProperties `json:"properties,omitempty"` 5070 // ID - READ-ONLY; Resource Id 5071 ID *string `json:"id,omitempty"` 5072 // Name - READ-ONLY; Resource name 5073 Name *string `json:"name,omitempty"` 5074 // Type - READ-ONLY; Resource type 5075 Type *string `json:"type,omitempty"` 5076 // Location - Resource location 5077 Location *string `json:"location,omitempty"` 5078 // Tags - Resource tags 5079 Tags map[string]*string `json:"tags"` 5080} 5081 5082// MarshalJSON is the custom marshaler for GalleryImageVersion. 5083func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 5084 objectMap := make(map[string]interface{}) 5085 if giv.GalleryImageVersionProperties != nil { 5086 objectMap["properties"] = giv.GalleryImageVersionProperties 5087 } 5088 if giv.Location != nil { 5089 objectMap["location"] = giv.Location 5090 } 5091 if giv.Tags != nil { 5092 objectMap["tags"] = giv.Tags 5093 } 5094 return json.Marshal(objectMap) 5095} 5096 5097// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 5098func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 5099 var m map[string]*json.RawMessage 5100 err := json.Unmarshal(body, &m) 5101 if err != nil { 5102 return err 5103 } 5104 for k, v := range m { 5105 switch k { 5106 case "properties": 5107 if v != nil { 5108 var galleryImageVersionProperties GalleryImageVersionProperties 5109 err = json.Unmarshal(*v, &galleryImageVersionProperties) 5110 if err != nil { 5111 return err 5112 } 5113 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 5114 } 5115 case "id": 5116 if v != nil { 5117 var ID string 5118 err = json.Unmarshal(*v, &ID) 5119 if err != nil { 5120 return err 5121 } 5122 giv.ID = &ID 5123 } 5124 case "name": 5125 if v != nil { 5126 var name string 5127 err = json.Unmarshal(*v, &name) 5128 if err != nil { 5129 return err 5130 } 5131 giv.Name = &name 5132 } 5133 case "type": 5134 if v != nil { 5135 var typeVar string 5136 err = json.Unmarshal(*v, &typeVar) 5137 if err != nil { 5138 return err 5139 } 5140 giv.Type = &typeVar 5141 } 5142 case "location": 5143 if v != nil { 5144 var location string 5145 err = json.Unmarshal(*v, &location) 5146 if err != nil { 5147 return err 5148 } 5149 giv.Location = &location 5150 } 5151 case "tags": 5152 if v != nil { 5153 var tags map[string]*string 5154 err = json.Unmarshal(*v, &tags) 5155 if err != nil { 5156 return err 5157 } 5158 giv.Tags = tags 5159 } 5160 } 5161 } 5162 5163 return nil 5164} 5165 5166// GalleryImageVersionList the List Gallery Image version operation response. 5167type GalleryImageVersionList struct { 5168 autorest.Response `json:"-"` 5169 // Value - A list of gallery Image Versions. 5170 Value *[]GalleryImageVersion `json:"value,omitempty"` 5171 // 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. 5172 NextLink *string `json:"nextLink,omitempty"` 5173} 5174 5175// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 5176type GalleryImageVersionListIterator struct { 5177 i int 5178 page GalleryImageVersionListPage 5179} 5180 5181// NextWithContext advances to the next value. If there was an error making 5182// the request the iterator does not advance and the error is returned. 5183func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 5184 if tracing.IsEnabled() { 5185 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 5186 defer func() { 5187 sc := -1 5188 if iter.Response().Response.Response != nil { 5189 sc = iter.Response().Response.Response.StatusCode 5190 } 5191 tracing.EndSpan(ctx, sc, err) 5192 }() 5193 } 5194 iter.i++ 5195 if iter.i < len(iter.page.Values()) { 5196 return nil 5197 } 5198 err = iter.page.NextWithContext(ctx) 5199 if err != nil { 5200 iter.i-- 5201 return err 5202 } 5203 iter.i = 0 5204 return nil 5205} 5206 5207// Next advances to the next value. If there was an error making 5208// the request the iterator does not advance and the error is returned. 5209// Deprecated: Use NextWithContext() instead. 5210func (iter *GalleryImageVersionListIterator) Next() error { 5211 return iter.NextWithContext(context.Background()) 5212} 5213 5214// NotDone returns true if the enumeration should be started or is not yet complete. 5215func (iter GalleryImageVersionListIterator) NotDone() bool { 5216 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5217} 5218 5219// Response returns the raw server response from the last page request. 5220func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 5221 return iter.page.Response() 5222} 5223 5224// Value returns the current value or a zero-initialized value if the 5225// iterator has advanced beyond the end of the collection. 5226func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 5227 if !iter.page.NotDone() { 5228 return GalleryImageVersion{} 5229 } 5230 return iter.page.Values()[iter.i] 5231} 5232 5233// Creates a new instance of the GalleryImageVersionListIterator type. 5234func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 5235 return GalleryImageVersionListIterator{page: page} 5236} 5237 5238// IsEmpty returns true if the ListResult contains no values. 5239func (givl GalleryImageVersionList) IsEmpty() bool { 5240 return givl.Value == nil || len(*givl.Value) == 0 5241} 5242 5243// hasNextLink returns true if the NextLink is not empty. 5244func (givl GalleryImageVersionList) hasNextLink() bool { 5245 return givl.NextLink != nil && len(*givl.NextLink) != 0 5246} 5247 5248// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 5249// It returns nil if no more results exist. 5250func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 5251 if !givl.hasNextLink() { 5252 return nil, nil 5253 } 5254 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5255 autorest.AsJSON(), 5256 autorest.AsGet(), 5257 autorest.WithBaseURL(to.String(givl.NextLink))) 5258} 5259 5260// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 5261type GalleryImageVersionListPage struct { 5262 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 5263 givl GalleryImageVersionList 5264} 5265 5266// NextWithContext advances to the next page of values. If there was an error making 5267// the request the page does not advance and the error is returned. 5268func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 5269 if tracing.IsEnabled() { 5270 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 5271 defer func() { 5272 sc := -1 5273 if page.Response().Response.Response != nil { 5274 sc = page.Response().Response.Response.StatusCode 5275 } 5276 tracing.EndSpan(ctx, sc, err) 5277 }() 5278 } 5279 for { 5280 next, err := page.fn(ctx, page.givl) 5281 if err != nil { 5282 return err 5283 } 5284 page.givl = next 5285 if !next.hasNextLink() || !next.IsEmpty() { 5286 break 5287 } 5288 } 5289 return nil 5290} 5291 5292// Next advances to the next page of values. If there was an error making 5293// the request the page does not advance and the error is returned. 5294// Deprecated: Use NextWithContext() instead. 5295func (page *GalleryImageVersionListPage) Next() error { 5296 return page.NextWithContext(context.Background()) 5297} 5298 5299// NotDone returns true if the page enumeration should be started or is not yet complete. 5300func (page GalleryImageVersionListPage) NotDone() bool { 5301 return !page.givl.IsEmpty() 5302} 5303 5304// Response returns the raw server response from the last page request. 5305func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 5306 return page.givl 5307} 5308 5309// Values returns the slice of values for the current page or nil if there are no values. 5310func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 5311 if page.givl.IsEmpty() { 5312 return nil 5313 } 5314 return *page.givl.Value 5315} 5316 5317// Creates a new instance of the GalleryImageVersionListPage type. 5318func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 5319 return GalleryImageVersionListPage{ 5320 fn: getNextPage, 5321 givl: cur, 5322 } 5323} 5324 5325// GalleryImageVersionProperties describes the properties of a gallery Image Version. 5326type GalleryImageVersionProperties struct { 5327 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 5328 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 5329 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 5330 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 5331 // ReplicationStatus - READ-ONLY 5332 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 5333} 5334 5335// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 5336func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 5337 objectMap := make(map[string]interface{}) 5338 if givp.PublishingProfile != nil { 5339 objectMap["publishingProfile"] = givp.PublishingProfile 5340 } 5341 if givp.StorageProfile != nil { 5342 objectMap["storageProfile"] = givp.StorageProfile 5343 } 5344 return json.Marshal(objectMap) 5345} 5346 5347// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. 5348type GalleryImageVersionPublishingProfile struct { 5349 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 5350 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 5351 // 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. 5352 ReplicaCount *int32 `json:"replicaCount,omitempty"` 5353 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 5354 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 5355 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 5356 PublishedDate *date.Time `json:"publishedDate,omitempty"` 5357 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 5358 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 5359 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 5360 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 5361} 5362 5363// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 5364func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 5365 objectMap := make(map[string]interface{}) 5366 if givpp.TargetRegions != nil { 5367 objectMap["targetRegions"] = givpp.TargetRegions 5368 } 5369 if givpp.ReplicaCount != nil { 5370 objectMap["replicaCount"] = givpp.ReplicaCount 5371 } 5372 if givpp.ExcludeFromLatest != nil { 5373 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 5374 } 5375 if givpp.EndOfLifeDate != nil { 5376 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 5377 } 5378 if givpp.StorageAccountType != "" { 5379 objectMap["storageAccountType"] = givpp.StorageAccountType 5380 } 5381 return json.Marshal(objectMap) 5382} 5383 5384// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5385// long-running operation. 5386type GalleryImageVersionsCreateOrUpdateFuture struct { 5387 azure.FutureAPI 5388 // Result returns the result of the asynchronous operation. 5389 // If the operation has not completed it will return an error. 5390 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 5391} 5392 5393// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5394func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5395 var azFuture azure.Future 5396 if err := json.Unmarshal(body, &azFuture); err != nil { 5397 return err 5398 } 5399 future.FutureAPI = &azFuture 5400 future.Result = future.result 5401 return nil 5402} 5403 5404// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. 5405func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 5406 var done bool 5407 done, err = future.DoneWithContext(context.Background(), client) 5408 if err != nil { 5409 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5410 return 5411 } 5412 if !done { 5413 giv.Response.Response = future.Response() 5414 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") 5415 return 5416 } 5417 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5418 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 5419 giv, err = client.CreateOrUpdateResponder(giv.Response.Response) 5420 if err != nil { 5421 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 5422 } 5423 } 5424 return 5425} 5426 5427// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 5428// long-running operation. 5429type GalleryImageVersionsDeleteFuture struct { 5430 azure.FutureAPI 5431 // Result returns the result of the asynchronous operation. 5432 // If the operation has not completed it will return an error. 5433 Result func(GalleryImageVersionsClient) (autorest.Response, error) 5434} 5435 5436// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5437func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 5438 var azFuture azure.Future 5439 if err := json.Unmarshal(body, &azFuture); err != nil { 5440 return err 5441 } 5442 future.FutureAPI = &azFuture 5443 future.Result = future.result 5444 return nil 5445} 5446 5447// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. 5448func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { 5449 var done bool 5450 done, err = future.DoneWithContext(context.Background(), client) 5451 if err != nil { 5452 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 5453 return 5454 } 5455 if !done { 5456 ar.Response = future.Response() 5457 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") 5458 return 5459 } 5460 ar.Response = future.Response() 5461 return 5462} 5463 5464// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 5465type GalleryImageVersionStorageProfile struct { 5466 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5467 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 5468 // DataDiskImages - A list of data disk images. 5469 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 5470} 5471 5472// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 5473// long-running operation. 5474type GalleryImageVersionsUpdateFuture struct { 5475 azure.FutureAPI 5476 // Result returns the result of the asynchronous operation. 5477 // If the operation has not completed it will return an error. 5478 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 5479} 5480 5481// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5482func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 5483 var azFuture azure.Future 5484 if err := json.Unmarshal(body, &azFuture); err != nil { 5485 return err 5486 } 5487 future.FutureAPI = &azFuture 5488 future.Result = future.result 5489 return nil 5490} 5491 5492// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. 5493func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 5494 var done bool 5495 done, err = future.DoneWithContext(context.Background(), client) 5496 if err != nil { 5497 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 5498 return 5499 } 5500 if !done { 5501 giv.Response.Response = future.Response() 5502 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") 5503 return 5504 } 5505 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5506 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 5507 giv, err = client.UpdateResponder(giv.Response.Response) 5508 if err != nil { 5509 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 5510 } 5511 } 5512 return 5513} 5514 5515// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. 5516type GalleryImageVersionUpdate struct { 5517 *GalleryImageVersionProperties `json:"properties,omitempty"` 5518 // Tags - Resource tags 5519 Tags map[string]*string `json:"tags"` 5520} 5521 5522// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 5523func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 5524 objectMap := make(map[string]interface{}) 5525 if givu.GalleryImageVersionProperties != nil { 5526 objectMap["properties"] = givu.GalleryImageVersionProperties 5527 } 5528 if givu.Tags != nil { 5529 objectMap["tags"] = givu.Tags 5530 } 5531 return json.Marshal(objectMap) 5532} 5533 5534// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 5535func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 5536 var m map[string]*json.RawMessage 5537 err := json.Unmarshal(body, &m) 5538 if err != nil { 5539 return err 5540 } 5541 for k, v := range m { 5542 switch k { 5543 case "properties": 5544 if v != nil { 5545 var galleryImageVersionProperties GalleryImageVersionProperties 5546 err = json.Unmarshal(*v, &galleryImageVersionProperties) 5547 if err != nil { 5548 return err 5549 } 5550 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 5551 } 5552 case "tags": 5553 if v != nil { 5554 var tags map[string]*string 5555 err = json.Unmarshal(*v, &tags) 5556 if err != nil { 5557 return err 5558 } 5559 givu.Tags = tags 5560 } 5561 } 5562 } 5563 5564 return nil 5565} 5566 5567// GalleryList the List Galleries operation response. 5568type GalleryList struct { 5569 autorest.Response `json:"-"` 5570 // Value - A list of galleries. 5571 Value *[]Gallery `json:"value,omitempty"` 5572 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 5573 NextLink *string `json:"nextLink,omitempty"` 5574} 5575 5576// GalleryListIterator provides access to a complete listing of Gallery values. 5577type GalleryListIterator struct { 5578 i int 5579 page GalleryListPage 5580} 5581 5582// NextWithContext advances to the next value. If there was an error making 5583// the request the iterator does not advance and the error is returned. 5584func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 5585 if tracing.IsEnabled() { 5586 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 5587 defer func() { 5588 sc := -1 5589 if iter.Response().Response.Response != nil { 5590 sc = iter.Response().Response.Response.StatusCode 5591 } 5592 tracing.EndSpan(ctx, sc, err) 5593 }() 5594 } 5595 iter.i++ 5596 if iter.i < len(iter.page.Values()) { 5597 return nil 5598 } 5599 err = iter.page.NextWithContext(ctx) 5600 if err != nil { 5601 iter.i-- 5602 return err 5603 } 5604 iter.i = 0 5605 return nil 5606} 5607 5608// Next advances to the next value. If there was an error making 5609// the request the iterator does not advance and the error is returned. 5610// Deprecated: Use NextWithContext() instead. 5611func (iter *GalleryListIterator) Next() error { 5612 return iter.NextWithContext(context.Background()) 5613} 5614 5615// NotDone returns true if the enumeration should be started or is not yet complete. 5616func (iter GalleryListIterator) NotDone() bool { 5617 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5618} 5619 5620// Response returns the raw server response from the last page request. 5621func (iter GalleryListIterator) Response() GalleryList { 5622 return iter.page.Response() 5623} 5624 5625// Value returns the current value or a zero-initialized value if the 5626// iterator has advanced beyond the end of the collection. 5627func (iter GalleryListIterator) Value() Gallery { 5628 if !iter.page.NotDone() { 5629 return Gallery{} 5630 } 5631 return iter.page.Values()[iter.i] 5632} 5633 5634// Creates a new instance of the GalleryListIterator type. 5635func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 5636 return GalleryListIterator{page: page} 5637} 5638 5639// IsEmpty returns true if the ListResult contains no values. 5640func (gl GalleryList) IsEmpty() bool { 5641 return gl.Value == nil || len(*gl.Value) == 0 5642} 5643 5644// hasNextLink returns true if the NextLink is not empty. 5645func (gl GalleryList) hasNextLink() bool { 5646 return gl.NextLink != nil && len(*gl.NextLink) != 0 5647} 5648 5649// galleryListPreparer prepares a request to retrieve the next set of results. 5650// It returns nil if no more results exist. 5651func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 5652 if !gl.hasNextLink() { 5653 return nil, nil 5654 } 5655 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5656 autorest.AsJSON(), 5657 autorest.AsGet(), 5658 autorest.WithBaseURL(to.String(gl.NextLink))) 5659} 5660 5661// GalleryListPage contains a page of Gallery values. 5662type GalleryListPage struct { 5663 fn func(context.Context, GalleryList) (GalleryList, error) 5664 gl GalleryList 5665} 5666 5667// NextWithContext advances to the next page of values. If there was an error making 5668// the request the page does not advance and the error is returned. 5669func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 5670 if tracing.IsEnabled() { 5671 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 5672 defer func() { 5673 sc := -1 5674 if page.Response().Response.Response != nil { 5675 sc = page.Response().Response.Response.StatusCode 5676 } 5677 tracing.EndSpan(ctx, sc, err) 5678 }() 5679 } 5680 for { 5681 next, err := page.fn(ctx, page.gl) 5682 if err != nil { 5683 return err 5684 } 5685 page.gl = next 5686 if !next.hasNextLink() || !next.IsEmpty() { 5687 break 5688 } 5689 } 5690 return nil 5691} 5692 5693// Next advances to the next page of values. If there was an error making 5694// the request the page does not advance and the error is returned. 5695// Deprecated: Use NextWithContext() instead. 5696func (page *GalleryListPage) Next() error { 5697 return page.NextWithContext(context.Background()) 5698} 5699 5700// NotDone returns true if the page enumeration should be started or is not yet complete. 5701func (page GalleryListPage) NotDone() bool { 5702 return !page.gl.IsEmpty() 5703} 5704 5705// Response returns the raw server response from the last page request. 5706func (page GalleryListPage) Response() GalleryList { 5707 return page.gl 5708} 5709 5710// Values returns the slice of values for the current page or nil if there are no values. 5711func (page GalleryListPage) Values() []Gallery { 5712 if page.gl.IsEmpty() { 5713 return nil 5714 } 5715 return *page.gl.Value 5716} 5717 5718// Creates a new instance of the GalleryListPage type. 5719func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 5720 return GalleryListPage{ 5721 fn: getNextPage, 5722 gl: cur, 5723 } 5724} 5725 5726// GalleryOSDiskImage this is the OS disk image. 5727type GalleryOSDiskImage struct { 5728 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 5729 SizeInGB *int32 `json:"sizeInGB,omitempty"` 5730 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 5731 HostCaching HostCaching `json:"hostCaching,omitempty"` 5732 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5733} 5734 5735// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 5736func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 5737 objectMap := make(map[string]interface{}) 5738 if godi.HostCaching != "" { 5739 objectMap["hostCaching"] = godi.HostCaching 5740 } 5741 if godi.Source != nil { 5742 objectMap["source"] = godi.Source 5743 } 5744 return json.Marshal(objectMap) 5745} 5746 5747// GalleryProperties describes the properties of a Shared Image Gallery. 5748type GalleryProperties struct { 5749 // Description - The description of this Shared Image Gallery resource. This property is updatable. 5750 Description *string `json:"description,omitempty"` 5751 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 5752 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 5753 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 5754} 5755 5756// MarshalJSON is the custom marshaler for GalleryProperties. 5757func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 5758 objectMap := make(map[string]interface{}) 5759 if gp.Description != nil { 5760 objectMap["description"] = gp.Description 5761 } 5762 if gp.Identifier != nil { 5763 objectMap["identifier"] = gp.Identifier 5764 } 5765 return json.Marshal(objectMap) 5766} 5767 5768// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 5769type GalleryUpdate struct { 5770 *GalleryProperties `json:"properties,omitempty"` 5771 // Tags - Resource tags 5772 Tags map[string]*string `json:"tags"` 5773} 5774 5775// MarshalJSON is the custom marshaler for GalleryUpdate. 5776func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 5777 objectMap := make(map[string]interface{}) 5778 if gu.GalleryProperties != nil { 5779 objectMap["properties"] = gu.GalleryProperties 5780 } 5781 if gu.Tags != nil { 5782 objectMap["tags"] = gu.Tags 5783 } 5784 return json.Marshal(objectMap) 5785} 5786 5787// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 5788func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 5789 var m map[string]*json.RawMessage 5790 err := json.Unmarshal(body, &m) 5791 if err != nil { 5792 return err 5793 } 5794 for k, v := range m { 5795 switch k { 5796 case "properties": 5797 if v != nil { 5798 var galleryProperties GalleryProperties 5799 err = json.Unmarshal(*v, &galleryProperties) 5800 if err != nil { 5801 return err 5802 } 5803 gu.GalleryProperties = &galleryProperties 5804 } 5805 case "tags": 5806 if v != nil { 5807 var tags map[string]*string 5808 err = json.Unmarshal(*v, &tags) 5809 if err != nil { 5810 return err 5811 } 5812 gu.Tags = tags 5813 } 5814 } 5815 } 5816 5817 return nil 5818} 5819 5820// GrantAccessData data used for requesting a SAS. 5821type GrantAccessData struct { 5822 // Access - Possible values include: 'None', 'Read', 'Write' 5823 Access AccessLevel `json:"access,omitempty"` 5824 // DurationInSeconds - Time duration in seconds until the SAS access expires. 5825 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 5826} 5827 5828// HardwareProfile specifies the hardware settings for the virtual machine. 5829type HardwareProfile struct { 5830 // 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' 5831 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 5832} 5833 5834// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 5835// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 5836// exist. 5837type Image struct { 5838 autorest.Response `json:"-"` 5839 *ImageProperties `json:"properties,omitempty"` 5840 // ID - READ-ONLY; Resource Id 5841 ID *string `json:"id,omitempty"` 5842 // Name - READ-ONLY; Resource name 5843 Name *string `json:"name,omitempty"` 5844 // Type - READ-ONLY; Resource type 5845 Type *string `json:"type,omitempty"` 5846 // Location - Resource location 5847 Location *string `json:"location,omitempty"` 5848 // Tags - Resource tags 5849 Tags map[string]*string `json:"tags"` 5850} 5851 5852// MarshalJSON is the custom marshaler for Image. 5853func (i Image) MarshalJSON() ([]byte, error) { 5854 objectMap := make(map[string]interface{}) 5855 if i.ImageProperties != nil { 5856 objectMap["properties"] = i.ImageProperties 5857 } 5858 if i.Location != nil { 5859 objectMap["location"] = i.Location 5860 } 5861 if i.Tags != nil { 5862 objectMap["tags"] = i.Tags 5863 } 5864 return json.Marshal(objectMap) 5865} 5866 5867// UnmarshalJSON is the custom unmarshaler for Image struct. 5868func (i *Image) UnmarshalJSON(body []byte) error { 5869 var m map[string]*json.RawMessage 5870 err := json.Unmarshal(body, &m) 5871 if err != nil { 5872 return err 5873 } 5874 for k, v := range m { 5875 switch k { 5876 case "properties": 5877 if v != nil { 5878 var imageProperties ImageProperties 5879 err = json.Unmarshal(*v, &imageProperties) 5880 if err != nil { 5881 return err 5882 } 5883 i.ImageProperties = &imageProperties 5884 } 5885 case "id": 5886 if v != nil { 5887 var ID string 5888 err = json.Unmarshal(*v, &ID) 5889 if err != nil { 5890 return err 5891 } 5892 i.ID = &ID 5893 } 5894 case "name": 5895 if v != nil { 5896 var name string 5897 err = json.Unmarshal(*v, &name) 5898 if err != nil { 5899 return err 5900 } 5901 i.Name = &name 5902 } 5903 case "type": 5904 if v != nil { 5905 var typeVar string 5906 err = json.Unmarshal(*v, &typeVar) 5907 if err != nil { 5908 return err 5909 } 5910 i.Type = &typeVar 5911 } 5912 case "location": 5913 if v != nil { 5914 var location string 5915 err = json.Unmarshal(*v, &location) 5916 if err != nil { 5917 return err 5918 } 5919 i.Location = &location 5920 } 5921 case "tags": 5922 if v != nil { 5923 var tags map[string]*string 5924 err = json.Unmarshal(*v, &tags) 5925 if err != nil { 5926 return err 5927 } 5928 i.Tags = tags 5929 } 5930 } 5931 } 5932 5933 return nil 5934} 5935 5936// ImageDataDisk describes a data disk. 5937type ImageDataDisk struct { 5938 // 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. 5939 Lun *int32 `json:"lun,omitempty"` 5940 // Snapshot - The snapshot. 5941 Snapshot *SubResource `json:"snapshot,omitempty"` 5942 // ManagedDisk - The managedDisk. 5943 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5944 // BlobURI - The Virtual Hard Disk. 5945 BlobURI *string `json:"blobUri,omitempty"` 5946 // 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' 5947 Caching CachingTypes `json:"caching,omitempty"` 5948 // 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 5949 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5950 // 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' 5951 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5952 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5953 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5954} 5955 5956// ImageDisk describes a image disk. 5957type ImageDisk struct { 5958 // Snapshot - The snapshot. 5959 Snapshot *SubResource `json:"snapshot,omitempty"` 5960 // ManagedDisk - The managedDisk. 5961 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5962 // BlobURI - The Virtual Hard Disk. 5963 BlobURI *string `json:"blobUri,omitempty"` 5964 // 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' 5965 Caching CachingTypes `json:"caching,omitempty"` 5966 // 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 5967 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5968 // 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' 5969 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5970 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5971 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5972} 5973 5974// ImageDiskReference the source image used for creating the disk. 5975type ImageDiskReference struct { 5976 // ID - A relative uri containing either a Platform Image Repository or user image reference. 5977 ID *string `json:"id,omitempty"` 5978 // 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. 5979 Lun *int32 `json:"lun,omitempty"` 5980} 5981 5982// ImageListResult the List Image operation response. 5983type ImageListResult struct { 5984 autorest.Response `json:"-"` 5985 // Value - The list of Images. 5986 Value *[]Image `json:"value,omitempty"` 5987 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 5988 NextLink *string `json:"nextLink,omitempty"` 5989} 5990 5991// ImageListResultIterator provides access to a complete listing of Image values. 5992type ImageListResultIterator struct { 5993 i int 5994 page ImageListResultPage 5995} 5996 5997// NextWithContext advances to the next value. If there was an error making 5998// the request the iterator does not advance and the error is returned. 5999func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 6000 if tracing.IsEnabled() { 6001 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 6002 defer func() { 6003 sc := -1 6004 if iter.Response().Response.Response != nil { 6005 sc = iter.Response().Response.Response.StatusCode 6006 } 6007 tracing.EndSpan(ctx, sc, err) 6008 }() 6009 } 6010 iter.i++ 6011 if iter.i < len(iter.page.Values()) { 6012 return nil 6013 } 6014 err = iter.page.NextWithContext(ctx) 6015 if err != nil { 6016 iter.i-- 6017 return err 6018 } 6019 iter.i = 0 6020 return nil 6021} 6022 6023// Next advances to the next value. If there was an error making 6024// the request the iterator does not advance and the error is returned. 6025// Deprecated: Use NextWithContext() instead. 6026func (iter *ImageListResultIterator) Next() error { 6027 return iter.NextWithContext(context.Background()) 6028} 6029 6030// NotDone returns true if the enumeration should be started or is not yet complete. 6031func (iter ImageListResultIterator) NotDone() bool { 6032 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6033} 6034 6035// Response returns the raw server response from the last page request. 6036func (iter ImageListResultIterator) Response() ImageListResult { 6037 return iter.page.Response() 6038} 6039 6040// Value returns the current value or a zero-initialized value if the 6041// iterator has advanced beyond the end of the collection. 6042func (iter ImageListResultIterator) Value() Image { 6043 if !iter.page.NotDone() { 6044 return Image{} 6045 } 6046 return iter.page.Values()[iter.i] 6047} 6048 6049// Creates a new instance of the ImageListResultIterator type. 6050func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 6051 return ImageListResultIterator{page: page} 6052} 6053 6054// IsEmpty returns true if the ListResult contains no values. 6055func (ilr ImageListResult) IsEmpty() bool { 6056 return ilr.Value == nil || len(*ilr.Value) == 0 6057} 6058 6059// hasNextLink returns true if the NextLink is not empty. 6060func (ilr ImageListResult) hasNextLink() bool { 6061 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 6062} 6063 6064// imageListResultPreparer prepares a request to retrieve the next set of results. 6065// It returns nil if no more results exist. 6066func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 6067 if !ilr.hasNextLink() { 6068 return nil, nil 6069 } 6070 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6071 autorest.AsJSON(), 6072 autorest.AsGet(), 6073 autorest.WithBaseURL(to.String(ilr.NextLink))) 6074} 6075 6076// ImageListResultPage contains a page of Image values. 6077type ImageListResultPage struct { 6078 fn func(context.Context, ImageListResult) (ImageListResult, error) 6079 ilr ImageListResult 6080} 6081 6082// NextWithContext advances to the next page of values. If there was an error making 6083// the request the page does not advance and the error is returned. 6084func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 6085 if tracing.IsEnabled() { 6086 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 6087 defer func() { 6088 sc := -1 6089 if page.Response().Response.Response != nil { 6090 sc = page.Response().Response.Response.StatusCode 6091 } 6092 tracing.EndSpan(ctx, sc, err) 6093 }() 6094 } 6095 for { 6096 next, err := page.fn(ctx, page.ilr) 6097 if err != nil { 6098 return err 6099 } 6100 page.ilr = next 6101 if !next.hasNextLink() || !next.IsEmpty() { 6102 break 6103 } 6104 } 6105 return nil 6106} 6107 6108// Next advances to the next page of values. If there was an error making 6109// the request the page does not advance and the error is returned. 6110// Deprecated: Use NextWithContext() instead. 6111func (page *ImageListResultPage) Next() error { 6112 return page.NextWithContext(context.Background()) 6113} 6114 6115// NotDone returns true if the page enumeration should be started or is not yet complete. 6116func (page ImageListResultPage) NotDone() bool { 6117 return !page.ilr.IsEmpty() 6118} 6119 6120// Response returns the raw server response from the last page request. 6121func (page ImageListResultPage) Response() ImageListResult { 6122 return page.ilr 6123} 6124 6125// Values returns the slice of values for the current page or nil if there are no values. 6126func (page ImageListResultPage) Values() []Image { 6127 if page.ilr.IsEmpty() { 6128 return nil 6129 } 6130 return *page.ilr.Value 6131} 6132 6133// Creates a new instance of the ImageListResultPage type. 6134func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 6135 return ImageListResultPage{ 6136 fn: getNextPage, 6137 ilr: cur, 6138 } 6139} 6140 6141// ImageOSDisk describes an Operating System disk. 6142type ImageOSDisk struct { 6143 // 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' 6144 OsType OperatingSystemTypes `json:"osType,omitempty"` 6145 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 6146 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 6147 // Snapshot - The snapshot. 6148 Snapshot *SubResource `json:"snapshot,omitempty"` 6149 // ManagedDisk - The managedDisk. 6150 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 6151 // BlobURI - The Virtual Hard Disk. 6152 BlobURI *string `json:"blobUri,omitempty"` 6153 // 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' 6154 Caching CachingTypes `json:"caching,omitempty"` 6155 // 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 6156 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6157 // 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' 6158 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6159 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 6160 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6161} 6162 6163// ImageProperties describes the properties of an Image. 6164type ImageProperties struct { 6165 // SourceVirtualMachine - The source virtual machine from which Image is created. 6166 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 6167 // StorageProfile - Specifies the storage settings for the virtual machine disks. 6168 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 6169 // ProvisioningState - READ-ONLY; The provisioning state. 6170 ProvisioningState *string `json:"provisioningState,omitempty"` 6171 // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 6172 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 6173} 6174 6175// MarshalJSON is the custom marshaler for ImageProperties. 6176func (IP ImageProperties) MarshalJSON() ([]byte, error) { 6177 objectMap := make(map[string]interface{}) 6178 if IP.SourceVirtualMachine != nil { 6179 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 6180 } 6181 if IP.StorageProfile != nil { 6182 objectMap["storageProfile"] = IP.StorageProfile 6183 } 6184 if IP.HyperVGeneration != "" { 6185 objectMap["hyperVGeneration"] = IP.HyperVGeneration 6186 } 6187 return json.Marshal(objectMap) 6188} 6189 6190// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace 6191// images. 6192type ImagePurchasePlan struct { 6193 // Name - The plan ID. 6194 Name *string `json:"name,omitempty"` 6195 // Publisher - The publisher ID. 6196 Publisher *string `json:"publisher,omitempty"` 6197 // Product - The product ID. 6198 Product *string `json:"product,omitempty"` 6199} 6200 6201// ImageReference specifies information about the image to use. You can specify information about platform 6202// images, marketplace images, or virtual machine images. This element is required when you want to use a 6203// platform image, marketplace image, or virtual machine image, but is not used in other creation 6204// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set 6205type ImageReference struct { 6206 // Publisher - The image publisher. 6207 Publisher *string `json:"publisher,omitempty"` 6208 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 6209 Offer *string `json:"offer,omitempty"` 6210 // Sku - The image SKU. 6211 Sku *string `json:"sku,omitempty"` 6212 // 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. 6213 Version *string `json:"version,omitempty"` 6214 // ExactVersion - READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. 6215 ExactVersion *string `json:"exactVersion,omitempty"` 6216 // ID - Resource Id 6217 ID *string `json:"id,omitempty"` 6218} 6219 6220// MarshalJSON is the custom marshaler for ImageReference. 6221func (ir ImageReference) MarshalJSON() ([]byte, error) { 6222 objectMap := make(map[string]interface{}) 6223 if ir.Publisher != nil { 6224 objectMap["publisher"] = ir.Publisher 6225 } 6226 if ir.Offer != nil { 6227 objectMap["offer"] = ir.Offer 6228 } 6229 if ir.Sku != nil { 6230 objectMap["sku"] = ir.Sku 6231 } 6232 if ir.Version != nil { 6233 objectMap["version"] = ir.Version 6234 } 6235 if ir.ID != nil { 6236 objectMap["id"] = ir.ID 6237 } 6238 return json.Marshal(objectMap) 6239} 6240 6241// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6242// operation. 6243type ImagesCreateOrUpdateFuture struct { 6244 azure.FutureAPI 6245 // Result returns the result of the asynchronous operation. 6246 // If the operation has not completed it will return an error. 6247 Result func(ImagesClient) (Image, error) 6248} 6249 6250// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6251func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6252 var azFuture azure.Future 6253 if err := json.Unmarshal(body, &azFuture); err != nil { 6254 return err 6255 } 6256 future.FutureAPI = &azFuture 6257 future.Result = future.result 6258 return nil 6259} 6260 6261// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 6262func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 6263 var done bool 6264 done, err = future.DoneWithContext(context.Background(), client) 6265 if err != nil { 6266 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6267 return 6268 } 6269 if !done { 6270 i.Response.Response = future.Response() 6271 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 6272 return 6273 } 6274 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6275 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 6276 i, err = client.CreateOrUpdateResponder(i.Response.Response) 6277 if err != nil { 6278 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 6279 } 6280 } 6281 return 6282} 6283 6284// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 6285type ImagesDeleteFuture struct { 6286 azure.FutureAPI 6287 // Result returns the result of the asynchronous operation. 6288 // If the operation has not completed it will return an error. 6289 Result func(ImagesClient) (autorest.Response, error) 6290} 6291 6292// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6293func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 6294 var azFuture azure.Future 6295 if err := json.Unmarshal(body, &azFuture); err != nil { 6296 return err 6297 } 6298 future.FutureAPI = &azFuture 6299 future.Result = future.result 6300 return nil 6301} 6302 6303// result is the default implementation for ImagesDeleteFuture.Result. 6304func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 6305 var done bool 6306 done, err = future.DoneWithContext(context.Background(), client) 6307 if err != nil { 6308 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 6309 return 6310 } 6311 if !done { 6312 ar.Response = future.Response() 6313 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 6314 return 6315 } 6316 ar.Response = future.Response() 6317 return 6318} 6319 6320// ImageStorageProfile describes a storage profile. 6321type ImageStorageProfile struct { 6322 // 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). 6323 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 6324 // 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). 6325 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 6326 // 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). 6327 ZoneResilient *bool `json:"zoneResilient,omitempty"` 6328} 6329 6330// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 6331type ImagesUpdateFuture struct { 6332 azure.FutureAPI 6333 // Result returns the result of the asynchronous operation. 6334 // If the operation has not completed it will return an error. 6335 Result func(ImagesClient) (Image, error) 6336} 6337 6338// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6339func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 6340 var azFuture azure.Future 6341 if err := json.Unmarshal(body, &azFuture); err != nil { 6342 return err 6343 } 6344 future.FutureAPI = &azFuture 6345 future.Result = future.result 6346 return nil 6347} 6348 6349// result is the default implementation for ImagesUpdateFuture.Result. 6350func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 6351 var done bool 6352 done, err = future.DoneWithContext(context.Background(), client) 6353 if err != nil { 6354 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 6355 return 6356 } 6357 if !done { 6358 i.Response.Response = future.Response() 6359 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 6360 return 6361 } 6362 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6363 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 6364 i, err = client.UpdateResponder(i.Response.Response) 6365 if err != nil { 6366 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 6367 } 6368 } 6369 return 6370} 6371 6372// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 6373type ImageUpdate struct { 6374 *ImageProperties `json:"properties,omitempty"` 6375 // Tags - Resource tags 6376 Tags map[string]*string `json:"tags"` 6377} 6378 6379// MarshalJSON is the custom marshaler for ImageUpdate. 6380func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 6381 objectMap := make(map[string]interface{}) 6382 if iu.ImageProperties != nil { 6383 objectMap["properties"] = iu.ImageProperties 6384 } 6385 if iu.Tags != nil { 6386 objectMap["tags"] = iu.Tags 6387 } 6388 return json.Marshal(objectMap) 6389} 6390 6391// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 6392func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 6393 var m map[string]*json.RawMessage 6394 err := json.Unmarshal(body, &m) 6395 if err != nil { 6396 return err 6397 } 6398 for k, v := range m { 6399 switch k { 6400 case "properties": 6401 if v != nil { 6402 var imageProperties ImageProperties 6403 err = json.Unmarshal(*v, &imageProperties) 6404 if err != nil { 6405 return err 6406 } 6407 iu.ImageProperties = &imageProperties 6408 } 6409 case "tags": 6410 if v != nil { 6411 var tags map[string]*string 6412 err = json.Unmarshal(*v, &tags) 6413 if err != nil { 6414 return err 6415 } 6416 iu.Tags = tags 6417 } 6418 } 6419 } 6420 6421 return nil 6422} 6423 6424// InnerError inner error details. 6425type InnerError struct { 6426 // Exceptiontype - The exception type. 6427 Exceptiontype *string `json:"exceptiontype,omitempty"` 6428 // Errordetail - The internal error message or exception dump. 6429 Errordetail *string `json:"errordetail,omitempty"` 6430} 6431 6432// InstanceViewStatus instance view status. 6433type InstanceViewStatus struct { 6434 // Code - The status code. 6435 Code *string `json:"code,omitempty"` 6436 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 6437 Level StatusLevelTypes `json:"level,omitempty"` 6438 // DisplayStatus - The short localizable label for the status. 6439 DisplayStatus *string `json:"displayStatus,omitempty"` 6440 // Message - The detailed status message, including for alerts and error messages. 6441 Message *string `json:"message,omitempty"` 6442 // Time - The time of the status. 6443 Time *date.Time `json:"time,omitempty"` 6444} 6445 6446// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 6447// to unwrap the encryptionKey 6448type KeyVaultAndKeyReference struct { 6449 // SourceVault - Resource id of the KeyVault containing the key or secret 6450 SourceVault *SourceVault `json:"sourceVault,omitempty"` 6451 // KeyURL - Url pointing to a key or secret in KeyVault 6452 KeyURL *string `json:"keyUrl,omitempty"` 6453} 6454 6455// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 6456type KeyVaultAndSecretReference struct { 6457 // SourceVault - Resource id of the KeyVault containing the key or secret 6458 SourceVault *SourceVault `json:"sourceVault,omitempty"` 6459 // SecretURL - Url pointing to a key or secret in KeyVault 6460 SecretURL *string `json:"secretUrl,omitempty"` 6461} 6462 6463// KeyVaultKeyReference describes a reference to Key Vault Key 6464type KeyVaultKeyReference struct { 6465 // KeyURL - The URL referencing a key encryption key in Key Vault. 6466 KeyURL *string `json:"keyUrl,omitempty"` 6467 // SourceVault - The relative URL of the Key Vault containing the key. 6468 SourceVault *SubResource `json:"sourceVault,omitempty"` 6469} 6470 6471// KeyVaultSecretReference describes a reference to Key Vault Secret 6472type KeyVaultSecretReference struct { 6473 // SecretURL - The URL referencing a secret in a Key Vault. 6474 SecretURL *string `json:"secretUrl,omitempty"` 6475 // SourceVault - The relative URL of the Key Vault containing the secret. 6476 SourceVault *SubResource `json:"sourceVault,omitempty"` 6477} 6478 6479// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 6480// list of supported Linux distributions, see [Linux on Azure-Endorsed 6481// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 6482// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 6483// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 6484type LinuxConfiguration struct { 6485 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 6486 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 6487 // SSH - Specifies the ssh key configuration for a Linux OS. 6488 SSH *SSHConfiguration `json:"ssh,omitempty"` 6489 // 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. 6490 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 6491} 6492 6493// ListUsagesResult the List Usages operation response. 6494type ListUsagesResult struct { 6495 autorest.Response `json:"-"` 6496 // Value - The list of compute resource usages. 6497 Value *[]Usage `json:"value,omitempty"` 6498 // 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. 6499 NextLink *string `json:"nextLink,omitempty"` 6500} 6501 6502// ListUsagesResultIterator provides access to a complete listing of Usage values. 6503type ListUsagesResultIterator struct { 6504 i int 6505 page ListUsagesResultPage 6506} 6507 6508// NextWithContext advances to the next value. If there was an error making 6509// the request the iterator does not advance and the error is returned. 6510func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 6511 if tracing.IsEnabled() { 6512 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 6513 defer func() { 6514 sc := -1 6515 if iter.Response().Response.Response != nil { 6516 sc = iter.Response().Response.Response.StatusCode 6517 } 6518 tracing.EndSpan(ctx, sc, err) 6519 }() 6520 } 6521 iter.i++ 6522 if iter.i < len(iter.page.Values()) { 6523 return nil 6524 } 6525 err = iter.page.NextWithContext(ctx) 6526 if err != nil { 6527 iter.i-- 6528 return err 6529 } 6530 iter.i = 0 6531 return nil 6532} 6533 6534// Next advances to the next value. If there was an error making 6535// the request the iterator does not advance and the error is returned. 6536// Deprecated: Use NextWithContext() instead. 6537func (iter *ListUsagesResultIterator) Next() error { 6538 return iter.NextWithContext(context.Background()) 6539} 6540 6541// NotDone returns true if the enumeration should be started or is not yet complete. 6542func (iter ListUsagesResultIterator) NotDone() bool { 6543 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6544} 6545 6546// Response returns the raw server response from the last page request. 6547func (iter ListUsagesResultIterator) Response() ListUsagesResult { 6548 return iter.page.Response() 6549} 6550 6551// Value returns the current value or a zero-initialized value if the 6552// iterator has advanced beyond the end of the collection. 6553func (iter ListUsagesResultIterator) Value() Usage { 6554 if !iter.page.NotDone() { 6555 return Usage{} 6556 } 6557 return iter.page.Values()[iter.i] 6558} 6559 6560// Creates a new instance of the ListUsagesResultIterator type. 6561func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 6562 return ListUsagesResultIterator{page: page} 6563} 6564 6565// IsEmpty returns true if the ListResult contains no values. 6566func (lur ListUsagesResult) IsEmpty() bool { 6567 return lur.Value == nil || len(*lur.Value) == 0 6568} 6569 6570// hasNextLink returns true if the NextLink is not empty. 6571func (lur ListUsagesResult) hasNextLink() bool { 6572 return lur.NextLink != nil && len(*lur.NextLink) != 0 6573} 6574 6575// listUsagesResultPreparer prepares a request to retrieve the next set of results. 6576// It returns nil if no more results exist. 6577func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 6578 if !lur.hasNextLink() { 6579 return nil, nil 6580 } 6581 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6582 autorest.AsJSON(), 6583 autorest.AsGet(), 6584 autorest.WithBaseURL(to.String(lur.NextLink))) 6585} 6586 6587// ListUsagesResultPage contains a page of Usage values. 6588type ListUsagesResultPage struct { 6589 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 6590 lur ListUsagesResult 6591} 6592 6593// NextWithContext advances to the next page of values. If there was an error making 6594// the request the page does not advance and the error is returned. 6595func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 6596 if tracing.IsEnabled() { 6597 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 6598 defer func() { 6599 sc := -1 6600 if page.Response().Response.Response != nil { 6601 sc = page.Response().Response.Response.StatusCode 6602 } 6603 tracing.EndSpan(ctx, sc, err) 6604 }() 6605 } 6606 for { 6607 next, err := page.fn(ctx, page.lur) 6608 if err != nil { 6609 return err 6610 } 6611 page.lur = next 6612 if !next.hasNextLink() || !next.IsEmpty() { 6613 break 6614 } 6615 } 6616 return nil 6617} 6618 6619// Next advances to the next page of values. If there was an error making 6620// the request the page does not advance and the error is returned. 6621// Deprecated: Use NextWithContext() instead. 6622func (page *ListUsagesResultPage) Next() error { 6623 return page.NextWithContext(context.Background()) 6624} 6625 6626// NotDone returns true if the page enumeration should be started or is not yet complete. 6627func (page ListUsagesResultPage) NotDone() bool { 6628 return !page.lur.IsEmpty() 6629} 6630 6631// Response returns the raw server response from the last page request. 6632func (page ListUsagesResultPage) Response() ListUsagesResult { 6633 return page.lur 6634} 6635 6636// Values returns the slice of values for the current page or nil if there are no values. 6637func (page ListUsagesResultPage) Values() []Usage { 6638 if page.lur.IsEmpty() { 6639 return nil 6640 } 6641 return *page.lur.Value 6642} 6643 6644// Creates a new instance of the ListUsagesResultPage type. 6645func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 6646 return ListUsagesResultPage{ 6647 fn: getNextPage, 6648 lur: cur, 6649 } 6650} 6651 6652// ListVirtualMachineExtensionImage ... 6653type ListVirtualMachineExtensionImage struct { 6654 autorest.Response `json:"-"` 6655 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 6656} 6657 6658// ListVirtualMachineImageResource ... 6659type ListVirtualMachineImageResource struct { 6660 autorest.Response `json:"-"` 6661 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 6662} 6663 6664// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 6665// of a long-running operation. 6666type LogAnalyticsExportRequestRateByIntervalFuture struct { 6667 azure.FutureAPI 6668 // Result returns the result of the asynchronous operation. 6669 // If the operation has not completed it will return an error. 6670 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 6671} 6672 6673// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6674func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 6675 var azFuture azure.Future 6676 if err := json.Unmarshal(body, &azFuture); err != nil { 6677 return err 6678 } 6679 future.FutureAPI = &azFuture 6680 future.Result = future.result 6681 return nil 6682} 6683 6684// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 6685func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 6686 var done bool 6687 done, err = future.DoneWithContext(context.Background(), client) 6688 if err != nil { 6689 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 6690 return 6691 } 6692 if !done { 6693 laor.Response.Response = future.Response() 6694 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 6695 return 6696 } 6697 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6698 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 6699 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 6700 if err != nil { 6701 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 6702 } 6703 } 6704 return 6705} 6706 6707// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 6708// long-running operation. 6709type LogAnalyticsExportThrottledRequestsFuture struct { 6710 azure.FutureAPI 6711 // Result returns the result of the asynchronous operation. 6712 // If the operation has not completed it will return an error. 6713 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 6714} 6715 6716// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6717func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 6718 var azFuture azure.Future 6719 if err := json.Unmarshal(body, &azFuture); err != nil { 6720 return err 6721 } 6722 future.FutureAPI = &azFuture 6723 future.Result = future.result 6724 return nil 6725} 6726 6727// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 6728func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 6729 var done bool 6730 done, err = future.DoneWithContext(context.Background(), client) 6731 if err != nil { 6732 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 6733 return 6734 } 6735 if !done { 6736 laor.Response.Response = future.Response() 6737 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 6738 return 6739 } 6740 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6741 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 6742 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 6743 if err != nil { 6744 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 6745 } 6746 } 6747 return 6748} 6749 6750// LogAnalyticsInputBase api input base class for LogAnalytics Api. 6751type LogAnalyticsInputBase struct { 6752 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 6753 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 6754 // FromTime - From time of the query 6755 FromTime *date.Time `json:"fromTime,omitempty"` 6756 // ToTime - To time of the query 6757 ToTime *date.Time `json:"toTime,omitempty"` 6758 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 6759 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 6760 // GroupByOperationName - Group query result by Operation Name. 6761 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 6762 // GroupByResourceName - Group query result by Resource Name. 6763 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 6764} 6765 6766// LogAnalyticsOperationResult logAnalytics operation status response 6767type LogAnalyticsOperationResult struct { 6768 autorest.Response `json:"-"` 6769 // Properties - READ-ONLY; LogAnalyticsOutput 6770 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 6771} 6772 6773// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. 6774func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { 6775 objectMap := make(map[string]interface{}) 6776 return json.Marshal(objectMap) 6777} 6778 6779// LogAnalyticsOutput logAnalytics output properties 6780type LogAnalyticsOutput struct { 6781 // Output - READ-ONLY; Output file Uri path to blob container. 6782 Output *string `json:"output,omitempty"` 6783} 6784 6785// MarshalJSON is the custom marshaler for LogAnalyticsOutput. 6786func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { 6787 objectMap := make(map[string]interface{}) 6788 return json.Marshal(objectMap) 6789} 6790 6791// MaintenanceRedeployStatus maintenance Operation Status. 6792type MaintenanceRedeployStatus struct { 6793 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 6794 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 6795 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 6796 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 6797 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 6798 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 6799 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 6800 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 6801 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 6802 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 6803 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 6804 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 6805 // LastOperationMessage - Message returned for the last Maintenance Operation. 6806 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 6807} 6808 6809// ManagedArtifact the managed artifact. 6810type ManagedArtifact struct { 6811 // ID - The managed artifact id. 6812 ID *string `json:"id,omitempty"` 6813} 6814 6815// ManagedDiskParameters the parameters of a managed disk. 6816type ManagedDiskParameters struct { 6817 // 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' 6818 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6819 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 6820 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6821 // ID - Resource Id 6822 ID *string `json:"id,omitempty"` 6823} 6824 6825// NetworkInterfaceReference describes a network interface reference. 6826type NetworkInterfaceReference struct { 6827 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 6828 // ID - Resource Id 6829 ID *string `json:"id,omitempty"` 6830} 6831 6832// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 6833func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 6834 objectMap := make(map[string]interface{}) 6835 if nir.NetworkInterfaceReferenceProperties != nil { 6836 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 6837 } 6838 if nir.ID != nil { 6839 objectMap["id"] = nir.ID 6840 } 6841 return json.Marshal(objectMap) 6842} 6843 6844// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 6845func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 6846 var m map[string]*json.RawMessage 6847 err := json.Unmarshal(body, &m) 6848 if err != nil { 6849 return err 6850 } 6851 for k, v := range m { 6852 switch k { 6853 case "properties": 6854 if v != nil { 6855 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 6856 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 6857 if err != nil { 6858 return err 6859 } 6860 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 6861 } 6862 case "id": 6863 if v != nil { 6864 var ID string 6865 err = json.Unmarshal(*v, &ID) 6866 if err != nil { 6867 return err 6868 } 6869 nir.ID = &ID 6870 } 6871 } 6872 } 6873 6874 return nil 6875} 6876 6877// NetworkInterfaceReferenceProperties describes a network interface reference properties. 6878type NetworkInterfaceReferenceProperties struct { 6879 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 6880 Primary *bool `json:"primary,omitempty"` 6881} 6882 6883// NetworkProfile specifies the network interfaces of the virtual machine. 6884type NetworkProfile struct { 6885 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 6886 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 6887} 6888 6889// OperationListResult the List Compute Operation operation response. 6890type OperationListResult struct { 6891 autorest.Response `json:"-"` 6892 // Value - READ-ONLY; The list of compute operations 6893 Value *[]OperationValue `json:"value,omitempty"` 6894} 6895 6896// MarshalJSON is the custom marshaler for OperationListResult. 6897func (olr OperationListResult) MarshalJSON() ([]byte, error) { 6898 objectMap := make(map[string]interface{}) 6899 return json.Marshal(objectMap) 6900} 6901 6902// OperationValue describes the properties of a Compute Operation value. 6903type OperationValue struct { 6904 // Origin - READ-ONLY; The origin of the compute operation. 6905 Origin *string `json:"origin,omitempty"` 6906 // Name - READ-ONLY; The name of the compute operation. 6907 Name *string `json:"name,omitempty"` 6908 *OperationValueDisplay `json:"display,omitempty"` 6909} 6910 6911// MarshalJSON is the custom marshaler for OperationValue. 6912func (ov OperationValue) MarshalJSON() ([]byte, error) { 6913 objectMap := make(map[string]interface{}) 6914 if ov.OperationValueDisplay != nil { 6915 objectMap["display"] = ov.OperationValueDisplay 6916 } 6917 return json.Marshal(objectMap) 6918} 6919 6920// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 6921func (ov *OperationValue) UnmarshalJSON(body []byte) error { 6922 var m map[string]*json.RawMessage 6923 err := json.Unmarshal(body, &m) 6924 if err != nil { 6925 return err 6926 } 6927 for k, v := range m { 6928 switch k { 6929 case "origin": 6930 if v != nil { 6931 var origin string 6932 err = json.Unmarshal(*v, &origin) 6933 if err != nil { 6934 return err 6935 } 6936 ov.Origin = &origin 6937 } 6938 case "name": 6939 if v != nil { 6940 var name string 6941 err = json.Unmarshal(*v, &name) 6942 if err != nil { 6943 return err 6944 } 6945 ov.Name = &name 6946 } 6947 case "display": 6948 if v != nil { 6949 var operationValueDisplay OperationValueDisplay 6950 err = json.Unmarshal(*v, &operationValueDisplay) 6951 if err != nil { 6952 return err 6953 } 6954 ov.OperationValueDisplay = &operationValueDisplay 6955 } 6956 } 6957 } 6958 6959 return nil 6960} 6961 6962// OperationValueDisplay describes the properties of a Compute Operation Value Display. 6963type OperationValueDisplay struct { 6964 // Operation - READ-ONLY; The display name of the compute operation. 6965 Operation *string `json:"operation,omitempty"` 6966 // Resource - READ-ONLY; The display name of the resource the operation applies to. 6967 Resource *string `json:"resource,omitempty"` 6968 // Description - READ-ONLY; The description of the operation. 6969 Description *string `json:"description,omitempty"` 6970 // Provider - READ-ONLY; The resource provider for the operation. 6971 Provider *string `json:"provider,omitempty"` 6972} 6973 6974// MarshalJSON is the custom marshaler for OperationValueDisplay. 6975func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 6976 objectMap := make(map[string]interface{}) 6977 return json.Marshal(objectMap) 6978} 6979 6980// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 6981// more information about disks, see [About disks and VHDs for Azure virtual 6982// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 6983type OSDisk struct { 6984 // 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' 6985 OsType OperatingSystemTypes `json:"osType,omitempty"` 6986 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 6987 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 6988 // Name - The disk name. 6989 Name *string `json:"name,omitempty"` 6990 // Vhd - The virtual hard disk. 6991 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 6992 // 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. 6993 Image *VirtualHardDisk `json:"image,omitempty"` 6994 // 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' 6995 Caching CachingTypes `json:"caching,omitempty"` 6996 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 6997 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 6998 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 6999 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 7000 // 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' 7001 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 7002 // 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 7003 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7004 // ManagedDisk - The managed disk parameters. 7005 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 7006} 7007 7008// OSDiskImage contains the os disk image information. 7009type OSDiskImage struct { 7010 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 7011 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 7012} 7013 7014// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 7015// be changed once VM is provisioned. 7016type OSProfile struct { 7017 // 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). 7018 ComputerName *string `json:"computerName,omitempty"` 7019 // AdminUsername - Specifies the name of the administrator account. <br><br> This property cannot be updated after the VM is created. <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) 7020 AdminUsername *string `json:"adminUsername,omitempty"` 7021 // 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) 7022 AdminPassword *string `json:"adminPassword,omitempty"` 7023 // 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> **Note: Do not pass any secrets or passwords in customData property** <br><br> This property cannot be updated after the VM is created. <br><br> customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://docs.microsoft.com/azure/virtual-machines/custom-data) <br><br> For using cloud-init for your Linux 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) 7024 CustomData *string `json:"customData,omitempty"` 7025 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 7026 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 7027 // 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). 7028 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 7029 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 7030 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 7031 // 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. 7032 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 7033 // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. 7034 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 7035} 7036 7037// Plan specifies information about the marketplace image used to create the virtual machine. This element 7038// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 7039// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 7040// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 7041// then click **Save**. 7042type Plan struct { 7043 // Name - The plan ID. 7044 Name *string `json:"name,omitempty"` 7045 // Publisher - The publisher ID. 7046 Publisher *string `json:"publisher,omitempty"` 7047 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 7048 Product *string `json:"product,omitempty"` 7049 // PromotionCode - The promotion code. 7050 PromotionCode *string `json:"promotionCode,omitempty"` 7051} 7052 7053// ProximityPlacementGroup specifies information about the proximity placement group. 7054type ProximityPlacementGroup struct { 7055 autorest.Response `json:"-"` 7056 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 7057 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 7058 // ID - READ-ONLY; Resource Id 7059 ID *string `json:"id,omitempty"` 7060 // Name - READ-ONLY; Resource name 7061 Name *string `json:"name,omitempty"` 7062 // Type - READ-ONLY; Resource type 7063 Type *string `json:"type,omitempty"` 7064 // Location - Resource location 7065 Location *string `json:"location,omitempty"` 7066 // Tags - Resource tags 7067 Tags map[string]*string `json:"tags"` 7068} 7069 7070// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 7071func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 7072 objectMap := make(map[string]interface{}) 7073 if ppg.ProximityPlacementGroupProperties != nil { 7074 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 7075 } 7076 if ppg.Location != nil { 7077 objectMap["location"] = ppg.Location 7078 } 7079 if ppg.Tags != nil { 7080 objectMap["tags"] = ppg.Tags 7081 } 7082 return json.Marshal(objectMap) 7083} 7084 7085// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 7086func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 7087 var m map[string]*json.RawMessage 7088 err := json.Unmarshal(body, &m) 7089 if err != nil { 7090 return err 7091 } 7092 for k, v := range m { 7093 switch k { 7094 case "properties": 7095 if v != nil { 7096 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 7097 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 7098 if err != nil { 7099 return err 7100 } 7101 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 7102 } 7103 case "id": 7104 if v != nil { 7105 var ID string 7106 err = json.Unmarshal(*v, &ID) 7107 if err != nil { 7108 return err 7109 } 7110 ppg.ID = &ID 7111 } 7112 case "name": 7113 if v != nil { 7114 var name string 7115 err = json.Unmarshal(*v, &name) 7116 if err != nil { 7117 return err 7118 } 7119 ppg.Name = &name 7120 } 7121 case "type": 7122 if v != nil { 7123 var typeVar string 7124 err = json.Unmarshal(*v, &typeVar) 7125 if err != nil { 7126 return err 7127 } 7128 ppg.Type = &typeVar 7129 } 7130 case "location": 7131 if v != nil { 7132 var location string 7133 err = json.Unmarshal(*v, &location) 7134 if err != nil { 7135 return err 7136 } 7137 ppg.Location = &location 7138 } 7139 case "tags": 7140 if v != nil { 7141 var tags map[string]*string 7142 err = json.Unmarshal(*v, &tags) 7143 if err != nil { 7144 return err 7145 } 7146 ppg.Tags = tags 7147 } 7148 } 7149 } 7150 7151 return nil 7152} 7153 7154// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 7155type ProximityPlacementGroupListResult struct { 7156 autorest.Response `json:"-"` 7157 // Value - The list of proximity placement groups 7158 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 7159 // NextLink - The URI to fetch the next page of proximity placement groups. 7160 NextLink *string `json:"nextLink,omitempty"` 7161} 7162 7163// ProximityPlacementGroupListResultIterator provides access to a complete listing of 7164// ProximityPlacementGroup values. 7165type ProximityPlacementGroupListResultIterator struct { 7166 i int 7167 page ProximityPlacementGroupListResultPage 7168} 7169 7170// NextWithContext advances to the next value. If there was an error making 7171// the request the iterator does not advance and the error is returned. 7172func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 7173 if tracing.IsEnabled() { 7174 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 7175 defer func() { 7176 sc := -1 7177 if iter.Response().Response.Response != nil { 7178 sc = iter.Response().Response.Response.StatusCode 7179 } 7180 tracing.EndSpan(ctx, sc, err) 7181 }() 7182 } 7183 iter.i++ 7184 if iter.i < len(iter.page.Values()) { 7185 return nil 7186 } 7187 err = iter.page.NextWithContext(ctx) 7188 if err != nil { 7189 iter.i-- 7190 return err 7191 } 7192 iter.i = 0 7193 return nil 7194} 7195 7196// Next advances to the next value. If there was an error making 7197// the request the iterator does not advance and the error is returned. 7198// Deprecated: Use NextWithContext() instead. 7199func (iter *ProximityPlacementGroupListResultIterator) Next() error { 7200 return iter.NextWithContext(context.Background()) 7201} 7202 7203// NotDone returns true if the enumeration should be started or is not yet complete. 7204func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 7205 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7206} 7207 7208// Response returns the raw server response from the last page request. 7209func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 7210 return iter.page.Response() 7211} 7212 7213// Value returns the current value or a zero-initialized value if the 7214// iterator has advanced beyond the end of the collection. 7215func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 7216 if !iter.page.NotDone() { 7217 return ProximityPlacementGroup{} 7218 } 7219 return iter.page.Values()[iter.i] 7220} 7221 7222// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 7223func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 7224 return ProximityPlacementGroupListResultIterator{page: page} 7225} 7226 7227// IsEmpty returns true if the ListResult contains no values. 7228func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 7229 return ppglr.Value == nil || len(*ppglr.Value) == 0 7230} 7231 7232// hasNextLink returns true if the NextLink is not empty. 7233func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 7234 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 7235} 7236 7237// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 7238// It returns nil if no more results exist. 7239func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 7240 if !ppglr.hasNextLink() { 7241 return nil, nil 7242 } 7243 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7244 autorest.AsJSON(), 7245 autorest.AsGet(), 7246 autorest.WithBaseURL(to.String(ppglr.NextLink))) 7247} 7248 7249// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 7250type ProximityPlacementGroupListResultPage struct { 7251 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 7252 ppglr ProximityPlacementGroupListResult 7253} 7254 7255// NextWithContext advances to the next page of values. If there was an error making 7256// the request the page does not advance and the error is returned. 7257func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 7258 if tracing.IsEnabled() { 7259 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 7260 defer func() { 7261 sc := -1 7262 if page.Response().Response.Response != nil { 7263 sc = page.Response().Response.Response.StatusCode 7264 } 7265 tracing.EndSpan(ctx, sc, err) 7266 }() 7267 } 7268 for { 7269 next, err := page.fn(ctx, page.ppglr) 7270 if err != nil { 7271 return err 7272 } 7273 page.ppglr = next 7274 if !next.hasNextLink() || !next.IsEmpty() { 7275 break 7276 } 7277 } 7278 return nil 7279} 7280 7281// Next advances to the next page of values. If there was an error making 7282// the request the page does not advance and the error is returned. 7283// Deprecated: Use NextWithContext() instead. 7284func (page *ProximityPlacementGroupListResultPage) Next() error { 7285 return page.NextWithContext(context.Background()) 7286} 7287 7288// NotDone returns true if the page enumeration should be started or is not yet complete. 7289func (page ProximityPlacementGroupListResultPage) NotDone() bool { 7290 return !page.ppglr.IsEmpty() 7291} 7292 7293// Response returns the raw server response from the last page request. 7294func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 7295 return page.ppglr 7296} 7297 7298// Values returns the slice of values for the current page or nil if there are no values. 7299func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 7300 if page.ppglr.IsEmpty() { 7301 return nil 7302 } 7303 return *page.ppglr.Value 7304} 7305 7306// Creates a new instance of the ProximityPlacementGroupListResultPage type. 7307func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 7308 return ProximityPlacementGroupListResultPage{ 7309 fn: getNextPage, 7310 ppglr: cur, 7311 } 7312} 7313 7314// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 7315type ProximityPlacementGroupProperties struct { 7316 // 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' 7317 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 7318 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 7319 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 7320 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 7321 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 7322 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 7323 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 7324 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 7325 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 7326} 7327 7328// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 7329func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 7330 objectMap := make(map[string]interface{}) 7331 if ppgp.ProximityPlacementGroupType != "" { 7332 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 7333 } 7334 if ppgp.ColocationStatus != nil { 7335 objectMap["colocationStatus"] = ppgp.ColocationStatus 7336 } 7337 return json.Marshal(objectMap) 7338} 7339 7340// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 7341type ProximityPlacementGroupUpdate struct { 7342 // Tags - Resource tags 7343 Tags map[string]*string `json:"tags"` 7344} 7345 7346// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 7347func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 7348 objectMap := make(map[string]interface{}) 7349 if ppgu.Tags != nil { 7350 objectMap["tags"] = ppgu.Tags 7351 } 7352 return json.Marshal(objectMap) 7353} 7354 7355// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 7356type PurchasePlan struct { 7357 // Publisher - The publisher ID. 7358 Publisher *string `json:"publisher,omitempty"` 7359 // Name - The plan ID. 7360 Name *string `json:"name,omitempty"` 7361 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 7362 Product *string `json:"product,omitempty"` 7363} 7364 7365// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 7366// Image Definition. These properties are updatable. 7367type RecommendedMachineConfiguration struct { 7368 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 7369 Memory *ResourceRange `json:"memory,omitempty"` 7370} 7371 7372// RecoveryWalkResponse response after calling a manual recovery walk 7373type RecoveryWalkResponse struct { 7374 autorest.Response `json:"-"` 7375 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 7376 WalkPerformed *bool `json:"walkPerformed,omitempty"` 7377 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 7378 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 7379} 7380 7381// MarshalJSON is the custom marshaler for RecoveryWalkResponse. 7382func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { 7383 objectMap := make(map[string]interface{}) 7384 return json.Marshal(objectMap) 7385} 7386 7387// RegionalReplicationStatus this is the regional replication status. 7388type RegionalReplicationStatus struct { 7389 // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. 7390 Region *string `json:"region,omitempty"` 7391 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 7392 State ReplicationState `json:"state,omitempty"` 7393 // Details - READ-ONLY; The details of the replication status. 7394 Details *string `json:"details,omitempty"` 7395 // Progress - READ-ONLY; It indicates progress of the replication job. 7396 Progress *int32 `json:"progress,omitempty"` 7397} 7398 7399// MarshalJSON is the custom marshaler for RegionalReplicationStatus. 7400func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { 7401 objectMap := make(map[string]interface{}) 7402 return json.Marshal(objectMap) 7403} 7404 7405// ReplicationStatus this is the replication status of the gallery Image Version. 7406type ReplicationStatus struct { 7407 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' 7408 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 7409 // Summary - READ-ONLY; This is a summary of replication status for each region. 7410 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 7411} 7412 7413// MarshalJSON is the custom marshaler for ReplicationStatus. 7414func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { 7415 objectMap := make(map[string]interface{}) 7416 return json.Marshal(objectMap) 7417} 7418 7419// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 7420type RequestRateByIntervalInput struct { 7421 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 7422 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 7423 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 7424 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 7425 // FromTime - From time of the query 7426 FromTime *date.Time `json:"fromTime,omitempty"` 7427 // ToTime - To time of the query 7428 ToTime *date.Time `json:"toTime,omitempty"` 7429 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 7430 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 7431 // GroupByOperationName - Group query result by Operation Name. 7432 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 7433 // GroupByResourceName - Group query result by Resource Name. 7434 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 7435} 7436 7437// Resource the Resource model definition. 7438type Resource struct { 7439 // ID - READ-ONLY; Resource Id 7440 ID *string `json:"id,omitempty"` 7441 // Name - READ-ONLY; Resource name 7442 Name *string `json:"name,omitempty"` 7443 // Type - READ-ONLY; Resource type 7444 Type *string `json:"type,omitempty"` 7445 // Location - Resource location 7446 Location *string `json:"location,omitempty"` 7447 // Tags - Resource tags 7448 Tags map[string]*string `json:"tags"` 7449} 7450 7451// MarshalJSON is the custom marshaler for Resource. 7452func (r Resource) MarshalJSON() ([]byte, error) { 7453 objectMap := make(map[string]interface{}) 7454 if r.Location != nil { 7455 objectMap["location"] = r.Location 7456 } 7457 if r.Tags != nil { 7458 objectMap["tags"] = r.Tags 7459 } 7460 return json.Marshal(objectMap) 7461} 7462 7463// ResourceRange describes the resource range. 7464type ResourceRange struct { 7465 // Min - The minimum number of the resource. 7466 Min *int32 `json:"min,omitempty"` 7467 // Max - The maximum number of the resource. 7468 Max *int32 `json:"max,omitempty"` 7469} 7470 7471// ResourceSku describes an available Compute SKU. 7472type ResourceSku struct { 7473 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 7474 ResourceType *string `json:"resourceType,omitempty"` 7475 // Name - READ-ONLY; The name of SKU. 7476 Name *string `json:"name,omitempty"` 7477 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 7478 Tier *string `json:"tier,omitempty"` 7479 // Size - READ-ONLY; The Size of the SKU. 7480 Size *string `json:"size,omitempty"` 7481 // Family - READ-ONLY; The Family of this particular SKU. 7482 Family *string `json:"family,omitempty"` 7483 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 7484 Kind *string `json:"kind,omitempty"` 7485 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 7486 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 7487 // Locations - READ-ONLY; The set of locations that the SKU is available. 7488 Locations *[]string `json:"locations,omitempty"` 7489 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 7490 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 7491 // APIVersions - READ-ONLY; The api versions that support this SKU. 7492 APIVersions *[]string `json:"apiVersions,omitempty"` 7493 // Costs - READ-ONLY; Metadata for retrieving price info. 7494 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 7495 // Capabilities - READ-ONLY; A name value pair to describe the capability. 7496 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 7497 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 7498 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 7499} 7500 7501// MarshalJSON is the custom marshaler for ResourceSku. 7502func (rs ResourceSku) MarshalJSON() ([]byte, error) { 7503 objectMap := make(map[string]interface{}) 7504 return json.Marshal(objectMap) 7505} 7506 7507// ResourceSkuCapabilities describes The SKU capabilities object. 7508type ResourceSkuCapabilities struct { 7509 // Name - READ-ONLY; An invariant to describe the feature. 7510 Name *string `json:"name,omitempty"` 7511 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 7512 Value *string `json:"value,omitempty"` 7513} 7514 7515// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. 7516func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { 7517 objectMap := make(map[string]interface{}) 7518 return json.Marshal(objectMap) 7519} 7520 7521// ResourceSkuCapacity describes scaling information of a SKU. 7522type ResourceSkuCapacity struct { 7523 // Minimum - READ-ONLY; The minimum capacity. 7524 Minimum *int64 `json:"minimum,omitempty"` 7525 // Maximum - READ-ONLY; The maximum capacity that can be set. 7526 Maximum *int64 `json:"maximum,omitempty"` 7527 // Default - READ-ONLY; The default capacity. 7528 Default *int64 `json:"default,omitempty"` 7529 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 7530 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 7531} 7532 7533// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 7534func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 7535 objectMap := make(map[string]interface{}) 7536 return json.Marshal(objectMap) 7537} 7538 7539// ResourceSkuCosts describes metadata for retrieving price info. 7540type ResourceSkuCosts struct { 7541 // MeterID - READ-ONLY; Used for querying price from commerce. 7542 MeterID *string `json:"meterID,omitempty"` 7543 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 7544 Quantity *int64 `json:"quantity,omitempty"` 7545 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 7546 ExtendedUnit *string `json:"extendedUnit,omitempty"` 7547} 7548 7549// MarshalJSON is the custom marshaler for ResourceSkuCosts. 7550func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { 7551 objectMap := make(map[string]interface{}) 7552 return json.Marshal(objectMap) 7553} 7554 7555// ResourceSkuLocationInfo ... 7556type ResourceSkuLocationInfo struct { 7557 // Location - READ-ONLY; Location of the SKU 7558 Location *string `json:"location,omitempty"` 7559 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 7560 Zones *[]string `json:"zones,omitempty"` 7561 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 7562 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 7563} 7564 7565// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. 7566func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { 7567 objectMap := make(map[string]interface{}) 7568 return json.Marshal(objectMap) 7569} 7570 7571// ResourceSkuRestrictionInfo ... 7572type ResourceSkuRestrictionInfo struct { 7573 // Locations - READ-ONLY; Locations where the SKU is restricted 7574 Locations *[]string `json:"locations,omitempty"` 7575 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 7576 Zones *[]string `json:"zones,omitempty"` 7577} 7578 7579// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. 7580func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { 7581 objectMap := make(map[string]interface{}) 7582 return json.Marshal(objectMap) 7583} 7584 7585// ResourceSkuRestrictions describes scaling information of a SKU. 7586type ResourceSkuRestrictions struct { 7587 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 7588 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 7589 // 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. 7590 Values *[]string `json:"values,omitempty"` 7591 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 7592 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 7593 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 7594 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 7595} 7596 7597// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. 7598func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { 7599 objectMap := make(map[string]interface{}) 7600 return json.Marshal(objectMap) 7601} 7602 7603// ResourceSkusResult the List Resource Skus operation response. 7604type ResourceSkusResult struct { 7605 autorest.Response `json:"-"` 7606 // Value - The list of skus available for the subscription. 7607 Value *[]ResourceSku `json:"value,omitempty"` 7608 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 7609 NextLink *string `json:"nextLink,omitempty"` 7610} 7611 7612// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 7613type ResourceSkusResultIterator struct { 7614 i int 7615 page ResourceSkusResultPage 7616} 7617 7618// NextWithContext advances to the next value. If there was an error making 7619// the request the iterator does not advance and the error is returned. 7620func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 7621 if tracing.IsEnabled() { 7622 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 7623 defer func() { 7624 sc := -1 7625 if iter.Response().Response.Response != nil { 7626 sc = iter.Response().Response.Response.StatusCode 7627 } 7628 tracing.EndSpan(ctx, sc, err) 7629 }() 7630 } 7631 iter.i++ 7632 if iter.i < len(iter.page.Values()) { 7633 return nil 7634 } 7635 err = iter.page.NextWithContext(ctx) 7636 if err != nil { 7637 iter.i-- 7638 return err 7639 } 7640 iter.i = 0 7641 return nil 7642} 7643 7644// Next advances to the next value. If there was an error making 7645// the request the iterator does not advance and the error is returned. 7646// Deprecated: Use NextWithContext() instead. 7647func (iter *ResourceSkusResultIterator) Next() error { 7648 return iter.NextWithContext(context.Background()) 7649} 7650 7651// NotDone returns true if the enumeration should be started or is not yet complete. 7652func (iter ResourceSkusResultIterator) NotDone() bool { 7653 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7654} 7655 7656// Response returns the raw server response from the last page request. 7657func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 7658 return iter.page.Response() 7659} 7660 7661// Value returns the current value or a zero-initialized value if the 7662// iterator has advanced beyond the end of the collection. 7663func (iter ResourceSkusResultIterator) Value() ResourceSku { 7664 if !iter.page.NotDone() { 7665 return ResourceSku{} 7666 } 7667 return iter.page.Values()[iter.i] 7668} 7669 7670// Creates a new instance of the ResourceSkusResultIterator type. 7671func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 7672 return ResourceSkusResultIterator{page: page} 7673} 7674 7675// IsEmpty returns true if the ListResult contains no values. 7676func (rsr ResourceSkusResult) IsEmpty() bool { 7677 return rsr.Value == nil || len(*rsr.Value) == 0 7678} 7679 7680// hasNextLink returns true if the NextLink is not empty. 7681func (rsr ResourceSkusResult) hasNextLink() bool { 7682 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 7683} 7684 7685// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 7686// It returns nil if no more results exist. 7687func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 7688 if !rsr.hasNextLink() { 7689 return nil, nil 7690 } 7691 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7692 autorest.AsJSON(), 7693 autorest.AsGet(), 7694 autorest.WithBaseURL(to.String(rsr.NextLink))) 7695} 7696 7697// ResourceSkusResultPage contains a page of ResourceSku values. 7698type ResourceSkusResultPage struct { 7699 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 7700 rsr ResourceSkusResult 7701} 7702 7703// NextWithContext advances to the next page of values. If there was an error making 7704// the request the page does not advance and the error is returned. 7705func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 7706 if tracing.IsEnabled() { 7707 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 7708 defer func() { 7709 sc := -1 7710 if page.Response().Response.Response != nil { 7711 sc = page.Response().Response.Response.StatusCode 7712 } 7713 tracing.EndSpan(ctx, sc, err) 7714 }() 7715 } 7716 for { 7717 next, err := page.fn(ctx, page.rsr) 7718 if err != nil { 7719 return err 7720 } 7721 page.rsr = next 7722 if !next.hasNextLink() || !next.IsEmpty() { 7723 break 7724 } 7725 } 7726 return nil 7727} 7728 7729// Next advances to the next page of values. If there was an error making 7730// the request the page does not advance and the error is returned. 7731// Deprecated: Use NextWithContext() instead. 7732func (page *ResourceSkusResultPage) Next() error { 7733 return page.NextWithContext(context.Background()) 7734} 7735 7736// NotDone returns true if the page enumeration should be started or is not yet complete. 7737func (page ResourceSkusResultPage) NotDone() bool { 7738 return !page.rsr.IsEmpty() 7739} 7740 7741// Response returns the raw server response from the last page request. 7742func (page ResourceSkusResultPage) Response() ResourceSkusResult { 7743 return page.rsr 7744} 7745 7746// Values returns the slice of values for the current page or nil if there are no values. 7747func (page ResourceSkusResultPage) Values() []ResourceSku { 7748 if page.rsr.IsEmpty() { 7749 return nil 7750 } 7751 return *page.rsr.Value 7752} 7753 7754// Creates a new instance of the ResourceSkusResultPage type. 7755func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 7756 return ResourceSkusResultPage{ 7757 fn: getNextPage, 7758 rsr: cur, 7759 } 7760} 7761 7762// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 7763type ResourceSkuZoneDetails struct { 7764 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 7765 Name *[]string `json:"name,omitempty"` 7766 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 7767 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 7768} 7769 7770// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. 7771func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { 7772 objectMap := make(map[string]interface{}) 7773 return json.Marshal(objectMap) 7774} 7775 7776// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 7777type RollbackStatusInfo struct { 7778 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 7779 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 7780 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 7781 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 7782 // RollbackError - READ-ONLY; Error details if OS rollback failed. 7783 RollbackError *APIError `json:"rollbackError,omitempty"` 7784} 7785 7786// MarshalJSON is the custom marshaler for RollbackStatusInfo. 7787func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { 7788 objectMap := make(map[string]interface{}) 7789 return json.Marshal(objectMap) 7790} 7791 7792// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 7793type RollingUpgradePolicy struct { 7794 // 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%. 7795 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 7796 // 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%. 7797 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 7798 // 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%. 7799 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 7800 // 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). 7801 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 7802} 7803 7804// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 7805// state. 7806type RollingUpgradeProgressInfo struct { 7807 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 7808 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 7809 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 7810 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 7811 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 7812 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 7813 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 7814 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 7815} 7816 7817// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. 7818func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { 7819 objectMap := make(map[string]interface{}) 7820 return json.Marshal(objectMap) 7821} 7822 7823// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 7824type RollingUpgradeRunningStatus struct { 7825 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 7826 Code RollingUpgradeStatusCode `json:"code,omitempty"` 7827 // StartTime - READ-ONLY; Start time of the upgrade. 7828 StartTime *date.Time `json:"startTime,omitempty"` 7829 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 7830 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 7831 // LastActionTime - READ-ONLY; Last action time of the upgrade. 7832 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 7833} 7834 7835// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. 7836func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { 7837 objectMap := make(map[string]interface{}) 7838 return json.Marshal(objectMap) 7839} 7840 7841// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 7842type RollingUpgradeStatusInfo struct { 7843 autorest.Response `json:"-"` 7844 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 7845 // ID - READ-ONLY; Resource Id 7846 ID *string `json:"id,omitempty"` 7847 // Name - READ-ONLY; Resource name 7848 Name *string `json:"name,omitempty"` 7849 // Type - READ-ONLY; Resource type 7850 Type *string `json:"type,omitempty"` 7851 // Location - Resource location 7852 Location *string `json:"location,omitempty"` 7853 // Tags - Resource tags 7854 Tags map[string]*string `json:"tags"` 7855} 7856 7857// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 7858func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 7859 objectMap := make(map[string]interface{}) 7860 if rusi.RollingUpgradeStatusInfoProperties != nil { 7861 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 7862 } 7863 if rusi.Location != nil { 7864 objectMap["location"] = rusi.Location 7865 } 7866 if rusi.Tags != nil { 7867 objectMap["tags"] = rusi.Tags 7868 } 7869 return json.Marshal(objectMap) 7870} 7871 7872// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 7873func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 7874 var m map[string]*json.RawMessage 7875 err := json.Unmarshal(body, &m) 7876 if err != nil { 7877 return err 7878 } 7879 for k, v := range m { 7880 switch k { 7881 case "properties": 7882 if v != nil { 7883 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 7884 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 7885 if err != nil { 7886 return err 7887 } 7888 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 7889 } 7890 case "id": 7891 if v != nil { 7892 var ID string 7893 err = json.Unmarshal(*v, &ID) 7894 if err != nil { 7895 return err 7896 } 7897 rusi.ID = &ID 7898 } 7899 case "name": 7900 if v != nil { 7901 var name string 7902 err = json.Unmarshal(*v, &name) 7903 if err != nil { 7904 return err 7905 } 7906 rusi.Name = &name 7907 } 7908 case "type": 7909 if v != nil { 7910 var typeVar string 7911 err = json.Unmarshal(*v, &typeVar) 7912 if err != nil { 7913 return err 7914 } 7915 rusi.Type = &typeVar 7916 } 7917 case "location": 7918 if v != nil { 7919 var location string 7920 err = json.Unmarshal(*v, &location) 7921 if err != nil { 7922 return err 7923 } 7924 rusi.Location = &location 7925 } 7926 case "tags": 7927 if v != nil { 7928 var tags map[string]*string 7929 err = json.Unmarshal(*v, &tags) 7930 if err != nil { 7931 return err 7932 } 7933 rusi.Tags = tags 7934 } 7935 } 7936 } 7937 7938 return nil 7939} 7940 7941// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 7942type RollingUpgradeStatusInfoProperties struct { 7943 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 7944 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 7945 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 7946 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 7947 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 7948 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 7949 // Error - READ-ONLY; Error details for this upgrade, if there are any. 7950 Error *APIError `json:"error,omitempty"` 7951} 7952 7953// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. 7954func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { 7955 objectMap := make(map[string]interface{}) 7956 return json.Marshal(objectMap) 7957} 7958 7959// RunCommandDocument describes the properties of a Run Command. 7960type RunCommandDocument struct { 7961 autorest.Response `json:"-"` 7962 // Script - The script to be executed. 7963 Script *[]string `json:"script,omitempty"` 7964 // Parameters - The parameters used by the script. 7965 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 7966 // Schema - The VM run command schema. 7967 Schema *string `json:"$schema,omitempty"` 7968 // ID - The VM run command id. 7969 ID *string `json:"id,omitempty"` 7970 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7971 OsType OperatingSystemTypes `json:"osType,omitempty"` 7972 // Label - The VM run command label. 7973 Label *string `json:"label,omitempty"` 7974 // Description - The VM run command description. 7975 Description *string `json:"description,omitempty"` 7976} 7977 7978// RunCommandDocumentBase describes the properties of a Run Command metadata. 7979type RunCommandDocumentBase struct { 7980 // Schema - The VM run command schema. 7981 Schema *string `json:"$schema,omitempty"` 7982 // ID - The VM run command id. 7983 ID *string `json:"id,omitempty"` 7984 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7985 OsType OperatingSystemTypes `json:"osType,omitempty"` 7986 // Label - The VM run command label. 7987 Label *string `json:"label,omitempty"` 7988 // Description - The VM run command description. 7989 Description *string `json:"description,omitempty"` 7990} 7991 7992// RunCommandInput capture Virtual Machine parameters. 7993type RunCommandInput struct { 7994 // CommandID - The run command id. 7995 CommandID *string `json:"commandId,omitempty"` 7996 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 7997 Script *[]string `json:"script,omitempty"` 7998 // Parameters - The run command parameters. 7999 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 8000} 8001 8002// RunCommandInputParameter describes the properties of a run command parameter. 8003type RunCommandInputParameter struct { 8004 // Name - The run command parameter name. 8005 Name *string `json:"name,omitempty"` 8006 // Value - The run command parameter value. 8007 Value *string `json:"value,omitempty"` 8008} 8009 8010// RunCommandListResult the List Virtual Machine operation response. 8011type RunCommandListResult struct { 8012 autorest.Response `json:"-"` 8013 // Value - The list of virtual machine run commands. 8014 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 8015 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 8016 NextLink *string `json:"nextLink,omitempty"` 8017} 8018 8019// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 8020type RunCommandListResultIterator struct { 8021 i int 8022 page RunCommandListResultPage 8023} 8024 8025// NextWithContext advances to the next value. If there was an error making 8026// the request the iterator does not advance and the error is returned. 8027func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 8028 if tracing.IsEnabled() { 8029 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 8030 defer func() { 8031 sc := -1 8032 if iter.Response().Response.Response != nil { 8033 sc = iter.Response().Response.Response.StatusCode 8034 } 8035 tracing.EndSpan(ctx, sc, err) 8036 }() 8037 } 8038 iter.i++ 8039 if iter.i < len(iter.page.Values()) { 8040 return nil 8041 } 8042 err = iter.page.NextWithContext(ctx) 8043 if err != nil { 8044 iter.i-- 8045 return err 8046 } 8047 iter.i = 0 8048 return nil 8049} 8050 8051// Next advances to the next value. If there was an error making 8052// the request the iterator does not advance and the error is returned. 8053// Deprecated: Use NextWithContext() instead. 8054func (iter *RunCommandListResultIterator) Next() error { 8055 return iter.NextWithContext(context.Background()) 8056} 8057 8058// NotDone returns true if the enumeration should be started or is not yet complete. 8059func (iter RunCommandListResultIterator) NotDone() bool { 8060 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8061} 8062 8063// Response returns the raw server response from the last page request. 8064func (iter RunCommandListResultIterator) Response() RunCommandListResult { 8065 return iter.page.Response() 8066} 8067 8068// Value returns the current value or a zero-initialized value if the 8069// iterator has advanced beyond the end of the collection. 8070func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 8071 if !iter.page.NotDone() { 8072 return RunCommandDocumentBase{} 8073 } 8074 return iter.page.Values()[iter.i] 8075} 8076 8077// Creates a new instance of the RunCommandListResultIterator type. 8078func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 8079 return RunCommandListResultIterator{page: page} 8080} 8081 8082// IsEmpty returns true if the ListResult contains no values. 8083func (rclr RunCommandListResult) IsEmpty() bool { 8084 return rclr.Value == nil || len(*rclr.Value) == 0 8085} 8086 8087// hasNextLink returns true if the NextLink is not empty. 8088func (rclr RunCommandListResult) hasNextLink() bool { 8089 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 8090} 8091 8092// runCommandListResultPreparer prepares a request to retrieve the next set of results. 8093// It returns nil if no more results exist. 8094func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 8095 if !rclr.hasNextLink() { 8096 return nil, nil 8097 } 8098 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8099 autorest.AsJSON(), 8100 autorest.AsGet(), 8101 autorest.WithBaseURL(to.String(rclr.NextLink))) 8102} 8103 8104// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 8105type RunCommandListResultPage struct { 8106 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 8107 rclr RunCommandListResult 8108} 8109 8110// NextWithContext advances to the next page of values. If there was an error making 8111// the request the page does not advance and the error is returned. 8112func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 8113 if tracing.IsEnabled() { 8114 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 8115 defer func() { 8116 sc := -1 8117 if page.Response().Response.Response != nil { 8118 sc = page.Response().Response.Response.StatusCode 8119 } 8120 tracing.EndSpan(ctx, sc, err) 8121 }() 8122 } 8123 for { 8124 next, err := page.fn(ctx, page.rclr) 8125 if err != nil { 8126 return err 8127 } 8128 page.rclr = next 8129 if !next.hasNextLink() || !next.IsEmpty() { 8130 break 8131 } 8132 } 8133 return nil 8134} 8135 8136// Next advances to the next page of values. If there was an error making 8137// the request the page does not advance and the error is returned. 8138// Deprecated: Use NextWithContext() instead. 8139func (page *RunCommandListResultPage) Next() error { 8140 return page.NextWithContext(context.Background()) 8141} 8142 8143// NotDone returns true if the page enumeration should be started or is not yet complete. 8144func (page RunCommandListResultPage) NotDone() bool { 8145 return !page.rclr.IsEmpty() 8146} 8147 8148// Response returns the raw server response from the last page request. 8149func (page RunCommandListResultPage) Response() RunCommandListResult { 8150 return page.rclr 8151} 8152 8153// Values returns the slice of values for the current page or nil if there are no values. 8154func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 8155 if page.rclr.IsEmpty() { 8156 return nil 8157 } 8158 return *page.rclr.Value 8159} 8160 8161// Creates a new instance of the RunCommandListResultPage type. 8162func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 8163 return RunCommandListResultPage{ 8164 fn: getNextPage, 8165 rclr: cur, 8166 } 8167} 8168 8169// RunCommandParameterDefinition describes the properties of a run command parameter. 8170type RunCommandParameterDefinition struct { 8171 // Name - The run command parameter name. 8172 Name *string `json:"name,omitempty"` 8173 // Type - The run command parameter type. 8174 Type *string `json:"type,omitempty"` 8175 // DefaultValue - The run command parameter default value. 8176 DefaultValue *string `json:"defaultValue,omitempty"` 8177 // Required - The run command parameter required. 8178 Required *bool `json:"required,omitempty"` 8179} 8180 8181// RunCommandResult ... 8182type RunCommandResult struct { 8183 autorest.Response `json:"-"` 8184 // Value - Run command operation response. 8185 Value *[]InstanceViewStatus `json:"value,omitempty"` 8186} 8187 8188// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 8189type ScaleInPolicy struct { 8190 // Rules - The rules to be followed when scaling-in a virtual machine scale set. <br><br> Possible values are: <br><br> **Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in. <br><br> **OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. <br><br> **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal. <br><br> 8191 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 8192} 8193 8194// ScheduledEventsProfile ... 8195type ScheduledEventsProfile struct { 8196 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 8197 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 8198} 8199 8200// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 8201// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 8202// name. 8203type Sku struct { 8204 // Name - The sku name. 8205 Name *string `json:"name,omitempty"` 8206 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 8207 Tier *string `json:"tier,omitempty"` 8208 // Capacity - Specifies the number of virtual machines in the scale set. 8209 Capacity *int64 `json:"capacity,omitempty"` 8210} 8211 8212// Snapshot snapshot resource. 8213type Snapshot struct { 8214 autorest.Response `json:"-"` 8215 // ManagedBy - READ-ONLY; Unused. Always Null. 8216 ManagedBy *string `json:"managedBy,omitempty"` 8217 Sku *SnapshotSku `json:"sku,omitempty"` 8218 *SnapshotProperties `json:"properties,omitempty"` 8219 // ID - READ-ONLY; Resource Id 8220 ID *string `json:"id,omitempty"` 8221 // Name - READ-ONLY; Resource name 8222 Name *string `json:"name,omitempty"` 8223 // Type - READ-ONLY; Resource type 8224 Type *string `json:"type,omitempty"` 8225 // Location - Resource location 8226 Location *string `json:"location,omitempty"` 8227 // Tags - Resource tags 8228 Tags map[string]*string `json:"tags"` 8229} 8230 8231// MarshalJSON is the custom marshaler for Snapshot. 8232func (s Snapshot) MarshalJSON() ([]byte, error) { 8233 objectMap := make(map[string]interface{}) 8234 if s.Sku != nil { 8235 objectMap["sku"] = s.Sku 8236 } 8237 if s.SnapshotProperties != nil { 8238 objectMap["properties"] = s.SnapshotProperties 8239 } 8240 if s.Location != nil { 8241 objectMap["location"] = s.Location 8242 } 8243 if s.Tags != nil { 8244 objectMap["tags"] = s.Tags 8245 } 8246 return json.Marshal(objectMap) 8247} 8248 8249// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 8250func (s *Snapshot) UnmarshalJSON(body []byte) error { 8251 var m map[string]*json.RawMessage 8252 err := json.Unmarshal(body, &m) 8253 if err != nil { 8254 return err 8255 } 8256 for k, v := range m { 8257 switch k { 8258 case "managedBy": 8259 if v != nil { 8260 var managedBy string 8261 err = json.Unmarshal(*v, &managedBy) 8262 if err != nil { 8263 return err 8264 } 8265 s.ManagedBy = &managedBy 8266 } 8267 case "sku": 8268 if v != nil { 8269 var sku SnapshotSku 8270 err = json.Unmarshal(*v, &sku) 8271 if err != nil { 8272 return err 8273 } 8274 s.Sku = &sku 8275 } 8276 case "properties": 8277 if v != nil { 8278 var snapshotProperties SnapshotProperties 8279 err = json.Unmarshal(*v, &snapshotProperties) 8280 if err != nil { 8281 return err 8282 } 8283 s.SnapshotProperties = &snapshotProperties 8284 } 8285 case "id": 8286 if v != nil { 8287 var ID string 8288 err = json.Unmarshal(*v, &ID) 8289 if err != nil { 8290 return err 8291 } 8292 s.ID = &ID 8293 } 8294 case "name": 8295 if v != nil { 8296 var name string 8297 err = json.Unmarshal(*v, &name) 8298 if err != nil { 8299 return err 8300 } 8301 s.Name = &name 8302 } 8303 case "type": 8304 if v != nil { 8305 var typeVar string 8306 err = json.Unmarshal(*v, &typeVar) 8307 if err != nil { 8308 return err 8309 } 8310 s.Type = &typeVar 8311 } 8312 case "location": 8313 if v != nil { 8314 var location string 8315 err = json.Unmarshal(*v, &location) 8316 if err != nil { 8317 return err 8318 } 8319 s.Location = &location 8320 } 8321 case "tags": 8322 if v != nil { 8323 var tags map[string]*string 8324 err = json.Unmarshal(*v, &tags) 8325 if err != nil { 8326 return err 8327 } 8328 s.Tags = tags 8329 } 8330 } 8331 } 8332 8333 return nil 8334} 8335 8336// SnapshotList the List Snapshots operation response. 8337type SnapshotList struct { 8338 autorest.Response `json:"-"` 8339 // Value - A list of snapshots. 8340 Value *[]Snapshot `json:"value,omitempty"` 8341 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 8342 NextLink *string `json:"nextLink,omitempty"` 8343} 8344 8345// SnapshotListIterator provides access to a complete listing of Snapshot values. 8346type SnapshotListIterator struct { 8347 i int 8348 page SnapshotListPage 8349} 8350 8351// NextWithContext advances to the next value. If there was an error making 8352// the request the iterator does not advance and the error is returned. 8353func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 8354 if tracing.IsEnabled() { 8355 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 8356 defer func() { 8357 sc := -1 8358 if iter.Response().Response.Response != nil { 8359 sc = iter.Response().Response.Response.StatusCode 8360 } 8361 tracing.EndSpan(ctx, sc, err) 8362 }() 8363 } 8364 iter.i++ 8365 if iter.i < len(iter.page.Values()) { 8366 return nil 8367 } 8368 err = iter.page.NextWithContext(ctx) 8369 if err != nil { 8370 iter.i-- 8371 return err 8372 } 8373 iter.i = 0 8374 return nil 8375} 8376 8377// Next advances to the next value. If there was an error making 8378// the request the iterator does not advance and the error is returned. 8379// Deprecated: Use NextWithContext() instead. 8380func (iter *SnapshotListIterator) Next() error { 8381 return iter.NextWithContext(context.Background()) 8382} 8383 8384// NotDone returns true if the enumeration should be started or is not yet complete. 8385func (iter SnapshotListIterator) NotDone() bool { 8386 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8387} 8388 8389// Response returns the raw server response from the last page request. 8390func (iter SnapshotListIterator) Response() SnapshotList { 8391 return iter.page.Response() 8392} 8393 8394// Value returns the current value or a zero-initialized value if the 8395// iterator has advanced beyond the end of the collection. 8396func (iter SnapshotListIterator) Value() Snapshot { 8397 if !iter.page.NotDone() { 8398 return Snapshot{} 8399 } 8400 return iter.page.Values()[iter.i] 8401} 8402 8403// Creates a new instance of the SnapshotListIterator type. 8404func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 8405 return SnapshotListIterator{page: page} 8406} 8407 8408// IsEmpty returns true if the ListResult contains no values. 8409func (sl SnapshotList) IsEmpty() bool { 8410 return sl.Value == nil || len(*sl.Value) == 0 8411} 8412 8413// hasNextLink returns true if the NextLink is not empty. 8414func (sl SnapshotList) hasNextLink() bool { 8415 return sl.NextLink != nil && len(*sl.NextLink) != 0 8416} 8417 8418// snapshotListPreparer prepares a request to retrieve the next set of results. 8419// It returns nil if no more results exist. 8420func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 8421 if !sl.hasNextLink() { 8422 return nil, nil 8423 } 8424 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8425 autorest.AsJSON(), 8426 autorest.AsGet(), 8427 autorest.WithBaseURL(to.String(sl.NextLink))) 8428} 8429 8430// SnapshotListPage contains a page of Snapshot values. 8431type SnapshotListPage struct { 8432 fn func(context.Context, SnapshotList) (SnapshotList, error) 8433 sl SnapshotList 8434} 8435 8436// NextWithContext advances to the next page of values. If there was an error making 8437// the request the page does not advance and the error is returned. 8438func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 8439 if tracing.IsEnabled() { 8440 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 8441 defer func() { 8442 sc := -1 8443 if page.Response().Response.Response != nil { 8444 sc = page.Response().Response.Response.StatusCode 8445 } 8446 tracing.EndSpan(ctx, sc, err) 8447 }() 8448 } 8449 for { 8450 next, err := page.fn(ctx, page.sl) 8451 if err != nil { 8452 return err 8453 } 8454 page.sl = next 8455 if !next.hasNextLink() || !next.IsEmpty() { 8456 break 8457 } 8458 } 8459 return nil 8460} 8461 8462// Next advances to the next page of values. If there was an error making 8463// the request the page does not advance and the error is returned. 8464// Deprecated: Use NextWithContext() instead. 8465func (page *SnapshotListPage) Next() error { 8466 return page.NextWithContext(context.Background()) 8467} 8468 8469// NotDone returns true if the page enumeration should be started or is not yet complete. 8470func (page SnapshotListPage) NotDone() bool { 8471 return !page.sl.IsEmpty() 8472} 8473 8474// Response returns the raw server response from the last page request. 8475func (page SnapshotListPage) Response() SnapshotList { 8476 return page.sl 8477} 8478 8479// Values returns the slice of values for the current page or nil if there are no values. 8480func (page SnapshotListPage) Values() []Snapshot { 8481 if page.sl.IsEmpty() { 8482 return nil 8483 } 8484 return *page.sl.Value 8485} 8486 8487// Creates a new instance of the SnapshotListPage type. 8488func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 8489 return SnapshotListPage{ 8490 fn: getNextPage, 8491 sl: cur, 8492 } 8493} 8494 8495// SnapshotProperties snapshot resource properties. 8496type SnapshotProperties struct { 8497 // TimeCreated - READ-ONLY; The time when the disk was created. 8498 TimeCreated *date.Time `json:"timeCreated,omitempty"` 8499 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 8500 OsType OperatingSystemTypes `json:"osType,omitempty"` 8501 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 8502 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 8503 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 8504 CreationData *CreationData `json:"creationData,omitempty"` 8505 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk 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. 8506 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8507 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 8508 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 8509 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 8510 UniqueID *string `json:"uniqueId,omitempty"` 8511 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 8512 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 8513 // ProvisioningState - READ-ONLY; The disk provisioning state. 8514 ProvisioningState *string `json:"provisioningState,omitempty"` 8515 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 8516 Incremental *bool `json:"incremental,omitempty"` 8517 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 8518 Encryption *Encryption `json:"encryption,omitempty"` 8519} 8520 8521// MarshalJSON is the custom marshaler for SnapshotProperties. 8522func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 8523 objectMap := make(map[string]interface{}) 8524 if sp.OsType != "" { 8525 objectMap["osType"] = sp.OsType 8526 } 8527 if sp.HyperVGeneration != "" { 8528 objectMap["hyperVGeneration"] = sp.HyperVGeneration 8529 } 8530 if sp.CreationData != nil { 8531 objectMap["creationData"] = sp.CreationData 8532 } 8533 if sp.DiskSizeGB != nil { 8534 objectMap["diskSizeGB"] = sp.DiskSizeGB 8535 } 8536 if sp.EncryptionSettingsCollection != nil { 8537 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 8538 } 8539 if sp.Incremental != nil { 8540 objectMap["incremental"] = sp.Incremental 8541 } 8542 if sp.Encryption != nil { 8543 objectMap["encryption"] = sp.Encryption 8544 } 8545 return json.Marshal(objectMap) 8546} 8547 8548// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8549// operation. 8550type SnapshotsCreateOrUpdateFuture struct { 8551 azure.FutureAPI 8552 // Result returns the result of the asynchronous operation. 8553 // If the operation has not completed it will return an error. 8554 Result func(SnapshotsClient) (Snapshot, error) 8555} 8556 8557// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8558func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8559 var azFuture azure.Future 8560 if err := json.Unmarshal(body, &azFuture); err != nil { 8561 return err 8562 } 8563 future.FutureAPI = &azFuture 8564 future.Result = future.result 8565 return nil 8566} 8567 8568// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 8569func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 8570 var done bool 8571 done, err = future.DoneWithContext(context.Background(), client) 8572 if err != nil { 8573 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8574 return 8575 } 8576 if !done { 8577 s.Response.Response = future.Response() 8578 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 8579 return 8580 } 8581 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8582 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 8583 s, err = client.CreateOrUpdateResponder(s.Response.Response) 8584 if err != nil { 8585 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 8586 } 8587 } 8588 return 8589} 8590 8591// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8592// operation. 8593type SnapshotsDeleteFuture struct { 8594 azure.FutureAPI 8595 // Result returns the result of the asynchronous operation. 8596 // If the operation has not completed it will return an error. 8597 Result func(SnapshotsClient) (autorest.Response, error) 8598} 8599 8600// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8601func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 8602 var azFuture azure.Future 8603 if err := json.Unmarshal(body, &azFuture); err != nil { 8604 return err 8605 } 8606 future.FutureAPI = &azFuture 8607 future.Result = future.result 8608 return nil 8609} 8610 8611// result is the default implementation for SnapshotsDeleteFuture.Result. 8612func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 8613 var done bool 8614 done, err = future.DoneWithContext(context.Background(), client) 8615 if err != nil { 8616 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 8617 return 8618 } 8619 if !done { 8620 ar.Response = future.Response() 8621 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 8622 return 8623 } 8624 ar.Response = future.Response() 8625 return 8626} 8627 8628// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 8629// operation. 8630type SnapshotsGrantAccessFuture struct { 8631 azure.FutureAPI 8632 // Result returns the result of the asynchronous operation. 8633 // If the operation has not completed it will return an error. 8634 Result func(SnapshotsClient) (AccessURI, error) 8635} 8636 8637// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8638func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 8639 var azFuture azure.Future 8640 if err := json.Unmarshal(body, &azFuture); err != nil { 8641 return err 8642 } 8643 future.FutureAPI = &azFuture 8644 future.Result = future.result 8645 return nil 8646} 8647 8648// result is the default implementation for SnapshotsGrantAccessFuture.Result. 8649func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 8650 var done bool 8651 done, err = future.DoneWithContext(context.Background(), client) 8652 if err != nil { 8653 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 8654 return 8655 } 8656 if !done { 8657 au.Response.Response = future.Response() 8658 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 8659 return 8660 } 8661 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8662 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 8663 au, err = client.GrantAccessResponder(au.Response.Response) 8664 if err != nil { 8665 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 8666 } 8667 } 8668 return 8669} 8670 8671// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 8672type SnapshotSku struct { 8673 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 8674 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 8675 // Tier - READ-ONLY; The sku tier. 8676 Tier *string `json:"tier,omitempty"` 8677} 8678 8679// MarshalJSON is the custom marshaler for SnapshotSku. 8680func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 8681 objectMap := make(map[string]interface{}) 8682 if ss.Name != "" { 8683 objectMap["name"] = ss.Name 8684 } 8685 return json.Marshal(objectMap) 8686} 8687 8688// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 8689// operation. 8690type SnapshotsRevokeAccessFuture struct { 8691 azure.FutureAPI 8692 // Result returns the result of the asynchronous operation. 8693 // If the operation has not completed it will return an error. 8694 Result func(SnapshotsClient) (autorest.Response, error) 8695} 8696 8697// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8698func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 8699 var azFuture azure.Future 8700 if err := json.Unmarshal(body, &azFuture); err != nil { 8701 return err 8702 } 8703 future.FutureAPI = &azFuture 8704 future.Result = future.result 8705 return nil 8706} 8707 8708// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 8709func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 8710 var done bool 8711 done, err = future.DoneWithContext(context.Background(), client) 8712 if err != nil { 8713 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 8714 return 8715 } 8716 if !done { 8717 ar.Response = future.Response() 8718 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 8719 return 8720 } 8721 ar.Response = future.Response() 8722 return 8723} 8724 8725// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8726// operation. 8727type SnapshotsUpdateFuture struct { 8728 azure.FutureAPI 8729 // Result returns the result of the asynchronous operation. 8730 // If the operation has not completed it will return an error. 8731 Result func(SnapshotsClient) (Snapshot, error) 8732} 8733 8734// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8735func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 8736 var azFuture azure.Future 8737 if err := json.Unmarshal(body, &azFuture); err != nil { 8738 return err 8739 } 8740 future.FutureAPI = &azFuture 8741 future.Result = future.result 8742 return nil 8743} 8744 8745// result is the default implementation for SnapshotsUpdateFuture.Result. 8746func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 8747 var done bool 8748 done, err = future.DoneWithContext(context.Background(), client) 8749 if err != nil { 8750 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 8751 return 8752 } 8753 if !done { 8754 s.Response.Response = future.Response() 8755 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 8756 return 8757 } 8758 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8759 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 8760 s, err = client.UpdateResponder(s.Response.Response) 8761 if err != nil { 8762 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 8763 } 8764 } 8765 return 8766} 8767 8768// SnapshotUpdate snapshot update resource. 8769type SnapshotUpdate struct { 8770 *SnapshotUpdateProperties `json:"properties,omitempty"` 8771 // Tags - Resource tags 8772 Tags map[string]*string `json:"tags"` 8773 Sku *SnapshotSku `json:"sku,omitempty"` 8774} 8775 8776// MarshalJSON is the custom marshaler for SnapshotUpdate. 8777func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 8778 objectMap := make(map[string]interface{}) 8779 if su.SnapshotUpdateProperties != nil { 8780 objectMap["properties"] = su.SnapshotUpdateProperties 8781 } 8782 if su.Tags != nil { 8783 objectMap["tags"] = su.Tags 8784 } 8785 if su.Sku != nil { 8786 objectMap["sku"] = su.Sku 8787 } 8788 return json.Marshal(objectMap) 8789} 8790 8791// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 8792func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 8793 var m map[string]*json.RawMessage 8794 err := json.Unmarshal(body, &m) 8795 if err != nil { 8796 return err 8797 } 8798 for k, v := range m { 8799 switch k { 8800 case "properties": 8801 if v != nil { 8802 var snapshotUpdateProperties SnapshotUpdateProperties 8803 err = json.Unmarshal(*v, &snapshotUpdateProperties) 8804 if err != nil { 8805 return err 8806 } 8807 su.SnapshotUpdateProperties = &snapshotUpdateProperties 8808 } 8809 case "tags": 8810 if v != nil { 8811 var tags map[string]*string 8812 err = json.Unmarshal(*v, &tags) 8813 if err != nil { 8814 return err 8815 } 8816 su.Tags = tags 8817 } 8818 case "sku": 8819 if v != nil { 8820 var sku SnapshotSku 8821 err = json.Unmarshal(*v, &sku) 8822 if err != nil { 8823 return err 8824 } 8825 su.Sku = &sku 8826 } 8827 } 8828 } 8829 8830 return nil 8831} 8832 8833// SnapshotUpdateProperties snapshot resource update properties. 8834type SnapshotUpdateProperties struct { 8835 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 8836 OsType OperatingSystemTypes `json:"osType,omitempty"` 8837 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk 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. 8838 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8839 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 8840 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 8841 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 8842 Encryption *Encryption `json:"encryption,omitempty"` 8843} 8844 8845// SourceVault the vault id is an Azure Resource Manager Resource id in the form 8846// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 8847type SourceVault struct { 8848 // ID - Resource Id 8849 ID *string `json:"id,omitempty"` 8850} 8851 8852// SSHConfiguration SSH configuration for Linux based VMs running on Azure 8853type SSHConfiguration struct { 8854 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 8855 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 8856} 8857 8858// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 8859// the public key is placed. 8860type SSHPublicKey struct { 8861 // 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 8862 Path *string `json:"path,omitempty"` 8863 // 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). 8864 KeyData *string `json:"keyData,omitempty"` 8865} 8866 8867// StorageProfile specifies the storage settings for the virtual machine disks. 8868type StorageProfile struct { 8869 // 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. 8870 ImageReference *ImageReference `json:"imageReference,omitempty"` 8871 // 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). 8872 OsDisk *OSDisk `json:"osDisk,omitempty"` 8873 // 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). 8874 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 8875} 8876 8877// SubResource ... 8878type SubResource struct { 8879 // ID - Resource Id 8880 ID *string `json:"id,omitempty"` 8881} 8882 8883// SubResourceReadOnly ... 8884type SubResourceReadOnly struct { 8885 // ID - READ-ONLY; Resource Id 8886 ID *string `json:"id,omitempty"` 8887} 8888 8889// MarshalJSON is the custom marshaler for SubResourceReadOnly. 8890func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { 8891 objectMap := make(map[string]interface{}) 8892 return json.Marshal(objectMap) 8893} 8894 8895// SubResourceWithColocationStatus ... 8896type SubResourceWithColocationStatus struct { 8897 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 8898 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 8899 // ID - Resource Id 8900 ID *string `json:"id,omitempty"` 8901} 8902 8903// TargetRegion describes the target region information. 8904type TargetRegion struct { 8905 // Name - The name of the region. 8906 Name *string `json:"name,omitempty"` 8907 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 8908 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 8909 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 8910 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 8911} 8912 8913// TerminateNotificationProfile ... 8914type TerminateNotificationProfile struct { 8915 // NotBeforeTimeout - Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) 8916 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 8917 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 8918 Enable *bool `json:"enable,omitempty"` 8919} 8920 8921// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 8922type ThrottledRequestsInput struct { 8923 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 8924 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 8925 // FromTime - From time of the query 8926 FromTime *date.Time `json:"fromTime,omitempty"` 8927 // ToTime - To time of the query 8928 ToTime *date.Time `json:"toTime,omitempty"` 8929 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 8930 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 8931 // GroupByOperationName - Group query result by Operation Name. 8932 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 8933 // GroupByResourceName - Group query result by Resource Name. 8934 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 8935} 8936 8937// UpdateResource the Update Resource model definition. 8938type UpdateResource struct { 8939 // Tags - Resource tags 8940 Tags map[string]*string `json:"tags"` 8941} 8942 8943// MarshalJSON is the custom marshaler for UpdateResource. 8944func (ur UpdateResource) MarshalJSON() ([]byte, error) { 8945 objectMap := make(map[string]interface{}) 8946 if ur.Tags != nil { 8947 objectMap["tags"] = ur.Tags 8948 } 8949 return json.Marshal(objectMap) 8950} 8951 8952// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 8953type UpgradeOperationHistoricalStatusInfo struct { 8954 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 8955 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 8956 // Type - READ-ONLY; Resource type 8957 Type *string `json:"type,omitempty"` 8958 // Location - READ-ONLY; Resource location 8959 Location *string `json:"location,omitempty"` 8960} 8961 8962// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. 8963func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { 8964 objectMap := make(map[string]interface{}) 8965 return json.Marshal(objectMap) 8966} 8967 8968// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 8969// Set. 8970type UpgradeOperationHistoricalStatusInfoProperties struct { 8971 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 8972 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 8973 // Progress - READ-ONLY; Counts of the VMs in each state. 8974 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 8975 // Error - READ-ONLY; Error Details for this upgrade if there are any. 8976 Error *APIError `json:"error,omitempty"` 8977 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 8978 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 8979 // TargetImageReference - READ-ONLY; Image Reference details 8980 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 8981 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 8982 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 8983} 8984 8985// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. 8986func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { 8987 objectMap := make(map[string]interface{}) 8988 return json.Marshal(objectMap) 8989} 8990 8991// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 8992type UpgradeOperationHistoryStatus struct { 8993 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 8994 Code UpgradeState `json:"code,omitempty"` 8995 // StartTime - READ-ONLY; Start time of the upgrade. 8996 StartTime *date.Time `json:"startTime,omitempty"` 8997 // EndTime - READ-ONLY; End time of the upgrade. 8998 EndTime *date.Time `json:"endTime,omitempty"` 8999} 9000 9001// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. 9002func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { 9003 objectMap := make(map[string]interface{}) 9004 return json.Marshal(objectMap) 9005} 9006 9007// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 9008type UpgradePolicy struct { 9009 // 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' 9010 Mode UpgradeMode `json:"mode,omitempty"` 9011 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 9012 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 9013 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 9014 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 9015} 9016 9017// Usage describes Compute Resource Usage. 9018type Usage struct { 9019 // Unit - An enum describing the unit of usage measurement. 9020 Unit *string `json:"unit,omitempty"` 9021 // CurrentValue - The current usage of the resource. 9022 CurrentValue *int32 `json:"currentValue,omitempty"` 9023 // Limit - The maximum permitted usage of the resource. 9024 Limit *int64 `json:"limit,omitempty"` 9025 // Name - The name of the type of usage. 9026 Name *UsageName `json:"name,omitempty"` 9027} 9028 9029// UsageName the Usage Names. 9030type UsageName struct { 9031 // Value - The name of the resource. 9032 Value *string `json:"value,omitempty"` 9033 // LocalizedValue - The localized name of the resource. 9034 LocalizedValue *string `json:"localizedValue,omitempty"` 9035} 9036 9037// UserArtifactSource the source image from which the Image Version is going to be created. 9038type UserArtifactSource struct { 9039 // FileName - Required. The fileName of the artifact. 9040 FileName *string `json:"fileName,omitempty"` 9041 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. 9042 MediaLink *string `json:"mediaLink,omitempty"` 9043} 9044 9045// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 9046// should reside on the VM. 9047type VaultCertificate struct { 9048 // 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>} 9049 CertificateURL *string `json:"certificateUrl,omitempty"` 9050 // 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. 9051 CertificateStore *string `json:"certificateStore,omitempty"` 9052} 9053 9054// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 9055type VaultSecretGroup struct { 9056 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 9057 SourceVault *SubResource `json:"sourceVault,omitempty"` 9058 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 9059 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 9060} 9061 9062// VirtualHardDisk describes the uri of a disk. 9063type VirtualHardDisk struct { 9064 // URI - Specifies the virtual hard disk's uri. 9065 URI *string `json:"uri,omitempty"` 9066} 9067 9068// VirtualMachine describes a Virtual Machine. 9069type VirtualMachine struct { 9070 autorest.Response `json:"-"` 9071 // 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**. 9072 Plan *Plan `json:"plan,omitempty"` 9073 *VirtualMachineProperties `json:"properties,omitempty"` 9074 // Resources - READ-ONLY; The virtual machine child extension resources. 9075 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 9076 // Identity - The identity of the virtual machine, if configured. 9077 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 9078 // Zones - The virtual machine zones. 9079 Zones *[]string `json:"zones,omitempty"` 9080 // ID - READ-ONLY; Resource Id 9081 ID *string `json:"id,omitempty"` 9082 // Name - READ-ONLY; Resource name 9083 Name *string `json:"name,omitempty"` 9084 // Type - READ-ONLY; Resource type 9085 Type *string `json:"type,omitempty"` 9086 // Location - Resource location 9087 Location *string `json:"location,omitempty"` 9088 // Tags - Resource tags 9089 Tags map[string]*string `json:"tags"` 9090} 9091 9092// MarshalJSON is the custom marshaler for VirtualMachine. 9093func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 9094 objectMap := make(map[string]interface{}) 9095 if VM.Plan != nil { 9096 objectMap["plan"] = VM.Plan 9097 } 9098 if VM.VirtualMachineProperties != nil { 9099 objectMap["properties"] = VM.VirtualMachineProperties 9100 } 9101 if VM.Identity != nil { 9102 objectMap["identity"] = VM.Identity 9103 } 9104 if VM.Zones != nil { 9105 objectMap["zones"] = VM.Zones 9106 } 9107 if VM.Location != nil { 9108 objectMap["location"] = VM.Location 9109 } 9110 if VM.Tags != nil { 9111 objectMap["tags"] = VM.Tags 9112 } 9113 return json.Marshal(objectMap) 9114} 9115 9116// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 9117func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 9118 var m map[string]*json.RawMessage 9119 err := json.Unmarshal(body, &m) 9120 if err != nil { 9121 return err 9122 } 9123 for k, v := range m { 9124 switch k { 9125 case "plan": 9126 if v != nil { 9127 var plan Plan 9128 err = json.Unmarshal(*v, &plan) 9129 if err != nil { 9130 return err 9131 } 9132 VM.Plan = &plan 9133 } 9134 case "properties": 9135 if v != nil { 9136 var virtualMachineProperties VirtualMachineProperties 9137 err = json.Unmarshal(*v, &virtualMachineProperties) 9138 if err != nil { 9139 return err 9140 } 9141 VM.VirtualMachineProperties = &virtualMachineProperties 9142 } 9143 case "resources": 9144 if v != nil { 9145 var resources []VirtualMachineExtension 9146 err = json.Unmarshal(*v, &resources) 9147 if err != nil { 9148 return err 9149 } 9150 VM.Resources = &resources 9151 } 9152 case "identity": 9153 if v != nil { 9154 var identity VirtualMachineIdentity 9155 err = json.Unmarshal(*v, &identity) 9156 if err != nil { 9157 return err 9158 } 9159 VM.Identity = &identity 9160 } 9161 case "zones": 9162 if v != nil { 9163 var zones []string 9164 err = json.Unmarshal(*v, &zones) 9165 if err != nil { 9166 return err 9167 } 9168 VM.Zones = &zones 9169 } 9170 case "id": 9171 if v != nil { 9172 var ID string 9173 err = json.Unmarshal(*v, &ID) 9174 if err != nil { 9175 return err 9176 } 9177 VM.ID = &ID 9178 } 9179 case "name": 9180 if v != nil { 9181 var name string 9182 err = json.Unmarshal(*v, &name) 9183 if err != nil { 9184 return err 9185 } 9186 VM.Name = &name 9187 } 9188 case "type": 9189 if v != nil { 9190 var typeVar string 9191 err = json.Unmarshal(*v, &typeVar) 9192 if err != nil { 9193 return err 9194 } 9195 VM.Type = &typeVar 9196 } 9197 case "location": 9198 if v != nil { 9199 var location string 9200 err = json.Unmarshal(*v, &location) 9201 if err != nil { 9202 return err 9203 } 9204 VM.Location = &location 9205 } 9206 case "tags": 9207 if v != nil { 9208 var tags map[string]*string 9209 err = json.Unmarshal(*v, &tags) 9210 if err != nil { 9211 return err 9212 } 9213 VM.Tags = tags 9214 } 9215 } 9216 } 9217 9218 return nil 9219} 9220 9221// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 9222type VirtualMachineAgentInstanceView struct { 9223 // VMAgentVersion - The VM Agent full version. 9224 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 9225 // ExtensionHandlers - The virtual machine extension handler instance view. 9226 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 9227 // Statuses - The resource status information. 9228 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9229} 9230 9231// VirtualMachineCaptureParameters capture Virtual Machine parameters. 9232type VirtualMachineCaptureParameters struct { 9233 // VhdPrefix - The captured virtual hard disk's name prefix. 9234 VhdPrefix *string `json:"vhdPrefix,omitempty"` 9235 // DestinationContainerName - The destination container name. 9236 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 9237 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 9238 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 9239} 9240 9241// VirtualMachineCaptureResult output of virtual machine capture operation. 9242type VirtualMachineCaptureResult struct { 9243 autorest.Response `json:"-"` 9244 // Schema - READ-ONLY; the schema of the captured virtual machine 9245 Schema *string `json:"$schema,omitempty"` 9246 // ContentVersion - READ-ONLY; the version of the content 9247 ContentVersion *string `json:"contentVersion,omitempty"` 9248 // Parameters - READ-ONLY; parameters of the captured virtual machine 9249 Parameters interface{} `json:"parameters,omitempty"` 9250 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 9251 Resources *[]interface{} `json:"resources,omitempty"` 9252 // ID - Resource Id 9253 ID *string `json:"id,omitempty"` 9254} 9255 9256// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 9257func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 9258 objectMap := make(map[string]interface{}) 9259 if vmcr.ID != nil { 9260 objectMap["id"] = vmcr.ID 9261 } 9262 return json.Marshal(objectMap) 9263} 9264 9265// VirtualMachineExtension describes a Virtual Machine Extension. 9266type VirtualMachineExtension struct { 9267 autorest.Response `json:"-"` 9268 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 9269 // ID - READ-ONLY; Resource Id 9270 ID *string `json:"id,omitempty"` 9271 // Name - READ-ONLY; Resource name 9272 Name *string `json:"name,omitempty"` 9273 // Type - READ-ONLY; Resource type 9274 Type *string `json:"type,omitempty"` 9275 // Location - Resource location 9276 Location *string `json:"location,omitempty"` 9277 // Tags - Resource tags 9278 Tags map[string]*string `json:"tags"` 9279} 9280 9281// MarshalJSON is the custom marshaler for VirtualMachineExtension. 9282func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 9283 objectMap := make(map[string]interface{}) 9284 if vme.VirtualMachineExtensionProperties != nil { 9285 objectMap["properties"] = vme.VirtualMachineExtensionProperties 9286 } 9287 if vme.Location != nil { 9288 objectMap["location"] = vme.Location 9289 } 9290 if vme.Tags != nil { 9291 objectMap["tags"] = vme.Tags 9292 } 9293 return json.Marshal(objectMap) 9294} 9295 9296// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 9297func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 9298 var m map[string]*json.RawMessage 9299 err := json.Unmarshal(body, &m) 9300 if err != nil { 9301 return err 9302 } 9303 for k, v := range m { 9304 switch k { 9305 case "properties": 9306 if v != nil { 9307 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 9308 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 9309 if err != nil { 9310 return err 9311 } 9312 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 9313 } 9314 case "id": 9315 if v != nil { 9316 var ID string 9317 err = json.Unmarshal(*v, &ID) 9318 if err != nil { 9319 return err 9320 } 9321 vme.ID = &ID 9322 } 9323 case "name": 9324 if v != nil { 9325 var name string 9326 err = json.Unmarshal(*v, &name) 9327 if err != nil { 9328 return err 9329 } 9330 vme.Name = &name 9331 } 9332 case "type": 9333 if v != nil { 9334 var typeVar string 9335 err = json.Unmarshal(*v, &typeVar) 9336 if err != nil { 9337 return err 9338 } 9339 vme.Type = &typeVar 9340 } 9341 case "location": 9342 if v != nil { 9343 var location string 9344 err = json.Unmarshal(*v, &location) 9345 if err != nil { 9346 return err 9347 } 9348 vme.Location = &location 9349 } 9350 case "tags": 9351 if v != nil { 9352 var tags map[string]*string 9353 err = json.Unmarshal(*v, &tags) 9354 if err != nil { 9355 return err 9356 } 9357 vme.Tags = tags 9358 } 9359 } 9360 } 9361 9362 return nil 9363} 9364 9365// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 9366type VirtualMachineExtensionHandlerInstanceView struct { 9367 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9368 Type *string `json:"type,omitempty"` 9369 // TypeHandlerVersion - Specifies the version of the script handler. 9370 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9371 // Status - The extension handler status. 9372 Status *InstanceViewStatus `json:"status,omitempty"` 9373} 9374 9375// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 9376type VirtualMachineExtensionImage struct { 9377 autorest.Response `json:"-"` 9378 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 9379 // ID - READ-ONLY; Resource Id 9380 ID *string `json:"id,omitempty"` 9381 // Name - READ-ONLY; Resource name 9382 Name *string `json:"name,omitempty"` 9383 // Type - READ-ONLY; Resource type 9384 Type *string `json:"type,omitempty"` 9385 // Location - Resource location 9386 Location *string `json:"location,omitempty"` 9387 // Tags - Resource tags 9388 Tags map[string]*string `json:"tags"` 9389} 9390 9391// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 9392func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 9393 objectMap := make(map[string]interface{}) 9394 if vmei.VirtualMachineExtensionImageProperties != nil { 9395 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 9396 } 9397 if vmei.Location != nil { 9398 objectMap["location"] = vmei.Location 9399 } 9400 if vmei.Tags != nil { 9401 objectMap["tags"] = vmei.Tags 9402 } 9403 return json.Marshal(objectMap) 9404} 9405 9406// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 9407func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 9408 var m map[string]*json.RawMessage 9409 err := json.Unmarshal(body, &m) 9410 if err != nil { 9411 return err 9412 } 9413 for k, v := range m { 9414 switch k { 9415 case "properties": 9416 if v != nil { 9417 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 9418 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 9419 if err != nil { 9420 return err 9421 } 9422 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 9423 } 9424 case "id": 9425 if v != nil { 9426 var ID string 9427 err = json.Unmarshal(*v, &ID) 9428 if err != nil { 9429 return err 9430 } 9431 vmei.ID = &ID 9432 } 9433 case "name": 9434 if v != nil { 9435 var name string 9436 err = json.Unmarshal(*v, &name) 9437 if err != nil { 9438 return err 9439 } 9440 vmei.Name = &name 9441 } 9442 case "type": 9443 if v != nil { 9444 var typeVar string 9445 err = json.Unmarshal(*v, &typeVar) 9446 if err != nil { 9447 return err 9448 } 9449 vmei.Type = &typeVar 9450 } 9451 case "location": 9452 if v != nil { 9453 var location string 9454 err = json.Unmarshal(*v, &location) 9455 if err != nil { 9456 return err 9457 } 9458 vmei.Location = &location 9459 } 9460 case "tags": 9461 if v != nil { 9462 var tags map[string]*string 9463 err = json.Unmarshal(*v, &tags) 9464 if err != nil { 9465 return err 9466 } 9467 vmei.Tags = tags 9468 } 9469 } 9470 } 9471 9472 return nil 9473} 9474 9475// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 9476type VirtualMachineExtensionImageProperties struct { 9477 // OperatingSystem - The operating system this extension supports. 9478 OperatingSystem *string `json:"operatingSystem,omitempty"` 9479 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 9480 ComputeRole *string `json:"computeRole,omitempty"` 9481 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 9482 HandlerSchema *string `json:"handlerSchema,omitempty"` 9483 // 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. 9484 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 9485 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 9486 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 9487} 9488 9489// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 9490type VirtualMachineExtensionInstanceView struct { 9491 // Name - The virtual machine extension name. 9492 Name *string `json:"name,omitempty"` 9493 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9494 Type *string `json:"type,omitempty"` 9495 // TypeHandlerVersion - Specifies the version of the script handler. 9496 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9497 // Substatuses - The resource status information. 9498 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 9499 // Statuses - The resource status information. 9500 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9501} 9502 9503// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 9504type VirtualMachineExtensionProperties struct { 9505 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 9506 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 9507 // Publisher - The name of the extension handler publisher. 9508 Publisher *string `json:"publisher,omitempty"` 9509 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9510 Type *string `json:"type,omitempty"` 9511 // TypeHandlerVersion - Specifies the version of the script handler. 9512 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9513 // 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. 9514 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 9515 // Settings - Json formatted public settings for the extension. 9516 Settings interface{} `json:"settings,omitempty"` 9517 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 9518 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 9519 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 9520 ProvisioningState *string `json:"provisioningState,omitempty"` 9521 // InstanceView - The virtual machine extension instance view. 9522 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 9523} 9524 9525// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 9526func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 9527 objectMap := make(map[string]interface{}) 9528 if vmep.ForceUpdateTag != nil { 9529 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 9530 } 9531 if vmep.Publisher != nil { 9532 objectMap["publisher"] = vmep.Publisher 9533 } 9534 if vmep.Type != nil { 9535 objectMap["type"] = vmep.Type 9536 } 9537 if vmep.TypeHandlerVersion != nil { 9538 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 9539 } 9540 if vmep.AutoUpgradeMinorVersion != nil { 9541 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 9542 } 9543 if vmep.Settings != nil { 9544 objectMap["settings"] = vmep.Settings 9545 } 9546 if vmep.ProtectedSettings != nil { 9547 objectMap["protectedSettings"] = vmep.ProtectedSettings 9548 } 9549 if vmep.InstanceView != nil { 9550 objectMap["instanceView"] = vmep.InstanceView 9551 } 9552 return json.Marshal(objectMap) 9553} 9554 9555// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 9556// a long-running operation. 9557type VirtualMachineExtensionsCreateOrUpdateFuture struct { 9558 azure.FutureAPI 9559 // Result returns the result of the asynchronous operation. 9560 // If the operation has not completed it will return an error. 9561 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 9562} 9563 9564// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9565func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9566 var azFuture azure.Future 9567 if err := json.Unmarshal(body, &azFuture); err != nil { 9568 return err 9569 } 9570 future.FutureAPI = &azFuture 9571 future.Result = future.result 9572 return nil 9573} 9574 9575// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 9576func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 9577 var done bool 9578 done, err = future.DoneWithContext(context.Background(), client) 9579 if err != nil { 9580 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9581 return 9582 } 9583 if !done { 9584 vme.Response.Response = future.Response() 9585 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 9586 return 9587 } 9588 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9589 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 9590 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 9591 if err != nil { 9592 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 9593 } 9594 } 9595 return 9596} 9597 9598// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 9599// long-running operation. 9600type VirtualMachineExtensionsDeleteFuture struct { 9601 azure.FutureAPI 9602 // Result returns the result of the asynchronous operation. 9603 // If the operation has not completed it will return an error. 9604 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 9605} 9606 9607// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9608func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 9609 var azFuture azure.Future 9610 if err := json.Unmarshal(body, &azFuture); err != nil { 9611 return err 9612 } 9613 future.FutureAPI = &azFuture 9614 future.Result = future.result 9615 return nil 9616} 9617 9618// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 9619func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 9620 var done bool 9621 done, err = future.DoneWithContext(context.Background(), client) 9622 if err != nil { 9623 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 9624 return 9625 } 9626 if !done { 9627 ar.Response = future.Response() 9628 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 9629 return 9630 } 9631 ar.Response = future.Response() 9632 return 9633} 9634 9635// VirtualMachineExtensionsListResult the List Extension operation response 9636type VirtualMachineExtensionsListResult struct { 9637 autorest.Response `json:"-"` 9638 // Value - The list of extensions 9639 Value *[]VirtualMachineExtension `json:"value,omitempty"` 9640} 9641 9642// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 9643// long-running operation. 9644type VirtualMachineExtensionsUpdateFuture struct { 9645 azure.FutureAPI 9646 // Result returns the result of the asynchronous operation. 9647 // If the operation has not completed it will return an error. 9648 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 9649} 9650 9651// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9652func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 9653 var azFuture azure.Future 9654 if err := json.Unmarshal(body, &azFuture); err != nil { 9655 return err 9656 } 9657 future.FutureAPI = &azFuture 9658 future.Result = future.result 9659 return nil 9660} 9661 9662// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 9663func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 9664 var done bool 9665 done, err = future.DoneWithContext(context.Background(), client) 9666 if err != nil { 9667 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 9668 return 9669 } 9670 if !done { 9671 vme.Response.Response = future.Response() 9672 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 9673 return 9674 } 9675 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9676 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 9677 vme, err = client.UpdateResponder(vme.Response.Response) 9678 if err != nil { 9679 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 9680 } 9681 } 9682 return 9683} 9684 9685// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 9686type VirtualMachineExtensionUpdate struct { 9687 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 9688 // Tags - Resource tags 9689 Tags map[string]*string `json:"tags"` 9690} 9691 9692// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 9693func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 9694 objectMap := make(map[string]interface{}) 9695 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 9696 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 9697 } 9698 if vmeu.Tags != nil { 9699 objectMap["tags"] = vmeu.Tags 9700 } 9701 return json.Marshal(objectMap) 9702} 9703 9704// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 9705func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 9706 var m map[string]*json.RawMessage 9707 err := json.Unmarshal(body, &m) 9708 if err != nil { 9709 return err 9710 } 9711 for k, v := range m { 9712 switch k { 9713 case "properties": 9714 if v != nil { 9715 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 9716 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 9717 if err != nil { 9718 return err 9719 } 9720 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 9721 } 9722 case "tags": 9723 if v != nil { 9724 var tags map[string]*string 9725 err = json.Unmarshal(*v, &tags) 9726 if err != nil { 9727 return err 9728 } 9729 vmeu.Tags = tags 9730 } 9731 } 9732 } 9733 9734 return nil 9735} 9736 9737// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 9738type VirtualMachineExtensionUpdateProperties struct { 9739 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 9740 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 9741 // Publisher - The name of the extension handler publisher. 9742 Publisher *string `json:"publisher,omitempty"` 9743 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9744 Type *string `json:"type,omitempty"` 9745 // TypeHandlerVersion - Specifies the version of the script handler. 9746 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9747 // 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. 9748 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 9749 // Settings - Json formatted public settings for the extension. 9750 Settings interface{} `json:"settings,omitempty"` 9751 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 9752 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 9753} 9754 9755// VirtualMachineHealthStatus the health status of the VM. 9756type VirtualMachineHealthStatus struct { 9757 // Status - READ-ONLY; The health status information for the VM. 9758 Status *InstanceViewStatus `json:"status,omitempty"` 9759} 9760 9761// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. 9762func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { 9763 objectMap := make(map[string]interface{}) 9764 return json.Marshal(objectMap) 9765} 9766 9767// VirtualMachineIdentity identity for the virtual machine. 9768type VirtualMachineIdentity struct { 9769 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 9770 PrincipalID *string `json:"principalId,omitempty"` 9771 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 9772 TenantID *string `json:"tenantId,omitempty"` 9773 // 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' 9774 Type ResourceIdentityType `json:"type,omitempty"` 9775 // 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}'. 9776 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 9777} 9778 9779// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 9780func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 9781 objectMap := make(map[string]interface{}) 9782 if vmi.Type != "" { 9783 objectMap["type"] = vmi.Type 9784 } 9785 if vmi.UserAssignedIdentities != nil { 9786 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 9787 } 9788 return json.Marshal(objectMap) 9789} 9790 9791// VirtualMachineIdentityUserAssignedIdentitiesValue ... 9792type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 9793 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 9794 PrincipalID *string `json:"principalId,omitempty"` 9795 // ClientID - READ-ONLY; The client id of user assigned identity. 9796 ClientID *string `json:"clientId,omitempty"` 9797} 9798 9799// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. 9800func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 9801 objectMap := make(map[string]interface{}) 9802 return json.Marshal(objectMap) 9803} 9804 9805// VirtualMachineImage describes a Virtual Machine Image. 9806type VirtualMachineImage struct { 9807 autorest.Response `json:"-"` 9808 *VirtualMachineImageProperties `json:"properties,omitempty"` 9809 // Name - The name of the resource. 9810 Name *string `json:"name,omitempty"` 9811 // Location - The supported Azure location of the resource. 9812 Location *string `json:"location,omitempty"` 9813 // 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). 9814 Tags map[string]*string `json:"tags"` 9815 // ID - Resource Id 9816 ID *string `json:"id,omitempty"` 9817} 9818 9819// MarshalJSON is the custom marshaler for VirtualMachineImage. 9820func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 9821 objectMap := make(map[string]interface{}) 9822 if vmi.VirtualMachineImageProperties != nil { 9823 objectMap["properties"] = vmi.VirtualMachineImageProperties 9824 } 9825 if vmi.Name != nil { 9826 objectMap["name"] = vmi.Name 9827 } 9828 if vmi.Location != nil { 9829 objectMap["location"] = vmi.Location 9830 } 9831 if vmi.Tags != nil { 9832 objectMap["tags"] = vmi.Tags 9833 } 9834 if vmi.ID != nil { 9835 objectMap["id"] = vmi.ID 9836 } 9837 return json.Marshal(objectMap) 9838} 9839 9840// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 9841func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 9842 var m map[string]*json.RawMessage 9843 err := json.Unmarshal(body, &m) 9844 if err != nil { 9845 return err 9846 } 9847 for k, v := range m { 9848 switch k { 9849 case "properties": 9850 if v != nil { 9851 var virtualMachineImageProperties VirtualMachineImageProperties 9852 err = json.Unmarshal(*v, &virtualMachineImageProperties) 9853 if err != nil { 9854 return err 9855 } 9856 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 9857 } 9858 case "name": 9859 if v != nil { 9860 var name string 9861 err = json.Unmarshal(*v, &name) 9862 if err != nil { 9863 return err 9864 } 9865 vmi.Name = &name 9866 } 9867 case "location": 9868 if v != nil { 9869 var location string 9870 err = json.Unmarshal(*v, &location) 9871 if err != nil { 9872 return err 9873 } 9874 vmi.Location = &location 9875 } 9876 case "tags": 9877 if v != nil { 9878 var tags map[string]*string 9879 err = json.Unmarshal(*v, &tags) 9880 if err != nil { 9881 return err 9882 } 9883 vmi.Tags = tags 9884 } 9885 case "id": 9886 if v != nil { 9887 var ID string 9888 err = json.Unmarshal(*v, &ID) 9889 if err != nil { 9890 return err 9891 } 9892 vmi.ID = &ID 9893 } 9894 } 9895 } 9896 9897 return nil 9898} 9899 9900// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 9901type VirtualMachineImageProperties struct { 9902 Plan *PurchasePlan `json:"plan,omitempty"` 9903 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 9904 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 9905 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 9906 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 9907 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 9908} 9909 9910// VirtualMachineImageResource virtual machine image resource information. 9911type VirtualMachineImageResource struct { 9912 // Name - The name of the resource. 9913 Name *string `json:"name,omitempty"` 9914 // Location - The supported Azure location of the resource. 9915 Location *string `json:"location,omitempty"` 9916 // 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). 9917 Tags map[string]*string `json:"tags"` 9918 // ID - Resource Id 9919 ID *string `json:"id,omitempty"` 9920} 9921 9922// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 9923func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 9924 objectMap := make(map[string]interface{}) 9925 if vmir.Name != nil { 9926 objectMap["name"] = vmir.Name 9927 } 9928 if vmir.Location != nil { 9929 objectMap["location"] = vmir.Location 9930 } 9931 if vmir.Tags != nil { 9932 objectMap["tags"] = vmir.Tags 9933 } 9934 if vmir.ID != nil { 9935 objectMap["id"] = vmir.ID 9936 } 9937 return json.Marshal(objectMap) 9938} 9939 9940// VirtualMachineInstanceView the instance view of a virtual machine. 9941type VirtualMachineInstanceView struct { 9942 autorest.Response `json:"-"` 9943 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 9944 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 9945 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 9946 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 9947 // ComputerName - The computer name assigned to the virtual machine. 9948 ComputerName *string `json:"computerName,omitempty"` 9949 // OsName - The Operating System running on the virtual machine. 9950 OsName *string `json:"osName,omitempty"` 9951 // OsVersion - The version of Operating System running on the virtual machine. 9952 OsVersion *string `json:"osVersion,omitempty"` 9953 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 9954 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 9955 // RdpThumbPrint - The Remote desktop certificate thumbprint. 9956 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 9957 // VMAgent - The VM Agent running on the virtual machine. 9958 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 9959 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 9960 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 9961 // Disks - The virtual machine disk information. 9962 Disks *[]DiskInstanceView `json:"disks,omitempty"` 9963 // Extensions - The extensions information. 9964 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 9965 // 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. 9966 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 9967 // Statuses - The resource status information. 9968 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9969} 9970 9971// VirtualMachineListResult the List Virtual Machine operation response. 9972type VirtualMachineListResult struct { 9973 autorest.Response `json:"-"` 9974 // Value - The list of virtual machines. 9975 Value *[]VirtualMachine `json:"value,omitempty"` 9976 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 9977 NextLink *string `json:"nextLink,omitempty"` 9978} 9979 9980// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 9981type VirtualMachineListResultIterator struct { 9982 i int 9983 page VirtualMachineListResultPage 9984} 9985 9986// NextWithContext advances to the next value. If there was an error making 9987// the request the iterator does not advance and the error is returned. 9988func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 9989 if tracing.IsEnabled() { 9990 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 9991 defer func() { 9992 sc := -1 9993 if iter.Response().Response.Response != nil { 9994 sc = iter.Response().Response.Response.StatusCode 9995 } 9996 tracing.EndSpan(ctx, sc, err) 9997 }() 9998 } 9999 iter.i++ 10000 if iter.i < len(iter.page.Values()) { 10001 return nil 10002 } 10003 err = iter.page.NextWithContext(ctx) 10004 if err != nil { 10005 iter.i-- 10006 return err 10007 } 10008 iter.i = 0 10009 return nil 10010} 10011 10012// Next advances to the next value. If there was an error making 10013// the request the iterator does not advance and the error is returned. 10014// Deprecated: Use NextWithContext() instead. 10015func (iter *VirtualMachineListResultIterator) Next() error { 10016 return iter.NextWithContext(context.Background()) 10017} 10018 10019// NotDone returns true if the enumeration should be started or is not yet complete. 10020func (iter VirtualMachineListResultIterator) NotDone() bool { 10021 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10022} 10023 10024// Response returns the raw server response from the last page request. 10025func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 10026 return iter.page.Response() 10027} 10028 10029// Value returns the current value or a zero-initialized value if the 10030// iterator has advanced beyond the end of the collection. 10031func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 10032 if !iter.page.NotDone() { 10033 return VirtualMachine{} 10034 } 10035 return iter.page.Values()[iter.i] 10036} 10037 10038// Creates a new instance of the VirtualMachineListResultIterator type. 10039func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 10040 return VirtualMachineListResultIterator{page: page} 10041} 10042 10043// IsEmpty returns true if the ListResult contains no values. 10044func (vmlr VirtualMachineListResult) IsEmpty() bool { 10045 return vmlr.Value == nil || len(*vmlr.Value) == 0 10046} 10047 10048// hasNextLink returns true if the NextLink is not empty. 10049func (vmlr VirtualMachineListResult) hasNextLink() bool { 10050 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 10051} 10052 10053// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 10054// It returns nil if no more results exist. 10055func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 10056 if !vmlr.hasNextLink() { 10057 return nil, nil 10058 } 10059 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10060 autorest.AsJSON(), 10061 autorest.AsGet(), 10062 autorest.WithBaseURL(to.String(vmlr.NextLink))) 10063} 10064 10065// VirtualMachineListResultPage contains a page of VirtualMachine values. 10066type VirtualMachineListResultPage struct { 10067 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 10068 vmlr VirtualMachineListResult 10069} 10070 10071// NextWithContext advances to the next page of values. If there was an error making 10072// the request the page does not advance and the error is returned. 10073func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 10074 if tracing.IsEnabled() { 10075 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 10076 defer func() { 10077 sc := -1 10078 if page.Response().Response.Response != nil { 10079 sc = page.Response().Response.Response.StatusCode 10080 } 10081 tracing.EndSpan(ctx, sc, err) 10082 }() 10083 } 10084 for { 10085 next, err := page.fn(ctx, page.vmlr) 10086 if err != nil { 10087 return err 10088 } 10089 page.vmlr = next 10090 if !next.hasNextLink() || !next.IsEmpty() { 10091 break 10092 } 10093 } 10094 return nil 10095} 10096 10097// Next advances to the next page of values. If there was an error making 10098// the request the page does not advance and the error is returned. 10099// Deprecated: Use NextWithContext() instead. 10100func (page *VirtualMachineListResultPage) Next() error { 10101 return page.NextWithContext(context.Background()) 10102} 10103 10104// NotDone returns true if the page enumeration should be started or is not yet complete. 10105func (page VirtualMachineListResultPage) NotDone() bool { 10106 return !page.vmlr.IsEmpty() 10107} 10108 10109// Response returns the raw server response from the last page request. 10110func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 10111 return page.vmlr 10112} 10113 10114// Values returns the slice of values for the current page or nil if there are no values. 10115func (page VirtualMachineListResultPage) Values() []VirtualMachine { 10116 if page.vmlr.IsEmpty() { 10117 return nil 10118 } 10119 return *page.vmlr.Value 10120} 10121 10122// Creates a new instance of the VirtualMachineListResultPage type. 10123func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 10124 return VirtualMachineListResultPage{ 10125 fn: getNextPage, 10126 vmlr: cur, 10127 } 10128} 10129 10130// VirtualMachineProperties describes the properties of a Virtual Machine. 10131type VirtualMachineProperties struct { 10132 // HardwareProfile - Specifies the hardware settings for the virtual machine. 10133 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 10134 // StorageProfile - Specifies the storage settings for the virtual machine disks. 10135 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 10136 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 10137 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10138 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 10139 OsProfile *OSProfile `json:"osProfile,omitempty"` 10140 // NetworkProfile - Specifies the network interfaces of the virtual machine. 10141 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 10142 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 10143 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 10144 // 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. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. 10145 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 10146 // VirtualMachineScaleSet - Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum api‐version: 2019‐03‐01 10147 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 10148 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 10149 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 10150 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' 10151 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 10152 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 10153 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 10154 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 10155 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 10156 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 10157 Host *SubResource `json:"host,omitempty"` 10158 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10159 ProvisioningState *string `json:"provisioningState,omitempty"` 10160 // InstanceView - READ-ONLY; The virtual machine instance view. 10161 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 10162 // 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 10163 LicenseType *string `json:"licenseType,omitempty"` 10164 // 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. 10165 VMID *string `json:"vmId,omitempty"` 10166} 10167 10168// MarshalJSON is the custom marshaler for VirtualMachineProperties. 10169func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 10170 objectMap := make(map[string]interface{}) 10171 if vmp.HardwareProfile != nil { 10172 objectMap["hardwareProfile"] = vmp.HardwareProfile 10173 } 10174 if vmp.StorageProfile != nil { 10175 objectMap["storageProfile"] = vmp.StorageProfile 10176 } 10177 if vmp.AdditionalCapabilities != nil { 10178 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 10179 } 10180 if vmp.OsProfile != nil { 10181 objectMap["osProfile"] = vmp.OsProfile 10182 } 10183 if vmp.NetworkProfile != nil { 10184 objectMap["networkProfile"] = vmp.NetworkProfile 10185 } 10186 if vmp.DiagnosticsProfile != nil { 10187 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 10188 } 10189 if vmp.AvailabilitySet != nil { 10190 objectMap["availabilitySet"] = vmp.AvailabilitySet 10191 } 10192 if vmp.VirtualMachineScaleSet != nil { 10193 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 10194 } 10195 if vmp.ProximityPlacementGroup != nil { 10196 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 10197 } 10198 if vmp.Priority != "" { 10199 objectMap["priority"] = vmp.Priority 10200 } 10201 if vmp.EvictionPolicy != "" { 10202 objectMap["evictionPolicy"] = vmp.EvictionPolicy 10203 } 10204 if vmp.BillingProfile != nil { 10205 objectMap["billingProfile"] = vmp.BillingProfile 10206 } 10207 if vmp.Host != nil { 10208 objectMap["host"] = vmp.Host 10209 } 10210 if vmp.LicenseType != nil { 10211 objectMap["licenseType"] = vmp.LicenseType 10212 } 10213 return json.Marshal(objectMap) 10214} 10215 10216// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 10217// will always be reimaged 10218type VirtualMachineReimageParameters struct { 10219 // 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. 10220 TempDisk *bool `json:"tempDisk,omitempty"` 10221} 10222 10223// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 10224type VirtualMachineScaleSet struct { 10225 autorest.Response `json:"-"` 10226 // Sku - The virtual machine scale set sku. 10227 Sku *Sku `json:"sku,omitempty"` 10228 // 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**. 10229 Plan *Plan `json:"plan,omitempty"` 10230 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 10231 // Identity - The identity of the virtual machine scale set, if configured. 10232 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 10233 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. 10234 Zones *[]string `json:"zones,omitempty"` 10235 // ID - READ-ONLY; Resource Id 10236 ID *string `json:"id,omitempty"` 10237 // Name - READ-ONLY; Resource name 10238 Name *string `json:"name,omitempty"` 10239 // Type - READ-ONLY; Resource type 10240 Type *string `json:"type,omitempty"` 10241 // Location - Resource location 10242 Location *string `json:"location,omitempty"` 10243 // Tags - Resource tags 10244 Tags map[string]*string `json:"tags"` 10245} 10246 10247// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 10248func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 10249 objectMap := make(map[string]interface{}) 10250 if vmss.Sku != nil { 10251 objectMap["sku"] = vmss.Sku 10252 } 10253 if vmss.Plan != nil { 10254 objectMap["plan"] = vmss.Plan 10255 } 10256 if vmss.VirtualMachineScaleSetProperties != nil { 10257 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 10258 } 10259 if vmss.Identity != nil { 10260 objectMap["identity"] = vmss.Identity 10261 } 10262 if vmss.Zones != nil { 10263 objectMap["zones"] = vmss.Zones 10264 } 10265 if vmss.Location != nil { 10266 objectMap["location"] = vmss.Location 10267 } 10268 if vmss.Tags != nil { 10269 objectMap["tags"] = vmss.Tags 10270 } 10271 return json.Marshal(objectMap) 10272} 10273 10274// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 10275func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 10276 var m map[string]*json.RawMessage 10277 err := json.Unmarshal(body, &m) 10278 if err != nil { 10279 return err 10280 } 10281 for k, v := range m { 10282 switch k { 10283 case "sku": 10284 if v != nil { 10285 var sku Sku 10286 err = json.Unmarshal(*v, &sku) 10287 if err != nil { 10288 return err 10289 } 10290 vmss.Sku = &sku 10291 } 10292 case "plan": 10293 if v != nil { 10294 var plan Plan 10295 err = json.Unmarshal(*v, &plan) 10296 if err != nil { 10297 return err 10298 } 10299 vmss.Plan = &plan 10300 } 10301 case "properties": 10302 if v != nil { 10303 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 10304 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 10305 if err != nil { 10306 return err 10307 } 10308 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 10309 } 10310 case "identity": 10311 if v != nil { 10312 var identity VirtualMachineScaleSetIdentity 10313 err = json.Unmarshal(*v, &identity) 10314 if err != nil { 10315 return err 10316 } 10317 vmss.Identity = &identity 10318 } 10319 case "zones": 10320 if v != nil { 10321 var zones []string 10322 err = json.Unmarshal(*v, &zones) 10323 if err != nil { 10324 return err 10325 } 10326 vmss.Zones = &zones 10327 } 10328 case "id": 10329 if v != nil { 10330 var ID string 10331 err = json.Unmarshal(*v, &ID) 10332 if err != nil { 10333 return err 10334 } 10335 vmss.ID = &ID 10336 } 10337 case "name": 10338 if v != nil { 10339 var name string 10340 err = json.Unmarshal(*v, &name) 10341 if err != nil { 10342 return err 10343 } 10344 vmss.Name = &name 10345 } 10346 case "type": 10347 if v != nil { 10348 var typeVar string 10349 err = json.Unmarshal(*v, &typeVar) 10350 if err != nil { 10351 return err 10352 } 10353 vmss.Type = &typeVar 10354 } 10355 case "location": 10356 if v != nil { 10357 var location string 10358 err = json.Unmarshal(*v, &location) 10359 if err != nil { 10360 return err 10361 } 10362 vmss.Location = &location 10363 } 10364 case "tags": 10365 if v != nil { 10366 var tags map[string]*string 10367 err = json.Unmarshal(*v, &tags) 10368 if err != nil { 10369 return err 10370 } 10371 vmss.Tags = tags 10372 } 10373 } 10374 } 10375 10376 return nil 10377} 10378 10379// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 10380type VirtualMachineScaleSetDataDisk struct { 10381 // Name - The disk name. 10382 Name *string `json:"name,omitempty"` 10383 // 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. 10384 Lun *int32 `json:"lun,omitempty"` 10385 // 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' 10386 Caching CachingTypes `json:"caching,omitempty"` 10387 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 10388 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 10389 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 10390 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 10391 // 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 10392 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10393 // ManagedDisk - The managed disk parameters. 10394 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 10395 // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. 10396 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 10397 // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. 10398 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 10399} 10400 10401// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 10402type VirtualMachineScaleSetExtension struct { 10403 autorest.Response `json:"-"` 10404 // Name - The name of the extension. 10405 Name *string `json:"name,omitempty"` 10406 // Type - READ-ONLY; Resource type 10407 Type *string `json:"type,omitempty"` 10408 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 10409 // ID - READ-ONLY; Resource Id 10410 ID *string `json:"id,omitempty"` 10411} 10412 10413// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 10414func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 10415 objectMap := make(map[string]interface{}) 10416 if vmsse.Name != nil { 10417 objectMap["name"] = vmsse.Name 10418 } 10419 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 10420 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 10421 } 10422 return json.Marshal(objectMap) 10423} 10424 10425// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 10426func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 10427 var m map[string]*json.RawMessage 10428 err := json.Unmarshal(body, &m) 10429 if err != nil { 10430 return err 10431 } 10432 for k, v := range m { 10433 switch k { 10434 case "name": 10435 if v != nil { 10436 var name string 10437 err = json.Unmarshal(*v, &name) 10438 if err != nil { 10439 return err 10440 } 10441 vmsse.Name = &name 10442 } 10443 case "type": 10444 if v != nil { 10445 var typeVar string 10446 err = json.Unmarshal(*v, &typeVar) 10447 if err != nil { 10448 return err 10449 } 10450 vmsse.Type = &typeVar 10451 } 10452 case "properties": 10453 if v != nil { 10454 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 10455 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 10456 if err != nil { 10457 return err 10458 } 10459 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 10460 } 10461 case "id": 10462 if v != nil { 10463 var ID string 10464 err = json.Unmarshal(*v, &ID) 10465 if err != nil { 10466 return err 10467 } 10468 vmsse.ID = &ID 10469 } 10470 } 10471 } 10472 10473 return nil 10474} 10475 10476// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 10477type VirtualMachineScaleSetExtensionListResult struct { 10478 autorest.Response `json:"-"` 10479 // Value - The list of VM scale set extensions. 10480 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 10481 // 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. 10482 NextLink *string `json:"nextLink,omitempty"` 10483} 10484 10485// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 10486// VirtualMachineScaleSetExtension values. 10487type VirtualMachineScaleSetExtensionListResultIterator struct { 10488 i int 10489 page VirtualMachineScaleSetExtensionListResultPage 10490} 10491 10492// NextWithContext advances to the next value. If there was an error making 10493// the request the iterator does not advance and the error is returned. 10494func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 10495 if tracing.IsEnabled() { 10496 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 10497 defer func() { 10498 sc := -1 10499 if iter.Response().Response.Response != nil { 10500 sc = iter.Response().Response.Response.StatusCode 10501 } 10502 tracing.EndSpan(ctx, sc, err) 10503 }() 10504 } 10505 iter.i++ 10506 if iter.i < len(iter.page.Values()) { 10507 return nil 10508 } 10509 err = iter.page.NextWithContext(ctx) 10510 if err != nil { 10511 iter.i-- 10512 return err 10513 } 10514 iter.i = 0 10515 return nil 10516} 10517 10518// Next advances to the next value. If there was an error making 10519// the request the iterator does not advance and the error is returned. 10520// Deprecated: Use NextWithContext() instead. 10521func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 10522 return iter.NextWithContext(context.Background()) 10523} 10524 10525// NotDone returns true if the enumeration should be started or is not yet complete. 10526func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 10527 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10528} 10529 10530// Response returns the raw server response from the last page request. 10531func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 10532 return iter.page.Response() 10533} 10534 10535// Value returns the current value or a zero-initialized value if the 10536// iterator has advanced beyond the end of the collection. 10537func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 10538 if !iter.page.NotDone() { 10539 return VirtualMachineScaleSetExtension{} 10540 } 10541 return iter.page.Values()[iter.i] 10542} 10543 10544// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 10545func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 10546 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 10547} 10548 10549// IsEmpty returns true if the ListResult contains no values. 10550func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 10551 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 10552} 10553 10554// hasNextLink returns true if the NextLink is not empty. 10555func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 10556 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 10557} 10558 10559// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 10560// It returns nil if no more results exist. 10561func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 10562 if !vmsselr.hasNextLink() { 10563 return nil, nil 10564 } 10565 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10566 autorest.AsJSON(), 10567 autorest.AsGet(), 10568 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 10569} 10570 10571// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 10572type VirtualMachineScaleSetExtensionListResultPage struct { 10573 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 10574 vmsselr VirtualMachineScaleSetExtensionListResult 10575} 10576 10577// NextWithContext advances to the next page of values. If there was an error making 10578// the request the page does not advance and the error is returned. 10579func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 10580 if tracing.IsEnabled() { 10581 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 10582 defer func() { 10583 sc := -1 10584 if page.Response().Response.Response != nil { 10585 sc = page.Response().Response.Response.StatusCode 10586 } 10587 tracing.EndSpan(ctx, sc, err) 10588 }() 10589 } 10590 for { 10591 next, err := page.fn(ctx, page.vmsselr) 10592 if err != nil { 10593 return err 10594 } 10595 page.vmsselr = next 10596 if !next.hasNextLink() || !next.IsEmpty() { 10597 break 10598 } 10599 } 10600 return nil 10601} 10602 10603// Next advances to the next page of values. If there was an error making 10604// the request the page does not advance and the error is returned. 10605// Deprecated: Use NextWithContext() instead. 10606func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 10607 return page.NextWithContext(context.Background()) 10608} 10609 10610// NotDone returns true if the page enumeration should be started or is not yet complete. 10611func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 10612 return !page.vmsselr.IsEmpty() 10613} 10614 10615// Response returns the raw server response from the last page request. 10616func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 10617 return page.vmsselr 10618} 10619 10620// Values returns the slice of values for the current page or nil if there are no values. 10621func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 10622 if page.vmsselr.IsEmpty() { 10623 return nil 10624 } 10625 return *page.vmsselr.Value 10626} 10627 10628// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 10629func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 10630 return VirtualMachineScaleSetExtensionListResultPage{ 10631 fn: getNextPage, 10632 vmsselr: cur, 10633 } 10634} 10635 10636// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 10637type VirtualMachineScaleSetExtensionProfile struct { 10638 // Extensions - The virtual machine scale set child extension resources. 10639 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 10640} 10641 10642// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 10643// Extension. 10644type VirtualMachineScaleSetExtensionProperties struct { 10645 // 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. 10646 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 10647 // Publisher - The name of the extension handler publisher. 10648 Publisher *string `json:"publisher,omitempty"` 10649 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 10650 Type *string `json:"type,omitempty"` 10651 // TypeHandlerVersion - Specifies the version of the script handler. 10652 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 10653 // 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. 10654 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 10655 // Settings - Json formatted public settings for the extension. 10656 Settings interface{} `json:"settings,omitempty"` 10657 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 10658 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 10659 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10660 ProvisioningState *string `json:"provisioningState,omitempty"` 10661 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 10662 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 10663} 10664 10665// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 10666func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 10667 objectMap := make(map[string]interface{}) 10668 if vmssep.ForceUpdateTag != nil { 10669 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 10670 } 10671 if vmssep.Publisher != nil { 10672 objectMap["publisher"] = vmssep.Publisher 10673 } 10674 if vmssep.Type != nil { 10675 objectMap["type"] = vmssep.Type 10676 } 10677 if vmssep.TypeHandlerVersion != nil { 10678 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 10679 } 10680 if vmssep.AutoUpgradeMinorVersion != nil { 10681 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 10682 } 10683 if vmssep.Settings != nil { 10684 objectMap["settings"] = vmssep.Settings 10685 } 10686 if vmssep.ProtectedSettings != nil { 10687 objectMap["protectedSettings"] = vmssep.ProtectedSettings 10688 } 10689 if vmssep.ProvisionAfterExtensions != nil { 10690 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 10691 } 10692 return json.Marshal(objectMap) 10693} 10694 10695// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 10696// results of a long-running operation. 10697type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 10698 azure.FutureAPI 10699 // Result returns the result of the asynchronous operation. 10700 // If the operation has not completed it will return an error. 10701 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 10702} 10703 10704// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10705func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10706 var azFuture azure.Future 10707 if err := json.Unmarshal(body, &azFuture); err != nil { 10708 return err 10709 } 10710 future.FutureAPI = &azFuture 10711 future.Result = future.result 10712 return nil 10713} 10714 10715// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 10716func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 10717 var done bool 10718 done, err = future.DoneWithContext(context.Background(), client) 10719 if err != nil { 10720 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10721 return 10722 } 10723 if !done { 10724 vmsse.Response.Response = future.Response() 10725 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 10726 return 10727 } 10728 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10729 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 10730 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 10731 if err != nil { 10732 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 10733 } 10734 } 10735 return 10736} 10737 10738// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 10739// a long-running operation. 10740type VirtualMachineScaleSetExtensionsDeleteFuture struct { 10741 azure.FutureAPI 10742 // Result returns the result of the asynchronous operation. 10743 // If the operation has not completed it will return an error. 10744 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 10745} 10746 10747// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10748func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 10749 var azFuture azure.Future 10750 if err := json.Unmarshal(body, &azFuture); err != nil { 10751 return err 10752 } 10753 future.FutureAPI = &azFuture 10754 future.Result = future.result 10755 return nil 10756} 10757 10758// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 10759func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 10760 var done bool 10761 done, err = future.DoneWithContext(context.Background(), client) 10762 if err != nil { 10763 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 10764 return 10765 } 10766 if !done { 10767 ar.Response = future.Response() 10768 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 10769 return 10770 } 10771 ar.Response = future.Response() 10772 return 10773} 10774 10775// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 10776// a long-running operation. 10777type VirtualMachineScaleSetExtensionsUpdateFuture struct { 10778 azure.FutureAPI 10779 // Result returns the result of the asynchronous operation. 10780 // If the operation has not completed it will return an error. 10781 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 10782} 10783 10784// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10785func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 10786 var azFuture azure.Future 10787 if err := json.Unmarshal(body, &azFuture); err != nil { 10788 return err 10789 } 10790 future.FutureAPI = &azFuture 10791 future.Result = future.result 10792 return nil 10793} 10794 10795// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. 10796func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 10797 var done bool 10798 done, err = future.DoneWithContext(context.Background(), client) 10799 if err != nil { 10800 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 10801 return 10802 } 10803 if !done { 10804 vmsse.Response.Response = future.Response() 10805 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") 10806 return 10807 } 10808 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10809 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 10810 vmsse, err = client.UpdateResponder(vmsse.Response.Response) 10811 if err != nil { 10812 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 10813 } 10814 } 10815 return 10816} 10817 10818// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 10819type VirtualMachineScaleSetExtensionUpdate struct { 10820 // Name - READ-ONLY; The name of the extension. 10821 Name *string `json:"name,omitempty"` 10822 // Type - READ-ONLY; Resource type 10823 Type *string `json:"type,omitempty"` 10824 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 10825 // ID - READ-ONLY; Resource Id 10826 ID *string `json:"id,omitempty"` 10827} 10828 10829// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 10830func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 10831 objectMap := make(map[string]interface{}) 10832 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 10833 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 10834 } 10835 return json.Marshal(objectMap) 10836} 10837 10838// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 10839func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 10840 var m map[string]*json.RawMessage 10841 err := json.Unmarshal(body, &m) 10842 if err != nil { 10843 return err 10844 } 10845 for k, v := range m { 10846 switch k { 10847 case "name": 10848 if v != nil { 10849 var name string 10850 err = json.Unmarshal(*v, &name) 10851 if err != nil { 10852 return err 10853 } 10854 vmsseu.Name = &name 10855 } 10856 case "type": 10857 if v != nil { 10858 var typeVar string 10859 err = json.Unmarshal(*v, &typeVar) 10860 if err != nil { 10861 return err 10862 } 10863 vmsseu.Type = &typeVar 10864 } 10865 case "properties": 10866 if v != nil { 10867 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 10868 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 10869 if err != nil { 10870 return err 10871 } 10872 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 10873 } 10874 case "id": 10875 if v != nil { 10876 var ID string 10877 err = json.Unmarshal(*v, &ID) 10878 if err != nil { 10879 return err 10880 } 10881 vmsseu.ID = &ID 10882 } 10883 } 10884 } 10885 10886 return nil 10887} 10888 10889// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 10890type VirtualMachineScaleSetIdentity struct { 10891 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 10892 PrincipalID *string `json:"principalId,omitempty"` 10893 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 10894 TenantID *string `json:"tenantId,omitempty"` 10895 // 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' 10896 Type ResourceIdentityType `json:"type,omitempty"` 10897 // 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}'. 10898 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 10899} 10900 10901// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 10902func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 10903 objectMap := make(map[string]interface{}) 10904 if vmssi.Type != "" { 10905 objectMap["type"] = vmssi.Type 10906 } 10907 if vmssi.UserAssignedIdentities != nil { 10908 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 10909 } 10910 return json.Marshal(objectMap) 10911} 10912 10913// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 10914type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 10915 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 10916 PrincipalID *string `json:"principalId,omitempty"` 10917 // ClientID - READ-ONLY; The client id of user assigned identity. 10918 ClientID *string `json:"clientId,omitempty"` 10919} 10920 10921// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. 10922func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 10923 objectMap := make(map[string]interface{}) 10924 return json.Marshal(objectMap) 10925} 10926 10927// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 10928type VirtualMachineScaleSetInstanceView struct { 10929 autorest.Response `json:"-"` 10930 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 10931 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 10932 // Extensions - READ-ONLY; The extensions information. 10933 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 10934 // Statuses - The resource status information. 10935 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 10936} 10937 10938// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 10939func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 10940 objectMap := make(map[string]interface{}) 10941 if vmssiv.Statuses != nil { 10942 objectMap["statuses"] = vmssiv.Statuses 10943 } 10944 return json.Marshal(objectMap) 10945} 10946 10947// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 10948// a virtual machine scale set. 10949type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 10950 // StatusesSummary - READ-ONLY; The extensions information. 10951 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 10952} 10953 10954// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. 10955func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 10956 objectMap := make(map[string]interface{}) 10957 return json.Marshal(objectMap) 10958} 10959 10960// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 10961// configuration. 10962type VirtualMachineScaleSetIPConfiguration struct { 10963 // Name - The IP configuration name. 10964 Name *string `json:"name,omitempty"` 10965 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 10966 // ID - Resource Id 10967 ID *string `json:"id,omitempty"` 10968} 10969 10970// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 10971func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 10972 objectMap := make(map[string]interface{}) 10973 if vmssic.Name != nil { 10974 objectMap["name"] = vmssic.Name 10975 } 10976 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 10977 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 10978 } 10979 if vmssic.ID != nil { 10980 objectMap["id"] = vmssic.ID 10981 } 10982 return json.Marshal(objectMap) 10983} 10984 10985// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 10986func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 10987 var m map[string]*json.RawMessage 10988 err := json.Unmarshal(body, &m) 10989 if err != nil { 10990 return err 10991 } 10992 for k, v := range m { 10993 switch k { 10994 case "name": 10995 if v != nil { 10996 var name string 10997 err = json.Unmarshal(*v, &name) 10998 if err != nil { 10999 return err 11000 } 11001 vmssic.Name = &name 11002 } 11003 case "properties": 11004 if v != nil { 11005 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 11006 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 11007 if err != nil { 11008 return err 11009 } 11010 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 11011 } 11012 case "id": 11013 if v != nil { 11014 var ID string 11015 err = json.Unmarshal(*v, &ID) 11016 if err != nil { 11017 return err 11018 } 11019 vmssic.ID = &ID 11020 } 11021 } 11022 } 11023 11024 return nil 11025} 11026 11027// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 11028// IP configuration properties. 11029type VirtualMachineScaleSetIPConfigurationProperties struct { 11030 // Subnet - Specifies the identifier of the subnet. 11031 Subnet *APIEntityReference `json:"subnet,omitempty"` 11032 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 11033 Primary *bool `json:"primary,omitempty"` 11034 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 11035 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 11036 // 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' 11037 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 11038 // 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. 11039 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 11040 // ApplicationSecurityGroups - Specifies an array of references to application security group. 11041 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 11042 // 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. 11043 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 11044 // 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 11045 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 11046} 11047 11048// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 11049type VirtualMachineScaleSetIPTag struct { 11050 // IPTagType - IP tag type. Example: FirstPartyUsage. 11051 IPTagType *string `json:"ipTagType,omitempty"` 11052 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 11053 Tag *string `json:"tag,omitempty"` 11054} 11055 11056// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 11057// operation response. 11058type VirtualMachineScaleSetListOSUpgradeHistory struct { 11059 autorest.Response `json:"-"` 11060 // Value - The list of OS upgrades performed on the virtual machine scale set. 11061 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 11062 // 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. 11063 NextLink *string `json:"nextLink,omitempty"` 11064} 11065 11066// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 11067// UpgradeOperationHistoricalStatusInfo values. 11068type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 11069 i int 11070 page VirtualMachineScaleSetListOSUpgradeHistoryPage 11071} 11072 11073// NextWithContext advances to the next value. If there was an error making 11074// the request the iterator does not advance and the error is returned. 11075func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 11076 if tracing.IsEnabled() { 11077 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 11078 defer func() { 11079 sc := -1 11080 if iter.Response().Response.Response != nil { 11081 sc = iter.Response().Response.Response.StatusCode 11082 } 11083 tracing.EndSpan(ctx, sc, err) 11084 }() 11085 } 11086 iter.i++ 11087 if iter.i < len(iter.page.Values()) { 11088 return nil 11089 } 11090 err = iter.page.NextWithContext(ctx) 11091 if err != nil { 11092 iter.i-- 11093 return err 11094 } 11095 iter.i = 0 11096 return nil 11097} 11098 11099// Next advances to the next value. If there was an error making 11100// the request the iterator does not advance and the error is returned. 11101// Deprecated: Use NextWithContext() instead. 11102func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 11103 return iter.NextWithContext(context.Background()) 11104} 11105 11106// NotDone returns true if the enumeration should be started or is not yet complete. 11107func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 11108 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11109} 11110 11111// Response returns the raw server response from the last page request. 11112func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 11113 return iter.page.Response() 11114} 11115 11116// Value returns the current value or a zero-initialized value if the 11117// iterator has advanced beyond the end of the collection. 11118func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 11119 if !iter.page.NotDone() { 11120 return UpgradeOperationHistoricalStatusInfo{} 11121 } 11122 return iter.page.Values()[iter.i] 11123} 11124 11125// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 11126func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 11127 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 11128} 11129 11130// IsEmpty returns true if the ListResult contains no values. 11131func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 11132 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 11133} 11134 11135// hasNextLink returns true if the NextLink is not empty. 11136func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 11137 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 11138} 11139 11140// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 11141// It returns nil if no more results exist. 11142func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 11143 if !vmsslouh.hasNextLink() { 11144 return nil, nil 11145 } 11146 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11147 autorest.AsJSON(), 11148 autorest.AsGet(), 11149 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 11150} 11151 11152// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 11153// values. 11154type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 11155 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 11156 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 11157} 11158 11159// NextWithContext advances to the next page of values. If there was an error making 11160// the request the page does not advance and the error is returned. 11161func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 11162 if tracing.IsEnabled() { 11163 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 11164 defer func() { 11165 sc := -1 11166 if page.Response().Response.Response != nil { 11167 sc = page.Response().Response.Response.StatusCode 11168 } 11169 tracing.EndSpan(ctx, sc, err) 11170 }() 11171 } 11172 for { 11173 next, err := page.fn(ctx, page.vmsslouh) 11174 if err != nil { 11175 return err 11176 } 11177 page.vmsslouh = next 11178 if !next.hasNextLink() || !next.IsEmpty() { 11179 break 11180 } 11181 } 11182 return nil 11183} 11184 11185// Next advances to the next page of values. If there was an error making 11186// the request the page does not advance and the error is returned. 11187// Deprecated: Use NextWithContext() instead. 11188func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 11189 return page.NextWithContext(context.Background()) 11190} 11191 11192// NotDone returns true if the page enumeration should be started or is not yet complete. 11193func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 11194 return !page.vmsslouh.IsEmpty() 11195} 11196 11197// Response returns the raw server response from the last page request. 11198func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 11199 return page.vmsslouh 11200} 11201 11202// Values returns the slice of values for the current page or nil if there are no values. 11203func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 11204 if page.vmsslouh.IsEmpty() { 11205 return nil 11206 } 11207 return *page.vmsslouh.Value 11208} 11209 11210// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 11211func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 11212 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 11213 fn: getNextPage, 11214 vmsslouh: cur, 11215 } 11216} 11217 11218// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 11219type VirtualMachineScaleSetListResult struct { 11220 autorest.Response `json:"-"` 11221 // Value - The list of virtual machine scale sets. 11222 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 11223 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 11224 NextLink *string `json:"nextLink,omitempty"` 11225} 11226 11227// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 11228// values. 11229type VirtualMachineScaleSetListResultIterator struct { 11230 i int 11231 page VirtualMachineScaleSetListResultPage 11232} 11233 11234// NextWithContext advances to the next value. If there was an error making 11235// the request the iterator does not advance and the error is returned. 11236func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 11237 if tracing.IsEnabled() { 11238 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 11239 defer func() { 11240 sc := -1 11241 if iter.Response().Response.Response != nil { 11242 sc = iter.Response().Response.Response.StatusCode 11243 } 11244 tracing.EndSpan(ctx, sc, err) 11245 }() 11246 } 11247 iter.i++ 11248 if iter.i < len(iter.page.Values()) { 11249 return nil 11250 } 11251 err = iter.page.NextWithContext(ctx) 11252 if err != nil { 11253 iter.i-- 11254 return err 11255 } 11256 iter.i = 0 11257 return nil 11258} 11259 11260// Next advances to the next value. If there was an error making 11261// the request the iterator does not advance and the error is returned. 11262// Deprecated: Use NextWithContext() instead. 11263func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 11264 return iter.NextWithContext(context.Background()) 11265} 11266 11267// NotDone returns true if the enumeration should be started or is not yet complete. 11268func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 11269 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11270} 11271 11272// Response returns the raw server response from the last page request. 11273func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 11274 return iter.page.Response() 11275} 11276 11277// Value returns the current value or a zero-initialized value if the 11278// iterator has advanced beyond the end of the collection. 11279func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 11280 if !iter.page.NotDone() { 11281 return VirtualMachineScaleSet{} 11282 } 11283 return iter.page.Values()[iter.i] 11284} 11285 11286// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 11287func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 11288 return VirtualMachineScaleSetListResultIterator{page: page} 11289} 11290 11291// IsEmpty returns true if the ListResult contains no values. 11292func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 11293 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 11294} 11295 11296// hasNextLink returns true if the NextLink is not empty. 11297func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 11298 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 11299} 11300 11301// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 11302// It returns nil if no more results exist. 11303func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 11304 if !vmsslr.hasNextLink() { 11305 return nil, nil 11306 } 11307 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11308 autorest.AsJSON(), 11309 autorest.AsGet(), 11310 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 11311} 11312 11313// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 11314type VirtualMachineScaleSetListResultPage struct { 11315 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 11316 vmsslr VirtualMachineScaleSetListResult 11317} 11318 11319// NextWithContext advances to the next page of values. If there was an error making 11320// the request the page does not advance and the error is returned. 11321func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 11322 if tracing.IsEnabled() { 11323 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 11324 defer func() { 11325 sc := -1 11326 if page.Response().Response.Response != nil { 11327 sc = page.Response().Response.Response.StatusCode 11328 } 11329 tracing.EndSpan(ctx, sc, err) 11330 }() 11331 } 11332 for { 11333 next, err := page.fn(ctx, page.vmsslr) 11334 if err != nil { 11335 return err 11336 } 11337 page.vmsslr = next 11338 if !next.hasNextLink() || !next.IsEmpty() { 11339 break 11340 } 11341 } 11342 return nil 11343} 11344 11345// Next advances to the next page of values. If there was an error making 11346// the request the page does not advance and the error is returned. 11347// Deprecated: Use NextWithContext() instead. 11348func (page *VirtualMachineScaleSetListResultPage) Next() error { 11349 return page.NextWithContext(context.Background()) 11350} 11351 11352// NotDone returns true if the page enumeration should be started or is not yet complete. 11353func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 11354 return !page.vmsslr.IsEmpty() 11355} 11356 11357// Response returns the raw server response from the last page request. 11358func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 11359 return page.vmsslr 11360} 11361 11362// Values returns the slice of values for the current page or nil if there are no values. 11363func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 11364 if page.vmsslr.IsEmpty() { 11365 return nil 11366 } 11367 return *page.vmsslr.Value 11368} 11369 11370// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 11371func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 11372 return VirtualMachineScaleSetListResultPage{ 11373 fn: getNextPage, 11374 vmsslr: cur, 11375 } 11376} 11377 11378// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 11379type VirtualMachineScaleSetListSkusResult struct { 11380 autorest.Response `json:"-"` 11381 // Value - The list of skus available for the virtual machine scale set. 11382 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 11383 // 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. 11384 NextLink *string `json:"nextLink,omitempty"` 11385} 11386 11387// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 11388// VirtualMachineScaleSetSku values. 11389type VirtualMachineScaleSetListSkusResultIterator struct { 11390 i int 11391 page VirtualMachineScaleSetListSkusResultPage 11392} 11393 11394// NextWithContext advances to the next value. If there was an error making 11395// the request the iterator does not advance and the error is returned. 11396func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 11397 if tracing.IsEnabled() { 11398 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 11399 defer func() { 11400 sc := -1 11401 if iter.Response().Response.Response != nil { 11402 sc = iter.Response().Response.Response.StatusCode 11403 } 11404 tracing.EndSpan(ctx, sc, err) 11405 }() 11406 } 11407 iter.i++ 11408 if iter.i < len(iter.page.Values()) { 11409 return nil 11410 } 11411 err = iter.page.NextWithContext(ctx) 11412 if err != nil { 11413 iter.i-- 11414 return err 11415 } 11416 iter.i = 0 11417 return nil 11418} 11419 11420// Next advances to the next value. If there was an error making 11421// the request the iterator does not advance and the error is returned. 11422// Deprecated: Use NextWithContext() instead. 11423func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 11424 return iter.NextWithContext(context.Background()) 11425} 11426 11427// NotDone returns true if the enumeration should be started or is not yet complete. 11428func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 11429 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11430} 11431 11432// Response returns the raw server response from the last page request. 11433func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 11434 return iter.page.Response() 11435} 11436 11437// Value returns the current value or a zero-initialized value if the 11438// iterator has advanced beyond the end of the collection. 11439func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 11440 if !iter.page.NotDone() { 11441 return VirtualMachineScaleSetSku{} 11442 } 11443 return iter.page.Values()[iter.i] 11444} 11445 11446// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 11447func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 11448 return VirtualMachineScaleSetListSkusResultIterator{page: page} 11449} 11450 11451// IsEmpty returns true if the ListResult contains no values. 11452func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 11453 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 11454} 11455 11456// hasNextLink returns true if the NextLink is not empty. 11457func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 11458 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 11459} 11460 11461// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 11462// It returns nil if no more results exist. 11463func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 11464 if !vmsslsr.hasNextLink() { 11465 return nil, nil 11466 } 11467 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11468 autorest.AsJSON(), 11469 autorest.AsGet(), 11470 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 11471} 11472 11473// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 11474type VirtualMachineScaleSetListSkusResultPage struct { 11475 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 11476 vmsslsr VirtualMachineScaleSetListSkusResult 11477} 11478 11479// NextWithContext advances to the next page of values. If there was an error making 11480// the request the page does not advance and the error is returned. 11481func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 11482 if tracing.IsEnabled() { 11483 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 11484 defer func() { 11485 sc := -1 11486 if page.Response().Response.Response != nil { 11487 sc = page.Response().Response.Response.StatusCode 11488 } 11489 tracing.EndSpan(ctx, sc, err) 11490 }() 11491 } 11492 for { 11493 next, err := page.fn(ctx, page.vmsslsr) 11494 if err != nil { 11495 return err 11496 } 11497 page.vmsslsr = next 11498 if !next.hasNextLink() || !next.IsEmpty() { 11499 break 11500 } 11501 } 11502 return nil 11503} 11504 11505// Next advances to the next page of values. If there was an error making 11506// the request the page does not advance and the error is returned. 11507// Deprecated: Use NextWithContext() instead. 11508func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 11509 return page.NextWithContext(context.Background()) 11510} 11511 11512// NotDone returns true if the page enumeration should be started or is not yet complete. 11513func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 11514 return !page.vmsslsr.IsEmpty() 11515} 11516 11517// Response returns the raw server response from the last page request. 11518func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 11519 return page.vmsslsr 11520} 11521 11522// Values returns the slice of values for the current page or nil if there are no values. 11523func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 11524 if page.vmsslsr.IsEmpty() { 11525 return nil 11526 } 11527 return *page.vmsslsr.Value 11528} 11529 11530// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 11531func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 11532 return VirtualMachineScaleSetListSkusResultPage{ 11533 fn: getNextPage, 11534 vmsslsr: cur, 11535 } 11536} 11537 11538// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 11539type VirtualMachineScaleSetListWithLinkResult struct { 11540 autorest.Response `json:"-"` 11541 // Value - The list of virtual machine scale sets. 11542 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 11543 // 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. 11544 NextLink *string `json:"nextLink,omitempty"` 11545} 11546 11547// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 11548// VirtualMachineScaleSet values. 11549type VirtualMachineScaleSetListWithLinkResultIterator struct { 11550 i int 11551 page VirtualMachineScaleSetListWithLinkResultPage 11552} 11553 11554// NextWithContext advances to the next value. If there was an error making 11555// the request the iterator does not advance and the error is returned. 11556func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 11557 if tracing.IsEnabled() { 11558 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 11559 defer func() { 11560 sc := -1 11561 if iter.Response().Response.Response != nil { 11562 sc = iter.Response().Response.Response.StatusCode 11563 } 11564 tracing.EndSpan(ctx, sc, err) 11565 }() 11566 } 11567 iter.i++ 11568 if iter.i < len(iter.page.Values()) { 11569 return nil 11570 } 11571 err = iter.page.NextWithContext(ctx) 11572 if err != nil { 11573 iter.i-- 11574 return err 11575 } 11576 iter.i = 0 11577 return nil 11578} 11579 11580// Next advances to the next value. If there was an error making 11581// the request the iterator does not advance and the error is returned. 11582// Deprecated: Use NextWithContext() instead. 11583func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 11584 return iter.NextWithContext(context.Background()) 11585} 11586 11587// NotDone returns true if the enumeration should be started or is not yet complete. 11588func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 11589 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11590} 11591 11592// Response returns the raw server response from the last page request. 11593func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 11594 return iter.page.Response() 11595} 11596 11597// Value returns the current value or a zero-initialized value if the 11598// iterator has advanced beyond the end of the collection. 11599func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 11600 if !iter.page.NotDone() { 11601 return VirtualMachineScaleSet{} 11602 } 11603 return iter.page.Values()[iter.i] 11604} 11605 11606// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 11607func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 11608 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 11609} 11610 11611// IsEmpty returns true if the ListResult contains no values. 11612func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 11613 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 11614} 11615 11616// hasNextLink returns true if the NextLink is not empty. 11617func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 11618 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 11619} 11620 11621// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 11622// It returns nil if no more results exist. 11623func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 11624 if !vmsslwlr.hasNextLink() { 11625 return nil, nil 11626 } 11627 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11628 autorest.AsJSON(), 11629 autorest.AsGet(), 11630 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 11631} 11632 11633// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 11634type VirtualMachineScaleSetListWithLinkResultPage struct { 11635 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 11636 vmsslwlr VirtualMachineScaleSetListWithLinkResult 11637} 11638 11639// NextWithContext advances to the next page of values. If there was an error making 11640// the request the page does not advance and the error is returned. 11641func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 11642 if tracing.IsEnabled() { 11643 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 11644 defer func() { 11645 sc := -1 11646 if page.Response().Response.Response != nil { 11647 sc = page.Response().Response.Response.StatusCode 11648 } 11649 tracing.EndSpan(ctx, sc, err) 11650 }() 11651 } 11652 for { 11653 next, err := page.fn(ctx, page.vmsslwlr) 11654 if err != nil { 11655 return err 11656 } 11657 page.vmsslwlr = next 11658 if !next.hasNextLink() || !next.IsEmpty() { 11659 break 11660 } 11661 } 11662 return nil 11663} 11664 11665// Next advances to the next page of values. If there was an error making 11666// the request the page does not advance and the error is returned. 11667// Deprecated: Use NextWithContext() instead. 11668func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 11669 return page.NextWithContext(context.Background()) 11670} 11671 11672// NotDone returns true if the page enumeration should be started or is not yet complete. 11673func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 11674 return !page.vmsslwlr.IsEmpty() 11675} 11676 11677// Response returns the raw server response from the last page request. 11678func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 11679 return page.vmsslwlr 11680} 11681 11682// Values returns the slice of values for the current page or nil if there are no values. 11683func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 11684 if page.vmsslwlr.IsEmpty() { 11685 return nil 11686 } 11687 return *page.vmsslwlr.Value 11688} 11689 11690// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 11691func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 11692 return VirtualMachineScaleSetListWithLinkResultPage{ 11693 fn: getNextPage, 11694 vmsslwlr: cur, 11695 } 11696} 11697 11698// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 11699type VirtualMachineScaleSetManagedDiskParameters struct { 11700 // 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' 11701 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 11702 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 11703 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 11704} 11705 11706// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 11707// network configurations. 11708type VirtualMachineScaleSetNetworkConfiguration struct { 11709 // Name - The network configuration name. 11710 Name *string `json:"name,omitempty"` 11711 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 11712 // ID - Resource Id 11713 ID *string `json:"id,omitempty"` 11714} 11715 11716// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 11717func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 11718 objectMap := make(map[string]interface{}) 11719 if vmssnc.Name != nil { 11720 objectMap["name"] = vmssnc.Name 11721 } 11722 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 11723 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 11724 } 11725 if vmssnc.ID != nil { 11726 objectMap["id"] = vmssnc.ID 11727 } 11728 return json.Marshal(objectMap) 11729} 11730 11731// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 11732func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 11733 var m map[string]*json.RawMessage 11734 err := json.Unmarshal(body, &m) 11735 if err != nil { 11736 return err 11737 } 11738 for k, v := range m { 11739 switch k { 11740 case "name": 11741 if v != nil { 11742 var name string 11743 err = json.Unmarshal(*v, &name) 11744 if err != nil { 11745 return err 11746 } 11747 vmssnc.Name = &name 11748 } 11749 case "properties": 11750 if v != nil { 11751 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 11752 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 11753 if err != nil { 11754 return err 11755 } 11756 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 11757 } 11758 case "id": 11759 if v != nil { 11760 var ID string 11761 err = json.Unmarshal(*v, &ID) 11762 if err != nil { 11763 return err 11764 } 11765 vmssnc.ID = &ID 11766 } 11767 } 11768 } 11769 11770 return nil 11771} 11772 11773// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 11774// configuration's DNS settings. 11775type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 11776 // DNSServers - List of DNS servers IP addresses 11777 DNSServers *[]string `json:"dnsServers,omitempty"` 11778} 11779 11780// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 11781// profile's IP configuration. 11782type VirtualMachineScaleSetNetworkConfigurationProperties struct { 11783 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 11784 Primary *bool `json:"primary,omitempty"` 11785 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 11786 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 11787 // NetworkSecurityGroup - The network security group. 11788 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 11789 // DNSSettings - The dns settings to be applied on the network interfaces. 11790 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 11791 // IPConfigurations - Specifies the IP configurations of the network interface. 11792 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 11793 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 11794 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 11795} 11796 11797// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 11798type VirtualMachineScaleSetNetworkProfile struct { 11799 // 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}'. 11800 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 11801 // NetworkInterfaceConfigurations - The list of network configurations. 11802 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 11803} 11804 11805// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 11806type VirtualMachineScaleSetOSDisk struct { 11807 // Name - The disk name. 11808 Name *string `json:"name,omitempty"` 11809 // 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' 11810 Caching CachingTypes `json:"caching,omitempty"` 11811 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 11812 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 11813 // 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' 11814 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 11815 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 11816 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 11817 // 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 11818 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 11819 // 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' 11820 OsType OperatingSystemTypes `json:"osType,omitempty"` 11821 // Image - Specifies information about the unmanaged user image to base the scale set on. 11822 Image *VirtualHardDisk `json:"image,omitempty"` 11823 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 11824 VhdContainers *[]string `json:"vhdContainers,omitempty"` 11825 // ManagedDisk - The managed disk parameters. 11826 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 11827} 11828 11829// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 11830type VirtualMachineScaleSetOSProfile struct { 11831 // 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. 11832 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 11833 // 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) 11834 AdminUsername *string `json:"adminUsername,omitempty"` 11835 // 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) 11836 AdminPassword *string `json:"adminPassword,omitempty"` 11837 // 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) 11838 CustomData *string `json:"customData,omitempty"` 11839 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 11840 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 11841 // 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). 11842 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 11843 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 11844 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 11845} 11846 11847// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 11848type VirtualMachineScaleSetProperties struct { 11849 // UpgradePolicy - The upgrade policy. 11850 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 11851 // AutomaticRepairsPolicy - Policy for automatic repairs. 11852 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 11853 // VirtualMachineProfile - The virtual machine profile. 11854 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 11855 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 11856 ProvisioningState *string `json:"provisioningState,omitempty"` 11857 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 11858 Overprovision *bool `json:"overprovision,omitempty"` 11859 // 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. 11860 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 11861 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 11862 UniqueID *string `json:"uniqueId,omitempty"` 11863 // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. 11864 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 11865 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 11866 ZoneBalance *bool `json:"zoneBalance,omitempty"` 11867 // PlatformFaultDomainCount - Fault Domain count for each placement group. 11868 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 11869 // 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. 11870 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 11871 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. 11872 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 11873 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 11874 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 11875} 11876 11877// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 11878func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 11879 objectMap := make(map[string]interface{}) 11880 if vmssp.UpgradePolicy != nil { 11881 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 11882 } 11883 if vmssp.AutomaticRepairsPolicy != nil { 11884 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 11885 } 11886 if vmssp.VirtualMachineProfile != nil { 11887 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 11888 } 11889 if vmssp.Overprovision != nil { 11890 objectMap["overprovision"] = vmssp.Overprovision 11891 } 11892 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 11893 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 11894 } 11895 if vmssp.SinglePlacementGroup != nil { 11896 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 11897 } 11898 if vmssp.ZoneBalance != nil { 11899 objectMap["zoneBalance"] = vmssp.ZoneBalance 11900 } 11901 if vmssp.PlatformFaultDomainCount != nil { 11902 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 11903 } 11904 if vmssp.ProximityPlacementGroup != nil { 11905 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 11906 } 11907 if vmssp.AdditionalCapabilities != nil { 11908 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 11909 } 11910 if vmssp.ScaleInPolicy != nil { 11911 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 11912 } 11913 return json.Marshal(objectMap) 11914} 11915 11916// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 11917// Configuration's PublicIPAddress configuration 11918type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 11919 // Name - The publicIP address configuration name. 11920 Name *string `json:"name,omitempty"` 11921 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 11922} 11923 11924// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 11925func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 11926 objectMap := make(map[string]interface{}) 11927 if vmsspiac.Name != nil { 11928 objectMap["name"] = vmsspiac.Name 11929 } 11930 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 11931 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 11932 } 11933 return json.Marshal(objectMap) 11934} 11935 11936// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 11937func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 11938 var m map[string]*json.RawMessage 11939 err := json.Unmarshal(body, &m) 11940 if err != nil { 11941 return err 11942 } 11943 for k, v := range m { 11944 switch k { 11945 case "name": 11946 if v != nil { 11947 var name string 11948 err = json.Unmarshal(*v, &name) 11949 if err != nil { 11950 return err 11951 } 11952 vmsspiac.Name = &name 11953 } 11954 case "properties": 11955 if v != nil { 11956 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 11957 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 11958 if err != nil { 11959 return err 11960 } 11961 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 11962 } 11963 } 11964 } 11965 11966 return nil 11967} 11968 11969// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 11970// network configuration's DNS settings. 11971type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 11972 // 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 11973 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 11974} 11975 11976// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 11977// Configuration's PublicIPAddress configuration 11978type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 11979 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 11980 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 11981 // DNSSettings - The dns settings to be applied on the publicIP addresses . 11982 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 11983 // IPTags - The list of IP tags associated with the public IP address. 11984 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 11985 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 11986 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 11987 // PublicIPAddressVersion - Available from Api-Version 2019-07-01 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' 11988 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 11989} 11990 11991// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 11992type VirtualMachineScaleSetReimageParameters struct { 11993 // 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. 11994 InstanceIds *[]string `json:"instanceIds,omitempty"` 11995 // 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. 11996 TempDisk *bool `json:"tempDisk,omitempty"` 11997} 11998 11999// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 12000// results of a long-running operation. 12001type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 12002 azure.FutureAPI 12003 // Result returns the result of the asynchronous operation. 12004 // If the operation has not completed it will return an error. 12005 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12006} 12007 12008// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12009func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 12010 var azFuture azure.Future 12011 if err := json.Unmarshal(body, &azFuture); err != nil { 12012 return err 12013 } 12014 future.FutureAPI = &azFuture 12015 future.Result = future.result 12016 return nil 12017} 12018 12019// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 12020func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 12021 var done bool 12022 done, err = future.DoneWithContext(context.Background(), client) 12023 if err != nil { 12024 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 12025 return 12026 } 12027 if !done { 12028 ar.Response = future.Response() 12029 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 12030 return 12031 } 12032 ar.Response = future.Response() 12033 return 12034} 12035 12036// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 12037// retrieving the results of a long-running operation. 12038type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 12039 azure.FutureAPI 12040 // Result returns the result of the asynchronous operation. 12041 // If the operation has not completed it will return an error. 12042 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12043} 12044 12045// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12046func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 12047 var azFuture azure.Future 12048 if err := json.Unmarshal(body, &azFuture); err != nil { 12049 return err 12050 } 12051 future.FutureAPI = &azFuture 12052 future.Result = future.result 12053 return nil 12054} 12055 12056// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 12057func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 12058 var done bool 12059 done, err = future.DoneWithContext(context.Background(), client) 12060 if err != nil { 12061 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 12062 return 12063 } 12064 if !done { 12065 ar.Response = future.Response() 12066 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 12067 return 12068 } 12069 ar.Response = future.Response() 12070 return 12071} 12072 12073// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 12074// the results of a long-running operation. 12075type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 12076 azure.FutureAPI 12077 // Result returns the result of the asynchronous operation. 12078 // If the operation has not completed it will return an error. 12079 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12080} 12081 12082// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12083func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 12084 var azFuture azure.Future 12085 if err := json.Unmarshal(body, &azFuture); err != nil { 12086 return err 12087 } 12088 future.FutureAPI = &azFuture 12089 future.Result = future.result 12090 return nil 12091} 12092 12093// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 12094func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 12095 var done bool 12096 done, err = future.DoneWithContext(context.Background(), client) 12097 if err != nil { 12098 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 12099 return 12100 } 12101 if !done { 12102 ar.Response = future.Response() 12103 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 12104 return 12105 } 12106 ar.Response = future.Response() 12107 return 12108} 12109 12110// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 12111// a long-running operation. 12112type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 12113 azure.FutureAPI 12114 // Result returns the result of the asynchronous operation. 12115 // If the operation has not completed it will return an error. 12116 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 12117} 12118 12119// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12120func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 12121 var azFuture azure.Future 12122 if err := json.Unmarshal(body, &azFuture); err != nil { 12123 return err 12124 } 12125 future.FutureAPI = &azFuture 12126 future.Result = future.result 12127 return nil 12128} 12129 12130// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 12131func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 12132 var done bool 12133 done, err = future.DoneWithContext(context.Background(), client) 12134 if err != nil { 12135 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12136 return 12137 } 12138 if !done { 12139 vmss.Response.Response = future.Response() 12140 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 12141 return 12142 } 12143 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12144 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 12145 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 12146 if err != nil { 12147 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 12148 } 12149 } 12150 return 12151} 12152 12153// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 12154// long-running operation. 12155type VirtualMachineScaleSetsDeallocateFuture struct { 12156 azure.FutureAPI 12157 // Result returns the result of the asynchronous operation. 12158 // If the operation has not completed it will return an error. 12159 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12160} 12161 12162// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12163func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 12164 var azFuture azure.Future 12165 if err := json.Unmarshal(body, &azFuture); err != nil { 12166 return err 12167 } 12168 future.FutureAPI = &azFuture 12169 future.Result = future.result 12170 return nil 12171} 12172 12173// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 12174func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12175 var done bool 12176 done, err = future.DoneWithContext(context.Background(), client) 12177 if err != nil { 12178 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 12179 return 12180 } 12181 if !done { 12182 ar.Response = future.Response() 12183 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 12184 return 12185 } 12186 ar.Response = future.Response() 12187 return 12188} 12189 12190// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 12191// long-running operation. 12192type VirtualMachineScaleSetsDeleteFuture struct { 12193 azure.FutureAPI 12194 // Result returns the result of the asynchronous operation. 12195 // If the operation has not completed it will return an error. 12196 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12197} 12198 12199// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12200func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 12201 var azFuture azure.Future 12202 if err := json.Unmarshal(body, &azFuture); err != nil { 12203 return err 12204 } 12205 future.FutureAPI = &azFuture 12206 future.Result = future.result 12207 return nil 12208} 12209 12210// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 12211func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12212 var done bool 12213 done, err = future.DoneWithContext(context.Background(), client) 12214 if err != nil { 12215 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 12216 return 12217 } 12218 if !done { 12219 ar.Response = future.Response() 12220 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 12221 return 12222 } 12223 ar.Response = future.Response() 12224 return 12225} 12226 12227// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 12228// a long-running operation. 12229type VirtualMachineScaleSetsDeleteInstancesFuture struct { 12230 azure.FutureAPI 12231 // Result returns the result of the asynchronous operation. 12232 // If the operation has not completed it will return an error. 12233 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12234} 12235 12236// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12237func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 12238 var azFuture azure.Future 12239 if err := json.Unmarshal(body, &azFuture); err != nil { 12240 return err 12241 } 12242 future.FutureAPI = &azFuture 12243 future.Result = future.result 12244 return nil 12245} 12246 12247// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 12248func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12249 var done bool 12250 done, err = future.DoneWithContext(context.Background(), client) 12251 if err != nil { 12252 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 12253 return 12254 } 12255 if !done { 12256 ar.Response = future.Response() 12257 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 12258 return 12259 } 12260 ar.Response = future.Response() 12261 return 12262} 12263 12264// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 12265type VirtualMachineScaleSetSku struct { 12266 // ResourceType - READ-ONLY; The type of resource the sku applies to. 12267 ResourceType *string `json:"resourceType,omitempty"` 12268 // Sku - READ-ONLY; The Sku. 12269 Sku *Sku `json:"sku,omitempty"` 12270 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 12271 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 12272} 12273 12274// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. 12275func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { 12276 objectMap := make(map[string]interface{}) 12277 return json.Marshal(objectMap) 12278} 12279 12280// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 12281type VirtualMachineScaleSetSkuCapacity struct { 12282 // Minimum - READ-ONLY; The minimum capacity. 12283 Minimum *int64 `json:"minimum,omitempty"` 12284 // Maximum - READ-ONLY; The maximum capacity that can be set. 12285 Maximum *int64 `json:"maximum,omitempty"` 12286 // DefaultCapacity - READ-ONLY; The default capacity. 12287 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 12288 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 12289 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 12290} 12291 12292// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. 12293func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { 12294 objectMap := make(map[string]interface{}) 12295 return json.Marshal(objectMap) 12296} 12297 12298// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 12299// of a long-running operation. 12300type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 12301 azure.FutureAPI 12302 // Result returns the result of the asynchronous operation. 12303 // If the operation has not completed it will return an error. 12304 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12305} 12306 12307// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12308func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 12309 var azFuture azure.Future 12310 if err := json.Unmarshal(body, &azFuture); err != nil { 12311 return err 12312 } 12313 future.FutureAPI = &azFuture 12314 future.Result = future.result 12315 return nil 12316} 12317 12318// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 12319func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12320 var done bool 12321 done, err = future.DoneWithContext(context.Background(), client) 12322 if err != nil { 12323 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 12324 return 12325 } 12326 if !done { 12327 ar.Response = future.Response() 12328 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 12329 return 12330 } 12331 ar.Response = future.Response() 12332 return 12333} 12334 12335// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 12336// long-running operation. 12337type VirtualMachineScaleSetsPowerOffFuture struct { 12338 azure.FutureAPI 12339 // Result returns the result of the asynchronous operation. 12340 // If the operation has not completed it will return an error. 12341 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12342} 12343 12344// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12345func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 12346 var azFuture azure.Future 12347 if err := json.Unmarshal(body, &azFuture); err != nil { 12348 return err 12349 } 12350 future.FutureAPI = &azFuture 12351 future.Result = future.result 12352 return nil 12353} 12354 12355// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 12356func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12357 var done bool 12358 done, err = future.DoneWithContext(context.Background(), client) 12359 if err != nil { 12360 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 12361 return 12362 } 12363 if !done { 12364 ar.Response = future.Response() 12365 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 12366 return 12367 } 12368 ar.Response = future.Response() 12369 return 12370} 12371 12372// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 12373// long-running operation. 12374type VirtualMachineScaleSetsRedeployFuture struct { 12375 azure.FutureAPI 12376 // Result returns the result of the asynchronous operation. 12377 // If the operation has not completed it will return an error. 12378 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12379} 12380 12381// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12382func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 12383 var azFuture azure.Future 12384 if err := json.Unmarshal(body, &azFuture); err != nil { 12385 return err 12386 } 12387 future.FutureAPI = &azFuture 12388 future.Result = future.result 12389 return nil 12390} 12391 12392// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 12393func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12394 var done bool 12395 done, err = future.DoneWithContext(context.Background(), client) 12396 if err != nil { 12397 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 12398 return 12399 } 12400 if !done { 12401 ar.Response = future.Response() 12402 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 12403 return 12404 } 12405 ar.Response = future.Response() 12406 return 12407} 12408 12409// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 12410// long-running operation. 12411type VirtualMachineScaleSetsReimageAllFuture struct { 12412 azure.FutureAPI 12413 // Result returns the result of the asynchronous operation. 12414 // If the operation has not completed it will return an error. 12415 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12416} 12417 12418// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12419func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 12420 var azFuture azure.Future 12421 if err := json.Unmarshal(body, &azFuture); err != nil { 12422 return err 12423 } 12424 future.FutureAPI = &azFuture 12425 future.Result = future.result 12426 return nil 12427} 12428 12429// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 12430func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12431 var done bool 12432 done, err = future.DoneWithContext(context.Background(), client) 12433 if err != nil { 12434 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 12435 return 12436 } 12437 if !done { 12438 ar.Response = future.Response() 12439 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 12440 return 12441 } 12442 ar.Response = future.Response() 12443 return 12444} 12445 12446// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 12447// long-running operation. 12448type VirtualMachineScaleSetsReimageFuture struct { 12449 azure.FutureAPI 12450 // Result returns the result of the asynchronous operation. 12451 // If the operation has not completed it will return an error. 12452 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12453} 12454 12455// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12456func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 12457 var azFuture azure.Future 12458 if err := json.Unmarshal(body, &azFuture); err != nil { 12459 return err 12460 } 12461 future.FutureAPI = &azFuture 12462 future.Result = future.result 12463 return nil 12464} 12465 12466// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 12467func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12468 var done bool 12469 done, err = future.DoneWithContext(context.Background(), client) 12470 if err != nil { 12471 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 12472 return 12473 } 12474 if !done { 12475 ar.Response = future.Response() 12476 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 12477 return 12478 } 12479 ar.Response = future.Response() 12480 return 12481} 12482 12483// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 12484// long-running operation. 12485type VirtualMachineScaleSetsRestartFuture struct { 12486 azure.FutureAPI 12487 // Result returns the result of the asynchronous operation. 12488 // If the operation has not completed it will return an error. 12489 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12490} 12491 12492// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12493func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 12494 var azFuture azure.Future 12495 if err := json.Unmarshal(body, &azFuture); err != nil { 12496 return err 12497 } 12498 future.FutureAPI = &azFuture 12499 future.Result = future.result 12500 return nil 12501} 12502 12503// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 12504func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12505 var done bool 12506 done, err = future.DoneWithContext(context.Background(), client) 12507 if err != nil { 12508 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 12509 return 12510 } 12511 if !done { 12512 ar.Response = future.Response() 12513 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 12514 return 12515 } 12516 ar.Response = future.Response() 12517 return 12518} 12519 12520// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 12521// long-running operation. 12522type VirtualMachineScaleSetsStartFuture struct { 12523 azure.FutureAPI 12524 // Result returns the result of the asynchronous operation. 12525 // If the operation has not completed it will return an error. 12526 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12527} 12528 12529// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12530func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 12531 var azFuture azure.Future 12532 if err := json.Unmarshal(body, &azFuture); err != nil { 12533 return err 12534 } 12535 future.FutureAPI = &azFuture 12536 future.Result = future.result 12537 return nil 12538} 12539 12540// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 12541func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12542 var done bool 12543 done, err = future.DoneWithContext(context.Background(), client) 12544 if err != nil { 12545 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 12546 return 12547 } 12548 if !done { 12549 ar.Response = future.Response() 12550 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 12551 return 12552 } 12553 ar.Response = future.Response() 12554 return 12555} 12556 12557// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 12558type VirtualMachineScaleSetStorageProfile struct { 12559 // 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. 12560 ImageReference *ImageReference `json:"imageReference,omitempty"` 12561 // 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). 12562 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 12563 // 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). 12564 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 12565} 12566 12567// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 12568// long-running operation. 12569type VirtualMachineScaleSetsUpdateFuture struct { 12570 azure.FutureAPI 12571 // Result returns the result of the asynchronous operation. 12572 // If the operation has not completed it will return an error. 12573 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 12574} 12575 12576// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12577func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 12578 var azFuture azure.Future 12579 if err := json.Unmarshal(body, &azFuture); err != nil { 12580 return err 12581 } 12582 future.FutureAPI = &azFuture 12583 future.Result = future.result 12584 return nil 12585} 12586 12587// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 12588func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 12589 var done bool 12590 done, err = future.DoneWithContext(context.Background(), client) 12591 if err != nil { 12592 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 12593 return 12594 } 12595 if !done { 12596 vmss.Response.Response = future.Response() 12597 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 12598 return 12599 } 12600 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12601 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 12602 vmss, err = client.UpdateResponder(vmss.Response.Response) 12603 if err != nil { 12604 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 12605 } 12606 } 12607 return 12608} 12609 12610// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 12611// a long-running operation. 12612type VirtualMachineScaleSetsUpdateInstancesFuture struct { 12613 azure.FutureAPI 12614 // Result returns the result of the asynchronous operation. 12615 // If the operation has not completed it will return an error. 12616 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12617} 12618 12619// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12620func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 12621 var azFuture azure.Future 12622 if err := json.Unmarshal(body, &azFuture); err != nil { 12623 return err 12624 } 12625 future.FutureAPI = &azFuture 12626 future.Result = future.result 12627 return nil 12628} 12629 12630// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 12631func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12632 var done bool 12633 done, err = future.DoneWithContext(context.Background(), client) 12634 if err != nil { 12635 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 12636 return 12637 } 12638 if !done { 12639 ar.Response = future.Response() 12640 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 12641 return 12642 } 12643 ar.Response = future.Response() 12644 return 12645} 12646 12647// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 12648type VirtualMachineScaleSetUpdate struct { 12649 // Sku - The virtual machine scale set sku. 12650 Sku *Sku `json:"sku,omitempty"` 12651 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 12652 Plan *Plan `json:"plan,omitempty"` 12653 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 12654 // Identity - The identity of the virtual machine scale set, if configured. 12655 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 12656 // Tags - Resource tags 12657 Tags map[string]*string `json:"tags"` 12658} 12659 12660// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 12661func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 12662 objectMap := make(map[string]interface{}) 12663 if vmssu.Sku != nil { 12664 objectMap["sku"] = vmssu.Sku 12665 } 12666 if vmssu.Plan != nil { 12667 objectMap["plan"] = vmssu.Plan 12668 } 12669 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 12670 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 12671 } 12672 if vmssu.Identity != nil { 12673 objectMap["identity"] = vmssu.Identity 12674 } 12675 if vmssu.Tags != nil { 12676 objectMap["tags"] = vmssu.Tags 12677 } 12678 return json.Marshal(objectMap) 12679} 12680 12681// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 12682func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 12683 var m map[string]*json.RawMessage 12684 err := json.Unmarshal(body, &m) 12685 if err != nil { 12686 return err 12687 } 12688 for k, v := range m { 12689 switch k { 12690 case "sku": 12691 if v != nil { 12692 var sku Sku 12693 err = json.Unmarshal(*v, &sku) 12694 if err != nil { 12695 return err 12696 } 12697 vmssu.Sku = &sku 12698 } 12699 case "plan": 12700 if v != nil { 12701 var plan Plan 12702 err = json.Unmarshal(*v, &plan) 12703 if err != nil { 12704 return err 12705 } 12706 vmssu.Plan = &plan 12707 } 12708 case "properties": 12709 if v != nil { 12710 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 12711 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 12712 if err != nil { 12713 return err 12714 } 12715 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 12716 } 12717 case "identity": 12718 if v != nil { 12719 var identity VirtualMachineScaleSetIdentity 12720 err = json.Unmarshal(*v, &identity) 12721 if err != nil { 12722 return err 12723 } 12724 vmssu.Identity = &identity 12725 } 12726 case "tags": 12727 if v != nil { 12728 var tags map[string]*string 12729 err = json.Unmarshal(*v, &tags) 12730 if err != nil { 12731 return err 12732 } 12733 vmssu.Tags = tags 12734 } 12735 } 12736 } 12737 12738 return nil 12739} 12740 12741// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 12742// configuration. 12743type VirtualMachineScaleSetUpdateIPConfiguration struct { 12744 // Name - The IP configuration name. 12745 Name *string `json:"name,omitempty"` 12746 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 12747 // ID - Resource Id 12748 ID *string `json:"id,omitempty"` 12749} 12750 12751// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 12752func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 12753 objectMap := make(map[string]interface{}) 12754 if vmssuic.Name != nil { 12755 objectMap["name"] = vmssuic.Name 12756 } 12757 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 12758 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 12759 } 12760 if vmssuic.ID != nil { 12761 objectMap["id"] = vmssuic.ID 12762 } 12763 return json.Marshal(objectMap) 12764} 12765 12766// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 12767func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 12768 var m map[string]*json.RawMessage 12769 err := json.Unmarshal(body, &m) 12770 if err != nil { 12771 return err 12772 } 12773 for k, v := range m { 12774 switch k { 12775 case "name": 12776 if v != nil { 12777 var name string 12778 err = json.Unmarshal(*v, &name) 12779 if err != nil { 12780 return err 12781 } 12782 vmssuic.Name = &name 12783 } 12784 case "properties": 12785 if v != nil { 12786 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 12787 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 12788 if err != nil { 12789 return err 12790 } 12791 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 12792 } 12793 case "id": 12794 if v != nil { 12795 var ID string 12796 err = json.Unmarshal(*v, &ID) 12797 if err != nil { 12798 return err 12799 } 12800 vmssuic.ID = &ID 12801 } 12802 } 12803 } 12804 12805 return nil 12806} 12807 12808// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 12809// profile's IP configuration properties. NOTE: The subnet of a scale set may be modified as long as the 12810// original subnet and the new subnet are in the same virtual network. 12811type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 12812 // Subnet - The subnet. 12813 Subnet *APIEntityReference `json:"subnet,omitempty"` 12814 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 12815 Primary *bool `json:"primary,omitempty"` 12816 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 12817 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 12818 // 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' 12819 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 12820 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 12821 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 12822 // ApplicationSecurityGroups - Specifies an array of references to application security group. 12823 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 12824 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 12825 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 12826 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 12827 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 12828} 12829 12830// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 12831// network configurations. 12832type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 12833 // Name - The network configuration name. 12834 Name *string `json:"name,omitempty"` 12835 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 12836 // ID - Resource Id 12837 ID *string `json:"id,omitempty"` 12838} 12839 12840// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 12841func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 12842 objectMap := make(map[string]interface{}) 12843 if vmssunc.Name != nil { 12844 objectMap["name"] = vmssunc.Name 12845 } 12846 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 12847 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 12848 } 12849 if vmssunc.ID != nil { 12850 objectMap["id"] = vmssunc.ID 12851 } 12852 return json.Marshal(objectMap) 12853} 12854 12855// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 12856func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 12857 var m map[string]*json.RawMessage 12858 err := json.Unmarshal(body, &m) 12859 if err != nil { 12860 return err 12861 } 12862 for k, v := range m { 12863 switch k { 12864 case "name": 12865 if v != nil { 12866 var name string 12867 err = json.Unmarshal(*v, &name) 12868 if err != nil { 12869 return err 12870 } 12871 vmssunc.Name = &name 12872 } 12873 case "properties": 12874 if v != nil { 12875 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 12876 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 12877 if err != nil { 12878 return err 12879 } 12880 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 12881 } 12882 case "id": 12883 if v != nil { 12884 var ID string 12885 err = json.Unmarshal(*v, &ID) 12886 if err != nil { 12887 return err 12888 } 12889 vmssunc.ID = &ID 12890 } 12891 } 12892 } 12893 12894 return nil 12895} 12896 12897// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 12898// updatable network profile's IP configuration.Use this object for updating network profile's IP 12899// Configuration. 12900type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 12901 // Primary - Whether this is a primary NIC on a virtual machine. 12902 Primary *bool `json:"primary,omitempty"` 12903 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 12904 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 12905 // NetworkSecurityGroup - The network security group. 12906 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 12907 // DNSSettings - The dns settings to be applied on the network interfaces. 12908 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 12909 // IPConfigurations - The virtual machine scale set IP Configuration. 12910 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 12911 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 12912 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 12913} 12914 12915// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 12916type VirtualMachineScaleSetUpdateNetworkProfile struct { 12917 // 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}'. 12918 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 12919 // NetworkInterfaceConfigurations - The list of network configurations. 12920 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 12921} 12922 12923// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 12924// Object. This should be used for Updating VMSS OS Disk. 12925type VirtualMachineScaleSetUpdateOSDisk struct { 12926 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 12927 Caching CachingTypes `json:"caching,omitempty"` 12928 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 12929 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 12930 // 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 12931 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12932 // 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. 12933 Image *VirtualHardDisk `json:"image,omitempty"` 12934 // VhdContainers - The list of virtual hard disk container uris. 12935 VhdContainers *[]string `json:"vhdContainers,omitempty"` 12936 // ManagedDisk - The managed disk parameters. 12937 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 12938} 12939 12940// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 12941type VirtualMachineScaleSetUpdateOSProfile struct { 12942 // CustomData - A base-64 encoded string of custom data. 12943 CustomData *string `json:"customData,omitempty"` 12944 // WindowsConfiguration - The Windows Configuration of the OS profile. 12945 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 12946 // LinuxConfiguration - The Linux Configuration of the OS profile. 12947 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 12948 // Secrets - The List of certificates for addition to the VM. 12949 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 12950} 12951 12952// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 12953type VirtualMachineScaleSetUpdateProperties struct { 12954 // UpgradePolicy - The upgrade policy. 12955 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 12956 // AutomaticRepairsPolicy - Policy for automatic repairs. 12957 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 12958 // VirtualMachineProfile - The virtual machine profile. 12959 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 12960 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 12961 Overprovision *bool `json:"overprovision,omitempty"` 12962 // 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. 12963 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 12964 // 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. 12965 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 12966 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. 12967 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 12968 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 12969 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 12970 // 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. 12971 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 12972} 12973 12974// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 12975// Configuration's PublicIPAddress configuration 12976type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 12977 // Name - The publicIP address configuration name. 12978 Name *string `json:"name,omitempty"` 12979 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 12980} 12981 12982// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 12983func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 12984 objectMap := make(map[string]interface{}) 12985 if vmssupiac.Name != nil { 12986 objectMap["name"] = vmssupiac.Name 12987 } 12988 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 12989 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 12990 } 12991 return json.Marshal(objectMap) 12992} 12993 12994// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 12995func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 12996 var m map[string]*json.RawMessage 12997 err := json.Unmarshal(body, &m) 12998 if err != nil { 12999 return err 13000 } 13001 for k, v := range m { 13002 switch k { 13003 case "name": 13004 if v != nil { 13005 var name string 13006 err = json.Unmarshal(*v, &name) 13007 if err != nil { 13008 return err 13009 } 13010 vmssupiac.Name = &name 13011 } 13012 case "properties": 13013 if v != nil { 13014 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 13015 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 13016 if err != nil { 13017 return err 13018 } 13019 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 13020 } 13021 } 13022 } 13023 13024 return nil 13025} 13026 13027// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 13028// set IP Configuration's PublicIPAddress configuration 13029type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 13030 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 13031 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 13032 // DNSSettings - The dns settings to be applied on the publicIP addresses . 13033 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 13034} 13035 13036// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 13037type VirtualMachineScaleSetUpdateStorageProfile struct { 13038 // ImageReference - The image reference. 13039 ImageReference *ImageReference `json:"imageReference,omitempty"` 13040 // OsDisk - The OS disk. 13041 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 13042 // DataDisks - The data disks. 13043 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 13044} 13045 13046// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 13047type VirtualMachineScaleSetUpdateVMProfile struct { 13048 // OsProfile - The virtual machine scale set OS profile. 13049 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 13050 // StorageProfile - The virtual machine scale set storage profile. 13051 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 13052 // NetworkProfile - The virtual machine scale set network profile. 13053 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 13054 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 13055 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 13056 // ExtensionProfile - The virtual machine scale set extension profile. 13057 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 13058 // LicenseType - The license type, which is for bring your own license scenario. 13059 LicenseType *string `json:"licenseType,omitempty"` 13060 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 13061 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 13062 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 13063 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 13064} 13065 13066// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 13067type VirtualMachineScaleSetVM struct { 13068 autorest.Response `json:"-"` 13069 // InstanceID - READ-ONLY; The virtual machine instance ID. 13070 InstanceID *string `json:"instanceId,omitempty"` 13071 // Sku - READ-ONLY; The virtual machine SKU. 13072 Sku *Sku `json:"sku,omitempty"` 13073 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 13074 // 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**. 13075 Plan *Plan `json:"plan,omitempty"` 13076 // Resources - READ-ONLY; The virtual machine child extension resources. 13077 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 13078 // Zones - READ-ONLY; The virtual machine zones. 13079 Zones *[]string `json:"zones,omitempty"` 13080 // ID - READ-ONLY; Resource Id 13081 ID *string `json:"id,omitempty"` 13082 // Name - READ-ONLY; Resource name 13083 Name *string `json:"name,omitempty"` 13084 // Type - READ-ONLY; Resource type 13085 Type *string `json:"type,omitempty"` 13086 // Location - Resource location 13087 Location *string `json:"location,omitempty"` 13088 // Tags - Resource tags 13089 Tags map[string]*string `json:"tags"` 13090} 13091 13092// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 13093func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 13094 objectMap := make(map[string]interface{}) 13095 if vmssv.VirtualMachineScaleSetVMProperties != nil { 13096 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 13097 } 13098 if vmssv.Plan != nil { 13099 objectMap["plan"] = vmssv.Plan 13100 } 13101 if vmssv.Location != nil { 13102 objectMap["location"] = vmssv.Location 13103 } 13104 if vmssv.Tags != nil { 13105 objectMap["tags"] = vmssv.Tags 13106 } 13107 return json.Marshal(objectMap) 13108} 13109 13110// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 13111func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 13112 var m map[string]*json.RawMessage 13113 err := json.Unmarshal(body, &m) 13114 if err != nil { 13115 return err 13116 } 13117 for k, v := range m { 13118 switch k { 13119 case "instanceId": 13120 if v != nil { 13121 var instanceID string 13122 err = json.Unmarshal(*v, &instanceID) 13123 if err != nil { 13124 return err 13125 } 13126 vmssv.InstanceID = &instanceID 13127 } 13128 case "sku": 13129 if v != nil { 13130 var sku Sku 13131 err = json.Unmarshal(*v, &sku) 13132 if err != nil { 13133 return err 13134 } 13135 vmssv.Sku = &sku 13136 } 13137 case "properties": 13138 if v != nil { 13139 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 13140 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 13141 if err != nil { 13142 return err 13143 } 13144 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 13145 } 13146 case "plan": 13147 if v != nil { 13148 var plan Plan 13149 err = json.Unmarshal(*v, &plan) 13150 if err != nil { 13151 return err 13152 } 13153 vmssv.Plan = &plan 13154 } 13155 case "resources": 13156 if v != nil { 13157 var resources []VirtualMachineExtension 13158 err = json.Unmarshal(*v, &resources) 13159 if err != nil { 13160 return err 13161 } 13162 vmssv.Resources = &resources 13163 } 13164 case "zones": 13165 if v != nil { 13166 var zones []string 13167 err = json.Unmarshal(*v, &zones) 13168 if err != nil { 13169 return err 13170 } 13171 vmssv.Zones = &zones 13172 } 13173 case "id": 13174 if v != nil { 13175 var ID string 13176 err = json.Unmarshal(*v, &ID) 13177 if err != nil { 13178 return err 13179 } 13180 vmssv.ID = &ID 13181 } 13182 case "name": 13183 if v != nil { 13184 var name string 13185 err = json.Unmarshal(*v, &name) 13186 if err != nil { 13187 return err 13188 } 13189 vmssv.Name = &name 13190 } 13191 case "type": 13192 if v != nil { 13193 var typeVar string 13194 err = json.Unmarshal(*v, &typeVar) 13195 if err != nil { 13196 return err 13197 } 13198 vmssv.Type = &typeVar 13199 } 13200 case "location": 13201 if v != nil { 13202 var location string 13203 err = json.Unmarshal(*v, &location) 13204 if err != nil { 13205 return err 13206 } 13207 vmssv.Location = &location 13208 } 13209 case "tags": 13210 if v != nil { 13211 var tags map[string]*string 13212 err = json.Unmarshal(*v, &tags) 13213 if err != nil { 13214 return err 13215 } 13216 vmssv.Tags = tags 13217 } 13218 } 13219 } 13220 13221 return nil 13222} 13223 13224// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 13225// results of a long-running operation. 13226type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 13227 azure.FutureAPI 13228 // Result returns the result of the asynchronous operation. 13229 // If the operation has not completed it will return an error. 13230 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 13231} 13232 13233// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13234func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 13235 var azFuture azure.Future 13236 if err := json.Unmarshal(body, &azFuture); err != nil { 13237 return err 13238 } 13239 future.FutureAPI = &azFuture 13240 future.Result = future.result 13241 return nil 13242} 13243 13244// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. 13245func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { 13246 var done bool 13247 done, err = future.DoneWithContext(context.Background(), client) 13248 if err != nil { 13249 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 13250 return 13251 } 13252 if !done { 13253 vme.Response.Response = future.Response() 13254 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") 13255 return 13256 } 13257 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13258 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 13259 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 13260 if err != nil { 13261 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 13262 } 13263 } 13264 return 13265} 13266 13267// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 13268// of a long-running operation. 13269type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 13270 azure.FutureAPI 13271 // Result returns the result of the asynchronous operation. 13272 // If the operation has not completed it will return an error. 13273 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 13274} 13275 13276// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13277func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 13278 var azFuture azure.Future 13279 if err := json.Unmarshal(body, &azFuture); err != nil { 13280 return err 13281 } 13282 future.FutureAPI = &azFuture 13283 future.Result = future.result 13284 return nil 13285} 13286 13287// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. 13288func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { 13289 var done bool 13290 done, err = future.DoneWithContext(context.Background(), client) 13291 if err != nil { 13292 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 13293 return 13294 } 13295 if !done { 13296 ar.Response = future.Response() 13297 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") 13298 return 13299 } 13300 ar.Response = future.Response() 13301 return 13302} 13303 13304// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 13305// scale set. 13306type VirtualMachineScaleSetVMExtensionsSummary struct { 13307 // Name - READ-ONLY; The extension name. 13308 Name *string `json:"name,omitempty"` 13309 // StatusesSummary - READ-ONLY; The extensions information. 13310 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 13311} 13312 13313// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. 13314func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { 13315 objectMap := make(map[string]interface{}) 13316 return json.Marshal(objectMap) 13317} 13318 13319// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 13320// of a long-running operation. 13321type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 13322 azure.FutureAPI 13323 // Result returns the result of the asynchronous operation. 13324 // If the operation has not completed it will return an error. 13325 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 13326} 13327 13328// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13329func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 13330 var azFuture azure.Future 13331 if err := json.Unmarshal(body, &azFuture); err != nil { 13332 return err 13333 } 13334 future.FutureAPI = &azFuture 13335 future.Result = future.result 13336 return nil 13337} 13338 13339// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. 13340func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { 13341 var done bool 13342 done, err = future.DoneWithContext(context.Background(), client) 13343 if err != nil { 13344 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 13345 return 13346 } 13347 if !done { 13348 vme.Response.Response = future.Response() 13349 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") 13350 return 13351 } 13352 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13353 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 13354 vme, err = client.UpdateResponder(vme.Response.Response) 13355 if err != nil { 13356 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 13357 } 13358 } 13359 return 13360} 13361 13362// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 13363// set. 13364type VirtualMachineScaleSetVMInstanceIDs struct { 13365 // 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. 13366 InstanceIds *[]string `json:"instanceIds,omitempty"` 13367} 13368 13369// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 13370// scale set. 13371type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 13372 // InstanceIds - The virtual machine scale set instance ids. 13373 InstanceIds *[]string `json:"instanceIds,omitempty"` 13374} 13375 13376// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 13377type VirtualMachineScaleSetVMInstanceView struct { 13378 autorest.Response `json:"-"` 13379 // PlatformUpdateDomain - The Update Domain count. 13380 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 13381 // PlatformFaultDomain - The Fault Domain count. 13382 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 13383 // RdpThumbPrint - The Remote desktop certificate thumbprint. 13384 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 13385 // VMAgent - The VM Agent running on the virtual machine. 13386 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 13387 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 13388 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 13389 // Disks - The disks information. 13390 Disks *[]DiskInstanceView `json:"disks,omitempty"` 13391 // Extensions - The extensions information. 13392 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 13393 // VMHealth - READ-ONLY; The health status for the VM. 13394 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 13395 // 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. 13396 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 13397 // Statuses - The resource status information. 13398 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 13399 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 13400 PlacementGroupID *string `json:"placementGroupId,omitempty"` 13401} 13402 13403// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 13404func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 13405 objectMap := make(map[string]interface{}) 13406 if vmssviv.PlatformUpdateDomain != nil { 13407 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 13408 } 13409 if vmssviv.PlatformFaultDomain != nil { 13410 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 13411 } 13412 if vmssviv.RdpThumbPrint != nil { 13413 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 13414 } 13415 if vmssviv.VMAgent != nil { 13416 objectMap["vmAgent"] = vmssviv.VMAgent 13417 } 13418 if vmssviv.MaintenanceRedeployStatus != nil { 13419 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 13420 } 13421 if vmssviv.Disks != nil { 13422 objectMap["disks"] = vmssviv.Disks 13423 } 13424 if vmssviv.Extensions != nil { 13425 objectMap["extensions"] = vmssviv.Extensions 13426 } 13427 if vmssviv.BootDiagnostics != nil { 13428 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 13429 } 13430 if vmssviv.Statuses != nil { 13431 objectMap["statuses"] = vmssviv.Statuses 13432 } 13433 if vmssviv.PlacementGroupID != nil { 13434 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 13435 } 13436 return json.Marshal(objectMap) 13437} 13438 13439// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 13440type VirtualMachineScaleSetVMListResult struct { 13441 autorest.Response `json:"-"` 13442 // Value - The list of virtual machine scale sets VMs. 13443 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 13444 // 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 13445 NextLink *string `json:"nextLink,omitempty"` 13446} 13447 13448// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 13449// VirtualMachineScaleSetVM values. 13450type VirtualMachineScaleSetVMListResultIterator struct { 13451 i int 13452 page VirtualMachineScaleSetVMListResultPage 13453} 13454 13455// NextWithContext advances to the next value. If there was an error making 13456// the request the iterator does not advance and the error is returned. 13457func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 13458 if tracing.IsEnabled() { 13459 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 13460 defer func() { 13461 sc := -1 13462 if iter.Response().Response.Response != nil { 13463 sc = iter.Response().Response.Response.StatusCode 13464 } 13465 tracing.EndSpan(ctx, sc, err) 13466 }() 13467 } 13468 iter.i++ 13469 if iter.i < len(iter.page.Values()) { 13470 return nil 13471 } 13472 err = iter.page.NextWithContext(ctx) 13473 if err != nil { 13474 iter.i-- 13475 return err 13476 } 13477 iter.i = 0 13478 return nil 13479} 13480 13481// Next advances to the next value. If there was an error making 13482// the request the iterator does not advance and the error is returned. 13483// Deprecated: Use NextWithContext() instead. 13484func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 13485 return iter.NextWithContext(context.Background()) 13486} 13487 13488// NotDone returns true if the enumeration should be started or is not yet complete. 13489func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 13490 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13491} 13492 13493// Response returns the raw server response from the last page request. 13494func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 13495 return iter.page.Response() 13496} 13497 13498// Value returns the current value or a zero-initialized value if the 13499// iterator has advanced beyond the end of the collection. 13500func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 13501 if !iter.page.NotDone() { 13502 return VirtualMachineScaleSetVM{} 13503 } 13504 return iter.page.Values()[iter.i] 13505} 13506 13507// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 13508func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 13509 return VirtualMachineScaleSetVMListResultIterator{page: page} 13510} 13511 13512// IsEmpty returns true if the ListResult contains no values. 13513func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 13514 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 13515} 13516 13517// hasNextLink returns true if the NextLink is not empty. 13518func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 13519 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 13520} 13521 13522// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 13523// It returns nil if no more results exist. 13524func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 13525 if !vmssvlr.hasNextLink() { 13526 return nil, nil 13527 } 13528 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13529 autorest.AsJSON(), 13530 autorest.AsGet(), 13531 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 13532} 13533 13534// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 13535type VirtualMachineScaleSetVMListResultPage struct { 13536 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 13537 vmssvlr VirtualMachineScaleSetVMListResult 13538} 13539 13540// NextWithContext advances to the next page of values. If there was an error making 13541// the request the page does not advance and the error is returned. 13542func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 13543 if tracing.IsEnabled() { 13544 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 13545 defer func() { 13546 sc := -1 13547 if page.Response().Response.Response != nil { 13548 sc = page.Response().Response.Response.StatusCode 13549 } 13550 tracing.EndSpan(ctx, sc, err) 13551 }() 13552 } 13553 for { 13554 next, err := page.fn(ctx, page.vmssvlr) 13555 if err != nil { 13556 return err 13557 } 13558 page.vmssvlr = next 13559 if !next.hasNextLink() || !next.IsEmpty() { 13560 break 13561 } 13562 } 13563 return nil 13564} 13565 13566// Next advances to the next page of values. If there was an error making 13567// the request the page does not advance and the error is returned. 13568// Deprecated: Use NextWithContext() instead. 13569func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 13570 return page.NextWithContext(context.Background()) 13571} 13572 13573// NotDone returns true if the page enumeration should be started or is not yet complete. 13574func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 13575 return !page.vmssvlr.IsEmpty() 13576} 13577 13578// Response returns the raw server response from the last page request. 13579func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 13580 return page.vmssvlr 13581} 13582 13583// Values returns the slice of values for the current page or nil if there are no values. 13584func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 13585 if page.vmssvlr.IsEmpty() { 13586 return nil 13587 } 13588 return *page.vmssvlr.Value 13589} 13590 13591// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 13592func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 13593 return VirtualMachineScaleSetVMListResultPage{ 13594 fn: getNextPage, 13595 vmssvlr: cur, 13596 } 13597} 13598 13599// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 13600// profile. 13601type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 13602 // NetworkInterfaceConfigurations - The list of network configurations. 13603 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 13604} 13605 13606// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 13607type VirtualMachineScaleSetVMProfile struct { 13608 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 13609 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 13610 // StorageProfile - Specifies the storage settings for the virtual machine disks. 13611 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 13612 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 13613 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 13614 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 13615 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 13616 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 13617 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 13618 // 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 13619 LicenseType *string `json:"licenseType,omitempty"` 13620 // 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', 'Spot' 13621 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 13622 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 13623 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 13624 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 13625 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 13626 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 13627 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 13628} 13629 13630// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 13631// machine. 13632type VirtualMachineScaleSetVMProperties struct { 13633 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 13634 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 13635 // VMID - READ-ONLY; Azure VM unique ID. 13636 VMID *string `json:"vmId,omitempty"` 13637 // InstanceView - READ-ONLY; The virtual machine instance view. 13638 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 13639 // HardwareProfile - Specifies the hardware settings for the virtual machine. 13640 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 13641 // StorageProfile - Specifies the storage settings for the virtual machine disks. 13642 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 13643 // 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. 13644 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 13645 // OsProfile - Specifies the operating system settings for the virtual machine. 13646 OsProfile *OSProfile `json:"osProfile,omitempty"` 13647 // NetworkProfile - Specifies the network interfaces of the virtual machine. 13648 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 13649 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 13650 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 13651 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 13652 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 13653 // 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. 13654 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 13655 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 13656 ProvisioningState *string `json:"provisioningState,omitempty"` 13657 // 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 13658 LicenseType *string `json:"licenseType,omitempty"` 13659 // ModelDefinitionApplied - READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. 13660 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 13661 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 13662 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 13663} 13664 13665// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 13666func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 13667 objectMap := make(map[string]interface{}) 13668 if vmssvp.HardwareProfile != nil { 13669 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 13670 } 13671 if vmssvp.StorageProfile != nil { 13672 objectMap["storageProfile"] = vmssvp.StorageProfile 13673 } 13674 if vmssvp.AdditionalCapabilities != nil { 13675 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 13676 } 13677 if vmssvp.OsProfile != nil { 13678 objectMap["osProfile"] = vmssvp.OsProfile 13679 } 13680 if vmssvp.NetworkProfile != nil { 13681 objectMap["networkProfile"] = vmssvp.NetworkProfile 13682 } 13683 if vmssvp.NetworkProfileConfiguration != nil { 13684 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 13685 } 13686 if vmssvp.DiagnosticsProfile != nil { 13687 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 13688 } 13689 if vmssvp.AvailabilitySet != nil { 13690 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 13691 } 13692 if vmssvp.LicenseType != nil { 13693 objectMap["licenseType"] = vmssvp.LicenseType 13694 } 13695 if vmssvp.ProtectionPolicy != nil { 13696 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 13697 } 13698 return json.Marshal(objectMap) 13699} 13700 13701// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 13702type VirtualMachineScaleSetVMProtectionPolicy struct { 13703 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 13704 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 13705 // ProtectFromScaleSetActions - Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. 13706 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 13707} 13708 13709// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 13710type VirtualMachineScaleSetVMReimageParameters struct { 13711 // 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. 13712 TempDisk *bool `json:"tempDisk,omitempty"` 13713} 13714 13715// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 13716// long-running operation. 13717type VirtualMachineScaleSetVMsDeallocateFuture struct { 13718 azure.FutureAPI 13719 // Result returns the result of the asynchronous operation. 13720 // If the operation has not completed it will return an error. 13721 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13722} 13723 13724// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13725func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 13726 var azFuture azure.Future 13727 if err := json.Unmarshal(body, &azFuture); err != nil { 13728 return err 13729 } 13730 future.FutureAPI = &azFuture 13731 future.Result = future.result 13732 return nil 13733} 13734 13735// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 13736func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13737 var done bool 13738 done, err = future.DoneWithContext(context.Background(), client) 13739 if err != nil { 13740 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 13741 return 13742 } 13743 if !done { 13744 ar.Response = future.Response() 13745 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 13746 return 13747 } 13748 ar.Response = future.Response() 13749 return 13750} 13751 13752// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 13753// long-running operation. 13754type VirtualMachineScaleSetVMsDeleteFuture struct { 13755 azure.FutureAPI 13756 // Result returns the result of the asynchronous operation. 13757 // If the operation has not completed it will return an error. 13758 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13759} 13760 13761// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13762func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 13763 var azFuture azure.Future 13764 if err := json.Unmarshal(body, &azFuture); err != nil { 13765 return err 13766 } 13767 future.FutureAPI = &azFuture 13768 future.Result = future.result 13769 return nil 13770} 13771 13772// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 13773func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13774 var done bool 13775 done, err = future.DoneWithContext(context.Background(), client) 13776 if err != nil { 13777 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 13778 return 13779 } 13780 if !done { 13781 ar.Response = future.Response() 13782 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 13783 return 13784 } 13785 ar.Response = future.Response() 13786 return 13787} 13788 13789// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 13790// results of a long-running operation. 13791type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 13792 azure.FutureAPI 13793 // Result returns the result of the asynchronous operation. 13794 // If the operation has not completed it will return an error. 13795 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13796} 13797 13798// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13799func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 13800 var azFuture azure.Future 13801 if err := json.Unmarshal(body, &azFuture); err != nil { 13802 return err 13803 } 13804 future.FutureAPI = &azFuture 13805 future.Result = future.result 13806 return nil 13807} 13808 13809// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 13810func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13811 var done bool 13812 done, err = future.DoneWithContext(context.Background(), client) 13813 if err != nil { 13814 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 13815 return 13816 } 13817 if !done { 13818 ar.Response = future.Response() 13819 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 13820 return 13821 } 13822 ar.Response = future.Response() 13823 return 13824} 13825 13826// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 13827// long-running operation. 13828type VirtualMachineScaleSetVMsPowerOffFuture struct { 13829 azure.FutureAPI 13830 // Result returns the result of the asynchronous operation. 13831 // If the operation has not completed it will return an error. 13832 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13833} 13834 13835// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13836func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 13837 var azFuture azure.Future 13838 if err := json.Unmarshal(body, &azFuture); err != nil { 13839 return err 13840 } 13841 future.FutureAPI = &azFuture 13842 future.Result = future.result 13843 return nil 13844} 13845 13846// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 13847func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13848 var done bool 13849 done, err = future.DoneWithContext(context.Background(), client) 13850 if err != nil { 13851 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 13852 return 13853 } 13854 if !done { 13855 ar.Response = future.Response() 13856 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 13857 return 13858 } 13859 ar.Response = future.Response() 13860 return 13861} 13862 13863// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 13864// long-running operation. 13865type VirtualMachineScaleSetVMsRedeployFuture struct { 13866 azure.FutureAPI 13867 // Result returns the result of the asynchronous operation. 13868 // If the operation has not completed it will return an error. 13869 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13870} 13871 13872// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13873func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 13874 var azFuture azure.Future 13875 if err := json.Unmarshal(body, &azFuture); err != nil { 13876 return err 13877 } 13878 future.FutureAPI = &azFuture 13879 future.Result = future.result 13880 return nil 13881} 13882 13883// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 13884func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13885 var done bool 13886 done, err = future.DoneWithContext(context.Background(), client) 13887 if err != nil { 13888 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 13889 return 13890 } 13891 if !done { 13892 ar.Response = future.Response() 13893 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 13894 return 13895 } 13896 ar.Response = future.Response() 13897 return 13898} 13899 13900// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 13901// long-running operation. 13902type VirtualMachineScaleSetVMsReimageAllFuture struct { 13903 azure.FutureAPI 13904 // Result returns the result of the asynchronous operation. 13905 // If the operation has not completed it will return an error. 13906 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13907} 13908 13909// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13910func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 13911 var azFuture azure.Future 13912 if err := json.Unmarshal(body, &azFuture); err != nil { 13913 return err 13914 } 13915 future.FutureAPI = &azFuture 13916 future.Result = future.result 13917 return nil 13918} 13919 13920// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 13921func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13922 var done bool 13923 done, err = future.DoneWithContext(context.Background(), client) 13924 if err != nil { 13925 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 13926 return 13927 } 13928 if !done { 13929 ar.Response = future.Response() 13930 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 13931 return 13932 } 13933 ar.Response = future.Response() 13934 return 13935} 13936 13937// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 13938// long-running operation. 13939type VirtualMachineScaleSetVMsReimageFuture struct { 13940 azure.FutureAPI 13941 // Result returns the result of the asynchronous operation. 13942 // If the operation has not completed it will return an error. 13943 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13944} 13945 13946// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13947func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 13948 var azFuture azure.Future 13949 if err := json.Unmarshal(body, &azFuture); err != nil { 13950 return err 13951 } 13952 future.FutureAPI = &azFuture 13953 future.Result = future.result 13954 return nil 13955} 13956 13957// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 13958func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13959 var done bool 13960 done, err = future.DoneWithContext(context.Background(), client) 13961 if err != nil { 13962 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 13963 return 13964 } 13965 if !done { 13966 ar.Response = future.Response() 13967 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 13968 return 13969 } 13970 ar.Response = future.Response() 13971 return 13972} 13973 13974// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 13975// long-running operation. 13976type VirtualMachineScaleSetVMsRestartFuture struct { 13977 azure.FutureAPI 13978 // Result returns the result of the asynchronous operation. 13979 // If the operation has not completed it will return an error. 13980 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13981} 13982 13983// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13984func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 13985 var azFuture azure.Future 13986 if err := json.Unmarshal(body, &azFuture); err != nil { 13987 return err 13988 } 13989 future.FutureAPI = &azFuture 13990 future.Result = future.result 13991 return nil 13992} 13993 13994// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 13995func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 13996 var done bool 13997 done, err = future.DoneWithContext(context.Background(), client) 13998 if err != nil { 13999 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 14000 return 14001 } 14002 if !done { 14003 ar.Response = future.Response() 14004 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 14005 return 14006 } 14007 ar.Response = future.Response() 14008 return 14009} 14010 14011// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 14012// long-running operation. 14013type VirtualMachineScaleSetVMsRunCommandFuture struct { 14014 azure.FutureAPI 14015 // Result returns the result of the asynchronous operation. 14016 // If the operation has not completed it will return an error. 14017 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 14018} 14019 14020// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14021func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { 14022 var azFuture azure.Future 14023 if err := json.Unmarshal(body, &azFuture); err != nil { 14024 return err 14025 } 14026 future.FutureAPI = &azFuture 14027 future.Result = future.result 14028 return nil 14029} 14030 14031// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. 14032func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { 14033 var done bool 14034 done, err = future.DoneWithContext(context.Background(), client) 14035 if err != nil { 14036 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") 14037 return 14038 } 14039 if !done { 14040 rcr.Response.Response = future.Response() 14041 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") 14042 return 14043 } 14044 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14045 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 14046 rcr, err = client.RunCommandResponder(rcr.Response.Response) 14047 if err != nil { 14048 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 14049 } 14050 } 14051 return 14052} 14053 14054// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 14055// long-running operation. 14056type VirtualMachineScaleSetVMsStartFuture struct { 14057 azure.FutureAPI 14058 // Result returns the result of the asynchronous operation. 14059 // If the operation has not completed it will return an error. 14060 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14061} 14062 14063// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14064func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 14065 var azFuture azure.Future 14066 if err := json.Unmarshal(body, &azFuture); err != nil { 14067 return err 14068 } 14069 future.FutureAPI = &azFuture 14070 future.Result = future.result 14071 return nil 14072} 14073 14074// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 14075func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14076 var done bool 14077 done, err = future.DoneWithContext(context.Background(), client) 14078 if err != nil { 14079 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 14080 return 14081 } 14082 if !done { 14083 ar.Response = future.Response() 14084 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 14085 return 14086 } 14087 ar.Response = future.Response() 14088 return 14089} 14090 14091// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 14092// long-running operation. 14093type VirtualMachineScaleSetVMsUpdateFuture struct { 14094 azure.FutureAPI 14095 // Result returns the result of the asynchronous operation. 14096 // If the operation has not completed it will return an error. 14097 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 14098} 14099 14100// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14101func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 14102 var azFuture azure.Future 14103 if err := json.Unmarshal(body, &azFuture); err != nil { 14104 return err 14105 } 14106 future.FutureAPI = &azFuture 14107 future.Result = future.result 14108 return nil 14109} 14110 14111// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 14112func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 14113 var done bool 14114 done, err = future.DoneWithContext(context.Background(), client) 14115 if err != nil { 14116 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 14117 return 14118 } 14119 if !done { 14120 vmssv.Response.Response = future.Response() 14121 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 14122 return 14123 } 14124 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14125 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 14126 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 14127 if err != nil { 14128 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 14129 } 14130 } 14131 return 14132} 14133 14134// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 14135// operation. 14136type VirtualMachinesCaptureFuture struct { 14137 azure.FutureAPI 14138 // Result returns the result of the asynchronous operation. 14139 // If the operation has not completed it will return an error. 14140 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 14141} 14142 14143// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14144func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 14145 var azFuture azure.Future 14146 if err := json.Unmarshal(body, &azFuture); err != nil { 14147 return err 14148 } 14149 future.FutureAPI = &azFuture 14150 future.Result = future.result 14151 return nil 14152} 14153 14154// result is the default implementation for VirtualMachinesCaptureFuture.Result. 14155func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 14156 var done bool 14157 done, err = future.DoneWithContext(context.Background(), client) 14158 if err != nil { 14159 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 14160 return 14161 } 14162 if !done { 14163 vmcr.Response.Response = future.Response() 14164 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 14165 return 14166 } 14167 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14168 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 14169 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 14170 if err != nil { 14171 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 14172 } 14173 } 14174 return 14175} 14176 14177// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 14178// long-running operation. 14179type VirtualMachinesConvertToManagedDisksFuture struct { 14180 azure.FutureAPI 14181 // Result returns the result of the asynchronous operation. 14182 // If the operation has not completed it will return an error. 14183 Result func(VirtualMachinesClient) (autorest.Response, error) 14184} 14185 14186// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14187func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 14188 var azFuture azure.Future 14189 if err := json.Unmarshal(body, &azFuture); err != nil { 14190 return err 14191 } 14192 future.FutureAPI = &azFuture 14193 future.Result = future.result 14194 return nil 14195} 14196 14197// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 14198func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14199 var done bool 14200 done, err = future.DoneWithContext(context.Background(), client) 14201 if err != nil { 14202 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 14203 return 14204 } 14205 if !done { 14206 ar.Response = future.Response() 14207 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 14208 return 14209 } 14210 ar.Response = future.Response() 14211 return 14212} 14213 14214// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 14215// long-running operation. 14216type VirtualMachinesCreateOrUpdateFuture struct { 14217 azure.FutureAPI 14218 // Result returns the result of the asynchronous operation. 14219 // If the operation has not completed it will return an error. 14220 Result func(VirtualMachinesClient) (VirtualMachine, error) 14221} 14222 14223// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14224func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 14225 var azFuture azure.Future 14226 if err := json.Unmarshal(body, &azFuture); err != nil { 14227 return err 14228 } 14229 future.FutureAPI = &azFuture 14230 future.Result = future.result 14231 return nil 14232} 14233 14234// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 14235func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 14236 var done bool 14237 done, err = future.DoneWithContext(context.Background(), client) 14238 if err != nil { 14239 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 14240 return 14241 } 14242 if !done { 14243 VM.Response.Response = future.Response() 14244 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 14245 return 14246 } 14247 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14248 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 14249 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 14250 if err != nil { 14251 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 14252 } 14253 } 14254 return 14255} 14256 14257// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 14258// long-running operation. 14259type VirtualMachinesDeallocateFuture struct { 14260 azure.FutureAPI 14261 // Result returns the result of the asynchronous operation. 14262 // If the operation has not completed it will return an error. 14263 Result func(VirtualMachinesClient) (autorest.Response, error) 14264} 14265 14266// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14267func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 14268 var azFuture azure.Future 14269 if err := json.Unmarshal(body, &azFuture); err != nil { 14270 return err 14271 } 14272 future.FutureAPI = &azFuture 14273 future.Result = future.result 14274 return nil 14275} 14276 14277// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 14278func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14279 var done bool 14280 done, err = future.DoneWithContext(context.Background(), client) 14281 if err != nil { 14282 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 14283 return 14284 } 14285 if !done { 14286 ar.Response = future.Response() 14287 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 14288 return 14289 } 14290 ar.Response = future.Response() 14291 return 14292} 14293 14294// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 14295// operation. 14296type VirtualMachinesDeleteFuture struct { 14297 azure.FutureAPI 14298 // Result returns the result of the asynchronous operation. 14299 // If the operation has not completed it will return an error. 14300 Result func(VirtualMachinesClient) (autorest.Response, error) 14301} 14302 14303// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14304func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 14305 var azFuture azure.Future 14306 if err := json.Unmarshal(body, &azFuture); err != nil { 14307 return err 14308 } 14309 future.FutureAPI = &azFuture 14310 future.Result = future.result 14311 return nil 14312} 14313 14314// result is the default implementation for VirtualMachinesDeleteFuture.Result. 14315func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14316 var done bool 14317 done, err = future.DoneWithContext(context.Background(), client) 14318 if err != nil { 14319 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 14320 return 14321 } 14322 if !done { 14323 ar.Response = future.Response() 14324 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 14325 return 14326 } 14327 ar.Response = future.Response() 14328 return 14329} 14330 14331// VirtualMachineSize describes the properties of a VM size. 14332type VirtualMachineSize struct { 14333 // Name - The name of the virtual machine size. 14334 Name *string `json:"name,omitempty"` 14335 // NumberOfCores - The number of cores supported by the virtual machine size. 14336 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 14337 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 14338 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 14339 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 14340 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 14341 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 14342 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 14343 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 14344 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 14345} 14346 14347// VirtualMachineSizeListResult the List Virtual Machine operation response. 14348type VirtualMachineSizeListResult struct { 14349 autorest.Response `json:"-"` 14350 // Value - The list of virtual machine sizes. 14351 Value *[]VirtualMachineSize `json:"value,omitempty"` 14352} 14353 14354// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 14355// long-running operation. 14356type VirtualMachinesPerformMaintenanceFuture struct { 14357 azure.FutureAPI 14358 // Result returns the result of the asynchronous operation. 14359 // If the operation has not completed it will return an error. 14360 Result func(VirtualMachinesClient) (autorest.Response, error) 14361} 14362 14363// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14364func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 14365 var azFuture azure.Future 14366 if err := json.Unmarshal(body, &azFuture); err != nil { 14367 return err 14368 } 14369 future.FutureAPI = &azFuture 14370 future.Result = future.result 14371 return nil 14372} 14373 14374// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 14375func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14376 var done bool 14377 done, err = future.DoneWithContext(context.Background(), client) 14378 if err != nil { 14379 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 14380 return 14381 } 14382 if !done { 14383 ar.Response = future.Response() 14384 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 14385 return 14386 } 14387 ar.Response = future.Response() 14388 return 14389} 14390 14391// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 14392// operation. 14393type VirtualMachinesPowerOffFuture struct { 14394 azure.FutureAPI 14395 // Result returns the result of the asynchronous operation. 14396 // If the operation has not completed it will return an error. 14397 Result func(VirtualMachinesClient) (autorest.Response, error) 14398} 14399 14400// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14401func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 14402 var azFuture azure.Future 14403 if err := json.Unmarshal(body, &azFuture); err != nil { 14404 return err 14405 } 14406 future.FutureAPI = &azFuture 14407 future.Result = future.result 14408 return nil 14409} 14410 14411// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 14412func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14413 var done bool 14414 done, err = future.DoneWithContext(context.Background(), client) 14415 if err != nil { 14416 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 14417 return 14418 } 14419 if !done { 14420 ar.Response = future.Response() 14421 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 14422 return 14423 } 14424 ar.Response = future.Response() 14425 return 14426} 14427 14428// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 14429// operation. 14430type VirtualMachinesReapplyFuture struct { 14431 azure.FutureAPI 14432 // Result returns the result of the asynchronous operation. 14433 // If the operation has not completed it will return an error. 14434 Result func(VirtualMachinesClient) (autorest.Response, error) 14435} 14436 14437// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14438func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { 14439 var azFuture azure.Future 14440 if err := json.Unmarshal(body, &azFuture); err != nil { 14441 return err 14442 } 14443 future.FutureAPI = &azFuture 14444 future.Result = future.result 14445 return nil 14446} 14447 14448// result is the default implementation for VirtualMachinesReapplyFuture.Result. 14449func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14450 var done bool 14451 done, err = future.DoneWithContext(context.Background(), client) 14452 if err != nil { 14453 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") 14454 return 14455 } 14456 if !done { 14457 ar.Response = future.Response() 14458 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") 14459 return 14460 } 14461 ar.Response = future.Response() 14462 return 14463} 14464 14465// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 14466// operation. 14467type VirtualMachinesRedeployFuture struct { 14468 azure.FutureAPI 14469 // Result returns the result of the asynchronous operation. 14470 // If the operation has not completed it will return an error. 14471 Result func(VirtualMachinesClient) (autorest.Response, error) 14472} 14473 14474// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14475func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 14476 var azFuture azure.Future 14477 if err := json.Unmarshal(body, &azFuture); err != nil { 14478 return err 14479 } 14480 future.FutureAPI = &azFuture 14481 future.Result = future.result 14482 return nil 14483} 14484 14485// result is the default implementation for VirtualMachinesRedeployFuture.Result. 14486func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14487 var done bool 14488 done, err = future.DoneWithContext(context.Background(), client) 14489 if err != nil { 14490 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 14491 return 14492 } 14493 if !done { 14494 ar.Response = future.Response() 14495 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 14496 return 14497 } 14498 ar.Response = future.Response() 14499 return 14500} 14501 14502// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 14503// operation. 14504type VirtualMachinesReimageFuture struct { 14505 azure.FutureAPI 14506 // Result returns the result of the asynchronous operation. 14507 // If the operation has not completed it will return an error. 14508 Result func(VirtualMachinesClient) (autorest.Response, error) 14509} 14510 14511// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14512func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 14513 var azFuture azure.Future 14514 if err := json.Unmarshal(body, &azFuture); err != nil { 14515 return err 14516 } 14517 future.FutureAPI = &azFuture 14518 future.Result = future.result 14519 return nil 14520} 14521 14522// result is the default implementation for VirtualMachinesReimageFuture.Result. 14523func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14524 var done bool 14525 done, err = future.DoneWithContext(context.Background(), client) 14526 if err != nil { 14527 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 14528 return 14529 } 14530 if !done { 14531 ar.Response = future.Response() 14532 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 14533 return 14534 } 14535 ar.Response = future.Response() 14536 return 14537} 14538 14539// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 14540// operation. 14541type VirtualMachinesRestartFuture struct { 14542 azure.FutureAPI 14543 // Result returns the result of the asynchronous operation. 14544 // If the operation has not completed it will return an error. 14545 Result func(VirtualMachinesClient) (autorest.Response, error) 14546} 14547 14548// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14549func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 14550 var azFuture azure.Future 14551 if err := json.Unmarshal(body, &azFuture); err != nil { 14552 return err 14553 } 14554 future.FutureAPI = &azFuture 14555 future.Result = future.result 14556 return nil 14557} 14558 14559// result is the default implementation for VirtualMachinesRestartFuture.Result. 14560func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14561 var done bool 14562 done, err = future.DoneWithContext(context.Background(), client) 14563 if err != nil { 14564 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 14565 return 14566 } 14567 if !done { 14568 ar.Response = future.Response() 14569 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 14570 return 14571 } 14572 ar.Response = future.Response() 14573 return 14574} 14575 14576// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 14577// long-running operation. 14578type VirtualMachinesRunCommandFuture struct { 14579 azure.FutureAPI 14580 // Result returns the result of the asynchronous operation. 14581 // If the operation has not completed it will return an error. 14582 Result func(VirtualMachinesClient) (RunCommandResult, error) 14583} 14584 14585// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14586func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { 14587 var azFuture azure.Future 14588 if err := json.Unmarshal(body, &azFuture); err != nil { 14589 return err 14590 } 14591 future.FutureAPI = &azFuture 14592 future.Result = future.result 14593 return nil 14594} 14595 14596// result is the default implementation for VirtualMachinesRunCommandFuture.Result. 14597func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { 14598 var done bool 14599 done, err = future.DoneWithContext(context.Background(), client) 14600 if err != nil { 14601 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") 14602 return 14603 } 14604 if !done { 14605 rcr.Response.Response = future.Response() 14606 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") 14607 return 14608 } 14609 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14610 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 14611 rcr, err = client.RunCommandResponder(rcr.Response.Response) 14612 if err != nil { 14613 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 14614 } 14615 } 14616 return 14617} 14618 14619// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 14620// operation. 14621type VirtualMachinesStartFuture struct { 14622 azure.FutureAPI 14623 // Result returns the result of the asynchronous operation. 14624 // If the operation has not completed it will return an error. 14625 Result func(VirtualMachinesClient) (autorest.Response, error) 14626} 14627 14628// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14629func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 14630 var azFuture azure.Future 14631 if err := json.Unmarshal(body, &azFuture); err != nil { 14632 return err 14633 } 14634 future.FutureAPI = &azFuture 14635 future.Result = future.result 14636 return nil 14637} 14638 14639// result is the default implementation for VirtualMachinesStartFuture.Result. 14640func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14641 var done bool 14642 done, err = future.DoneWithContext(context.Background(), client) 14643 if err != nil { 14644 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 14645 return 14646 } 14647 if !done { 14648 ar.Response = future.Response() 14649 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 14650 return 14651 } 14652 ar.Response = future.Response() 14653 return 14654} 14655 14656// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 14657// status summary. 14658type VirtualMachineStatusCodeCount struct { 14659 // Code - READ-ONLY; The instance view status code. 14660 Code *string `json:"code,omitempty"` 14661 // Count - READ-ONLY; The number of instances having a particular status code. 14662 Count *int32 `json:"count,omitempty"` 14663} 14664 14665// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. 14666func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { 14667 objectMap := make(map[string]interface{}) 14668 return json.Marshal(objectMap) 14669} 14670 14671// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 14672// operation. 14673type VirtualMachinesUpdateFuture struct { 14674 azure.FutureAPI 14675 // Result returns the result of the asynchronous operation. 14676 // If the operation has not completed it will return an error. 14677 Result func(VirtualMachinesClient) (VirtualMachine, error) 14678} 14679 14680// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14681func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 14682 var azFuture azure.Future 14683 if err := json.Unmarshal(body, &azFuture); err != nil { 14684 return err 14685 } 14686 future.FutureAPI = &azFuture 14687 future.Result = future.result 14688 return nil 14689} 14690 14691// result is the default implementation for VirtualMachinesUpdateFuture.Result. 14692func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 14693 var done bool 14694 done, err = future.DoneWithContext(context.Background(), client) 14695 if err != nil { 14696 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 14697 return 14698 } 14699 if !done { 14700 VM.Response.Response = future.Response() 14701 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 14702 return 14703 } 14704 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14705 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 14706 VM, err = client.UpdateResponder(VM.Response.Response) 14707 if err != nil { 14708 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 14709 } 14710 } 14711 return 14712} 14713 14714// VirtualMachineUpdate describes a Virtual Machine Update. 14715type VirtualMachineUpdate struct { 14716 // 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**. 14717 Plan *Plan `json:"plan,omitempty"` 14718 *VirtualMachineProperties `json:"properties,omitempty"` 14719 // Identity - The identity of the virtual machine, if configured. 14720 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 14721 // Zones - The virtual machine zones. 14722 Zones *[]string `json:"zones,omitempty"` 14723 // Tags - Resource tags 14724 Tags map[string]*string `json:"tags"` 14725} 14726 14727// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 14728func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 14729 objectMap := make(map[string]interface{}) 14730 if vmu.Plan != nil { 14731 objectMap["plan"] = vmu.Plan 14732 } 14733 if vmu.VirtualMachineProperties != nil { 14734 objectMap["properties"] = vmu.VirtualMachineProperties 14735 } 14736 if vmu.Identity != nil { 14737 objectMap["identity"] = vmu.Identity 14738 } 14739 if vmu.Zones != nil { 14740 objectMap["zones"] = vmu.Zones 14741 } 14742 if vmu.Tags != nil { 14743 objectMap["tags"] = vmu.Tags 14744 } 14745 return json.Marshal(objectMap) 14746} 14747 14748// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 14749func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 14750 var m map[string]*json.RawMessage 14751 err := json.Unmarshal(body, &m) 14752 if err != nil { 14753 return err 14754 } 14755 for k, v := range m { 14756 switch k { 14757 case "plan": 14758 if v != nil { 14759 var plan Plan 14760 err = json.Unmarshal(*v, &plan) 14761 if err != nil { 14762 return err 14763 } 14764 vmu.Plan = &plan 14765 } 14766 case "properties": 14767 if v != nil { 14768 var virtualMachineProperties VirtualMachineProperties 14769 err = json.Unmarshal(*v, &virtualMachineProperties) 14770 if err != nil { 14771 return err 14772 } 14773 vmu.VirtualMachineProperties = &virtualMachineProperties 14774 } 14775 case "identity": 14776 if v != nil { 14777 var identity VirtualMachineIdentity 14778 err = json.Unmarshal(*v, &identity) 14779 if err != nil { 14780 return err 14781 } 14782 vmu.Identity = &identity 14783 } 14784 case "zones": 14785 if v != nil { 14786 var zones []string 14787 err = json.Unmarshal(*v, &zones) 14788 if err != nil { 14789 return err 14790 } 14791 vmu.Zones = &zones 14792 } 14793 case "tags": 14794 if v != nil { 14795 var tags map[string]*string 14796 err = json.Unmarshal(*v, &tags) 14797 if err != nil { 14798 return err 14799 } 14800 vmu.Tags = tags 14801 } 14802 } 14803 } 14804 14805 return nil 14806} 14807 14808// VMScaleSetConvertToSinglePlacementGroupInput ... 14809type VMScaleSetConvertToSinglePlacementGroupInput struct { 14810 // ActivePlacementGroupID - Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. 14811 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 14812} 14813 14814// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 14815type WindowsConfiguration struct { 14816 // 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. 14817 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 14818 // EnableAutomaticUpdates - Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. 14819 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 14820 // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". <br><br> Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). 14821 TimeZone *string `json:"timeZone,omitempty"` 14822 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 14823 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 14824 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 14825 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 14826} 14827 14828// WinRMConfiguration describes Windows Remote Management configuration of the VM 14829type WinRMConfiguration struct { 14830 // Listeners - The list of Windows Remote Management listeners 14831 Listeners *[]WinRMListener `json:"listeners,omitempty"` 14832} 14833 14834// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 14835type WinRMListener struct { 14836 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 14837 Protocol ProtocolTypes `json:"protocol,omitempty"` 14838 // 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>} 14839 CertificateURL *string `json:"certificateUrl,omitempty"` 14840} 14841