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-12-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 // GalleryImageReference - Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. 1055 GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` 1056 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 1057 SourceURI *string `json:"sourceUri,omitempty"` 1058 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 1059 SourceResourceID *string `json:"sourceResourceId,omitempty"` 1060 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 1061 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 1062 // 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). 1063 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 1064} 1065 1066// MarshalJSON is the custom marshaler for CreationData. 1067func (cd CreationData) MarshalJSON() ([]byte, error) { 1068 objectMap := make(map[string]interface{}) 1069 if cd.CreateOption != "" { 1070 objectMap["createOption"] = cd.CreateOption 1071 } 1072 if cd.StorageAccountID != nil { 1073 objectMap["storageAccountId"] = cd.StorageAccountID 1074 } 1075 if cd.ImageReference != nil { 1076 objectMap["imageReference"] = cd.ImageReference 1077 } 1078 if cd.GalleryImageReference != nil { 1079 objectMap["galleryImageReference"] = cd.GalleryImageReference 1080 } 1081 if cd.SourceURI != nil { 1082 objectMap["sourceUri"] = cd.SourceURI 1083 } 1084 if cd.SourceResourceID != nil { 1085 objectMap["sourceResourceId"] = cd.SourceResourceID 1086 } 1087 if cd.UploadSizeBytes != nil { 1088 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 1089 } 1090 return json.Marshal(objectMap) 1091} 1092 1093// DataDisk describes a data disk. 1094type DataDisk struct { 1095 // 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. 1096 Lun *int32 `json:"lun,omitempty"` 1097 // Name - The disk name. 1098 Name *string `json:"name,omitempty"` 1099 // Vhd - The virtual hard disk. 1100 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1101 // 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. 1102 Image *VirtualHardDisk `json:"image,omitempty"` 1103 // 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' 1104 Caching CachingTypes `json:"caching,omitempty"` 1105 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1106 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1107 // 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' 1108 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1109 // 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 1110 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1111 // ManagedDisk - The managed disk parameters. 1112 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1113 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 1114 ToBeDetached *bool `json:"toBeDetached,omitempty"` 1115 // 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. 1116 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1117 // 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. 1118 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 1119} 1120 1121// MarshalJSON is the custom marshaler for DataDisk. 1122func (dd DataDisk) MarshalJSON() ([]byte, error) { 1123 objectMap := make(map[string]interface{}) 1124 if dd.Lun != nil { 1125 objectMap["lun"] = dd.Lun 1126 } 1127 if dd.Name != nil { 1128 objectMap["name"] = dd.Name 1129 } 1130 if dd.Vhd != nil { 1131 objectMap["vhd"] = dd.Vhd 1132 } 1133 if dd.Image != nil { 1134 objectMap["image"] = dd.Image 1135 } 1136 if dd.Caching != "" { 1137 objectMap["caching"] = dd.Caching 1138 } 1139 if dd.WriteAcceleratorEnabled != nil { 1140 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 1141 } 1142 if dd.CreateOption != "" { 1143 objectMap["createOption"] = dd.CreateOption 1144 } 1145 if dd.DiskSizeGB != nil { 1146 objectMap["diskSizeGB"] = dd.DiskSizeGB 1147 } 1148 if dd.ManagedDisk != nil { 1149 objectMap["managedDisk"] = dd.ManagedDisk 1150 } 1151 if dd.ToBeDetached != nil { 1152 objectMap["toBeDetached"] = dd.ToBeDetached 1153 } 1154 return json.Marshal(objectMap) 1155} 1156 1157// DataDiskImage contains the data disk images information. 1158type DataDiskImage struct { 1159 // 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. 1160 Lun *int32 `json:"lun,omitempty"` 1161} 1162 1163// MarshalJSON is the custom marshaler for DataDiskImage. 1164func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { 1165 objectMap := make(map[string]interface{}) 1166 return json.Marshal(objectMap) 1167} 1168 1169// DataDiskImageEncryption contains encryption settings for a data disk image. 1170type DataDiskImageEncryption struct { 1171 // 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. 1172 Lun *int32 `json:"lun,omitempty"` 1173 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 1174 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 1175} 1176 1177// DedicatedHost specifies information about the Dedicated host. 1178type DedicatedHost struct { 1179 autorest.Response `json:"-"` 1180 *DedicatedHostProperties `json:"properties,omitempty"` 1181 // 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. 1182 Sku *Sku `json:"sku,omitempty"` 1183 // ID - READ-ONLY; Resource Id 1184 ID *string `json:"id,omitempty"` 1185 // Name - READ-ONLY; Resource name 1186 Name *string `json:"name,omitempty"` 1187 // Type - READ-ONLY; Resource type 1188 Type *string `json:"type,omitempty"` 1189 // Location - Resource location 1190 Location *string `json:"location,omitempty"` 1191 // Tags - Resource tags 1192 Tags map[string]*string `json:"tags"` 1193} 1194 1195// MarshalJSON is the custom marshaler for DedicatedHost. 1196func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 1197 objectMap := make(map[string]interface{}) 1198 if dh.DedicatedHostProperties != nil { 1199 objectMap["properties"] = dh.DedicatedHostProperties 1200 } 1201 if dh.Sku != nil { 1202 objectMap["sku"] = dh.Sku 1203 } 1204 if dh.Location != nil { 1205 objectMap["location"] = dh.Location 1206 } 1207 if dh.Tags != nil { 1208 objectMap["tags"] = dh.Tags 1209 } 1210 return json.Marshal(objectMap) 1211} 1212 1213// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 1214func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 1215 var m map[string]*json.RawMessage 1216 err := json.Unmarshal(body, &m) 1217 if err != nil { 1218 return err 1219 } 1220 for k, v := range m { 1221 switch k { 1222 case "properties": 1223 if v != nil { 1224 var dedicatedHostProperties DedicatedHostProperties 1225 err = json.Unmarshal(*v, &dedicatedHostProperties) 1226 if err != nil { 1227 return err 1228 } 1229 dh.DedicatedHostProperties = &dedicatedHostProperties 1230 } 1231 case "sku": 1232 if v != nil { 1233 var sku Sku 1234 err = json.Unmarshal(*v, &sku) 1235 if err != nil { 1236 return err 1237 } 1238 dh.Sku = &sku 1239 } 1240 case "id": 1241 if v != nil { 1242 var ID string 1243 err = json.Unmarshal(*v, &ID) 1244 if err != nil { 1245 return err 1246 } 1247 dh.ID = &ID 1248 } 1249 case "name": 1250 if v != nil { 1251 var name string 1252 err = json.Unmarshal(*v, &name) 1253 if err != nil { 1254 return err 1255 } 1256 dh.Name = &name 1257 } 1258 case "type": 1259 if v != nil { 1260 var typeVar string 1261 err = json.Unmarshal(*v, &typeVar) 1262 if err != nil { 1263 return err 1264 } 1265 dh.Type = &typeVar 1266 } 1267 case "location": 1268 if v != nil { 1269 var location string 1270 err = json.Unmarshal(*v, &location) 1271 if err != nil { 1272 return err 1273 } 1274 dh.Location = &location 1275 } 1276 case "tags": 1277 if v != nil { 1278 var tags map[string]*string 1279 err = json.Unmarshal(*v, &tags) 1280 if err != nil { 1281 return err 1282 } 1283 dh.Tags = tags 1284 } 1285 } 1286 } 1287 1288 return nil 1289} 1290 1291// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 1292// size. 1293type DedicatedHostAllocatableVM struct { 1294 // VMSize - VM size in terms of which the unutilized capacity is represented. 1295 VMSize *string `json:"vmSize,omitempty"` 1296 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 1297 Count *float64 `json:"count,omitempty"` 1298} 1299 1300// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 1301type DedicatedHostAvailableCapacity struct { 1302 // 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. 1303 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 1304} 1305 1306// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 1307// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 1308// creation time. An existing dedicated host cannot be added to another dedicated host group. 1309type DedicatedHostGroup struct { 1310 autorest.Response `json:"-"` 1311 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1312 // 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. 1313 Zones *[]string `json:"zones,omitempty"` 1314 // ID - READ-ONLY; Resource Id 1315 ID *string `json:"id,omitempty"` 1316 // Name - READ-ONLY; Resource name 1317 Name *string `json:"name,omitempty"` 1318 // Type - READ-ONLY; Resource type 1319 Type *string `json:"type,omitempty"` 1320 // Location - Resource location 1321 Location *string `json:"location,omitempty"` 1322 // Tags - Resource tags 1323 Tags map[string]*string `json:"tags"` 1324} 1325 1326// MarshalJSON is the custom marshaler for DedicatedHostGroup. 1327func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 1328 objectMap := make(map[string]interface{}) 1329 if dhg.DedicatedHostGroupProperties != nil { 1330 objectMap["properties"] = dhg.DedicatedHostGroupProperties 1331 } 1332 if dhg.Zones != nil { 1333 objectMap["zones"] = dhg.Zones 1334 } 1335 if dhg.Location != nil { 1336 objectMap["location"] = dhg.Location 1337 } 1338 if dhg.Tags != nil { 1339 objectMap["tags"] = dhg.Tags 1340 } 1341 return json.Marshal(objectMap) 1342} 1343 1344// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 1345func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 1346 var m map[string]*json.RawMessage 1347 err := json.Unmarshal(body, &m) 1348 if err != nil { 1349 return err 1350 } 1351 for k, v := range m { 1352 switch k { 1353 case "properties": 1354 if v != nil { 1355 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1356 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1357 if err != nil { 1358 return err 1359 } 1360 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1361 } 1362 case "zones": 1363 if v != nil { 1364 var zones []string 1365 err = json.Unmarshal(*v, &zones) 1366 if err != nil { 1367 return err 1368 } 1369 dhg.Zones = &zones 1370 } 1371 case "id": 1372 if v != nil { 1373 var ID string 1374 err = json.Unmarshal(*v, &ID) 1375 if err != nil { 1376 return err 1377 } 1378 dhg.ID = &ID 1379 } 1380 case "name": 1381 if v != nil { 1382 var name string 1383 err = json.Unmarshal(*v, &name) 1384 if err != nil { 1385 return err 1386 } 1387 dhg.Name = &name 1388 } 1389 case "type": 1390 if v != nil { 1391 var typeVar string 1392 err = json.Unmarshal(*v, &typeVar) 1393 if err != nil { 1394 return err 1395 } 1396 dhg.Type = &typeVar 1397 } 1398 case "location": 1399 if v != nil { 1400 var location string 1401 err = json.Unmarshal(*v, &location) 1402 if err != nil { 1403 return err 1404 } 1405 dhg.Location = &location 1406 } 1407 case "tags": 1408 if v != nil { 1409 var tags map[string]*string 1410 err = json.Unmarshal(*v, &tags) 1411 if err != nil { 1412 return err 1413 } 1414 dhg.Tags = tags 1415 } 1416 } 1417 } 1418 1419 return nil 1420} 1421 1422// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 1423type DedicatedHostGroupListResult struct { 1424 autorest.Response `json:"-"` 1425 // Value - The list of dedicated host groups 1426 Value *[]DedicatedHostGroup `json:"value,omitempty"` 1427 // 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. 1428 NextLink *string `json:"nextLink,omitempty"` 1429} 1430 1431// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 1432type DedicatedHostGroupListResultIterator struct { 1433 i int 1434 page DedicatedHostGroupListResultPage 1435} 1436 1437// NextWithContext advances to the next value. If there was an error making 1438// the request the iterator does not advance and the error is returned. 1439func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 1440 if tracing.IsEnabled() { 1441 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 1442 defer func() { 1443 sc := -1 1444 if iter.Response().Response.Response != nil { 1445 sc = iter.Response().Response.Response.StatusCode 1446 } 1447 tracing.EndSpan(ctx, sc, err) 1448 }() 1449 } 1450 iter.i++ 1451 if iter.i < len(iter.page.Values()) { 1452 return nil 1453 } 1454 err = iter.page.NextWithContext(ctx) 1455 if err != nil { 1456 iter.i-- 1457 return err 1458 } 1459 iter.i = 0 1460 return nil 1461} 1462 1463// Next advances to the next value. If there was an error making 1464// the request the iterator does not advance and the error is returned. 1465// Deprecated: Use NextWithContext() instead. 1466func (iter *DedicatedHostGroupListResultIterator) Next() error { 1467 return iter.NextWithContext(context.Background()) 1468} 1469 1470// NotDone returns true if the enumeration should be started or is not yet complete. 1471func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 1472 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1473} 1474 1475// Response returns the raw server response from the last page request. 1476func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 1477 return iter.page.Response() 1478} 1479 1480// Value returns the current value or a zero-initialized value if the 1481// iterator has advanced beyond the end of the collection. 1482func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 1483 if !iter.page.NotDone() { 1484 return DedicatedHostGroup{} 1485 } 1486 return iter.page.Values()[iter.i] 1487} 1488 1489// Creates a new instance of the DedicatedHostGroupListResultIterator type. 1490func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 1491 return DedicatedHostGroupListResultIterator{page: page} 1492} 1493 1494// IsEmpty returns true if the ListResult contains no values. 1495func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 1496 return dhglr.Value == nil || len(*dhglr.Value) == 0 1497} 1498 1499// hasNextLink returns true if the NextLink is not empty. 1500func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 1501 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 1502} 1503 1504// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 1505// It returns nil if no more results exist. 1506func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 1507 if !dhglr.hasNextLink() { 1508 return nil, nil 1509 } 1510 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1511 autorest.AsJSON(), 1512 autorest.AsGet(), 1513 autorest.WithBaseURL(to.String(dhglr.NextLink))) 1514} 1515 1516// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 1517type DedicatedHostGroupListResultPage struct { 1518 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 1519 dhglr DedicatedHostGroupListResult 1520} 1521 1522// NextWithContext advances to the next page of values. If there was an error making 1523// the request the page does not advance and the error is returned. 1524func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1525 if tracing.IsEnabled() { 1526 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 1527 defer func() { 1528 sc := -1 1529 if page.Response().Response.Response != nil { 1530 sc = page.Response().Response.Response.StatusCode 1531 } 1532 tracing.EndSpan(ctx, sc, err) 1533 }() 1534 } 1535 for { 1536 next, err := page.fn(ctx, page.dhglr) 1537 if err != nil { 1538 return err 1539 } 1540 page.dhglr = next 1541 if !next.hasNextLink() || !next.IsEmpty() { 1542 break 1543 } 1544 } 1545 return nil 1546} 1547 1548// Next advances to the next page of values. If there was an error making 1549// the request the page does not advance and the error is returned. 1550// Deprecated: Use NextWithContext() instead. 1551func (page *DedicatedHostGroupListResultPage) Next() error { 1552 return page.NextWithContext(context.Background()) 1553} 1554 1555// NotDone returns true if the page enumeration should be started or is not yet complete. 1556func (page DedicatedHostGroupListResultPage) NotDone() bool { 1557 return !page.dhglr.IsEmpty() 1558} 1559 1560// Response returns the raw server response from the last page request. 1561func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 1562 return page.dhglr 1563} 1564 1565// Values returns the slice of values for the current page or nil if there are no values. 1566func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 1567 if page.dhglr.IsEmpty() { 1568 return nil 1569 } 1570 return *page.dhglr.Value 1571} 1572 1573// Creates a new instance of the DedicatedHostGroupListResultPage type. 1574func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 1575 return DedicatedHostGroupListResultPage{ 1576 fn: getNextPage, 1577 dhglr: cur, 1578 } 1579} 1580 1581// DedicatedHostGroupProperties dedicated Host Group Properties. 1582type DedicatedHostGroupProperties struct { 1583 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 1584 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 1585 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 1586 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 1587} 1588 1589// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 1590func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 1591 objectMap := make(map[string]interface{}) 1592 if dhgp.PlatformFaultDomainCount != nil { 1593 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 1594 } 1595 return json.Marshal(objectMap) 1596} 1597 1598// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 1599// should be assigned to. Only tags may be updated. 1600type DedicatedHostGroupUpdate struct { 1601 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1602 // 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. 1603 Zones *[]string `json:"zones,omitempty"` 1604 // Tags - Resource tags 1605 Tags map[string]*string `json:"tags"` 1606} 1607 1608// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 1609func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 1610 objectMap := make(map[string]interface{}) 1611 if dhgu.DedicatedHostGroupProperties != nil { 1612 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 1613 } 1614 if dhgu.Zones != nil { 1615 objectMap["zones"] = dhgu.Zones 1616 } 1617 if dhgu.Tags != nil { 1618 objectMap["tags"] = dhgu.Tags 1619 } 1620 return json.Marshal(objectMap) 1621} 1622 1623// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 1624func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 1625 var m map[string]*json.RawMessage 1626 err := json.Unmarshal(body, &m) 1627 if err != nil { 1628 return err 1629 } 1630 for k, v := range m { 1631 switch k { 1632 case "properties": 1633 if v != nil { 1634 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1635 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1636 if err != nil { 1637 return err 1638 } 1639 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1640 } 1641 case "zones": 1642 if v != nil { 1643 var zones []string 1644 err = json.Unmarshal(*v, &zones) 1645 if err != nil { 1646 return err 1647 } 1648 dhgu.Zones = &zones 1649 } 1650 case "tags": 1651 if v != nil { 1652 var tags map[string]*string 1653 err = json.Unmarshal(*v, &tags) 1654 if err != nil { 1655 return err 1656 } 1657 dhgu.Tags = tags 1658 } 1659 } 1660 } 1661 1662 return nil 1663} 1664 1665// DedicatedHostInstanceView the instance view of a dedicated host. 1666type DedicatedHostInstanceView struct { 1667 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1668 AssetID *string `json:"assetId,omitempty"` 1669 // AvailableCapacity - Unutilized capacity of the dedicated host. 1670 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1671 // Statuses - The resource status information. 1672 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1673} 1674 1675// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 1676func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 1677 objectMap := make(map[string]interface{}) 1678 if dhiv.AvailableCapacity != nil { 1679 objectMap["availableCapacity"] = dhiv.AvailableCapacity 1680 } 1681 if dhiv.Statuses != nil { 1682 objectMap["statuses"] = dhiv.Statuses 1683 } 1684 return json.Marshal(objectMap) 1685} 1686 1687// DedicatedHostListResult the list dedicated host operation response. 1688type DedicatedHostListResult struct { 1689 autorest.Response `json:"-"` 1690 // Value - The list of dedicated hosts 1691 Value *[]DedicatedHost `json:"value,omitempty"` 1692 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 1693 NextLink *string `json:"nextLink,omitempty"` 1694} 1695 1696// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 1697type DedicatedHostListResultIterator struct { 1698 i int 1699 page DedicatedHostListResultPage 1700} 1701 1702// NextWithContext advances to the next value. If there was an error making 1703// the request the iterator does not advance and the error is returned. 1704func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 1705 if tracing.IsEnabled() { 1706 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 1707 defer func() { 1708 sc := -1 1709 if iter.Response().Response.Response != nil { 1710 sc = iter.Response().Response.Response.StatusCode 1711 } 1712 tracing.EndSpan(ctx, sc, err) 1713 }() 1714 } 1715 iter.i++ 1716 if iter.i < len(iter.page.Values()) { 1717 return nil 1718 } 1719 err = iter.page.NextWithContext(ctx) 1720 if err != nil { 1721 iter.i-- 1722 return err 1723 } 1724 iter.i = 0 1725 return nil 1726} 1727 1728// Next advances to the next value. If there was an error making 1729// the request the iterator does not advance and the error is returned. 1730// Deprecated: Use NextWithContext() instead. 1731func (iter *DedicatedHostListResultIterator) Next() error { 1732 return iter.NextWithContext(context.Background()) 1733} 1734 1735// NotDone returns true if the enumeration should be started or is not yet complete. 1736func (iter DedicatedHostListResultIterator) NotDone() bool { 1737 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1738} 1739 1740// Response returns the raw server response from the last page request. 1741func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 1742 return iter.page.Response() 1743} 1744 1745// Value returns the current value or a zero-initialized value if the 1746// iterator has advanced beyond the end of the collection. 1747func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 1748 if !iter.page.NotDone() { 1749 return DedicatedHost{} 1750 } 1751 return iter.page.Values()[iter.i] 1752} 1753 1754// Creates a new instance of the DedicatedHostListResultIterator type. 1755func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 1756 return DedicatedHostListResultIterator{page: page} 1757} 1758 1759// IsEmpty returns true if the ListResult contains no values. 1760func (dhlr DedicatedHostListResult) IsEmpty() bool { 1761 return dhlr.Value == nil || len(*dhlr.Value) == 0 1762} 1763 1764// hasNextLink returns true if the NextLink is not empty. 1765func (dhlr DedicatedHostListResult) hasNextLink() bool { 1766 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 1767} 1768 1769// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 1770// It returns nil if no more results exist. 1771func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 1772 if !dhlr.hasNextLink() { 1773 return nil, nil 1774 } 1775 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1776 autorest.AsJSON(), 1777 autorest.AsGet(), 1778 autorest.WithBaseURL(to.String(dhlr.NextLink))) 1779} 1780 1781// DedicatedHostListResultPage contains a page of DedicatedHost values. 1782type DedicatedHostListResultPage struct { 1783 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 1784 dhlr DedicatedHostListResult 1785} 1786 1787// NextWithContext advances to the next page of values. If there was an error making 1788// the request the page does not advance and the error is returned. 1789func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 1790 if tracing.IsEnabled() { 1791 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 1792 defer func() { 1793 sc := -1 1794 if page.Response().Response.Response != nil { 1795 sc = page.Response().Response.Response.StatusCode 1796 } 1797 tracing.EndSpan(ctx, sc, err) 1798 }() 1799 } 1800 for { 1801 next, err := page.fn(ctx, page.dhlr) 1802 if err != nil { 1803 return err 1804 } 1805 page.dhlr = next 1806 if !next.hasNextLink() || !next.IsEmpty() { 1807 break 1808 } 1809 } 1810 return nil 1811} 1812 1813// Next advances to the next page of values. If there was an error making 1814// the request the page does not advance and the error is returned. 1815// Deprecated: Use NextWithContext() instead. 1816func (page *DedicatedHostListResultPage) Next() error { 1817 return page.NextWithContext(context.Background()) 1818} 1819 1820// NotDone returns true if the page enumeration should be started or is not yet complete. 1821func (page DedicatedHostListResultPage) NotDone() bool { 1822 return !page.dhlr.IsEmpty() 1823} 1824 1825// Response returns the raw server response from the last page request. 1826func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 1827 return page.dhlr 1828} 1829 1830// Values returns the slice of values for the current page or nil if there are no values. 1831func (page DedicatedHostListResultPage) Values() []DedicatedHost { 1832 if page.dhlr.IsEmpty() { 1833 return nil 1834 } 1835 return *page.dhlr.Value 1836} 1837 1838// Creates a new instance of the DedicatedHostListResultPage type. 1839func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 1840 return DedicatedHostListResultPage{ 1841 fn: getNextPage, 1842 dhlr: cur, 1843 } 1844} 1845 1846// DedicatedHostProperties properties of the dedicated host. 1847type DedicatedHostProperties struct { 1848 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 1849 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 1850 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 1851 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 1852 // 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. 1853 HostID *string `json:"hostId,omitempty"` 1854 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 1855 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 1856 // 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' 1857 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 1858 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 1859 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1860 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1861 ProvisioningState *string `json:"provisioningState,omitempty"` 1862 // InstanceView - READ-ONLY; The dedicated host instance view. 1863 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 1864} 1865 1866// MarshalJSON is the custom marshaler for DedicatedHostProperties. 1867func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 1868 objectMap := make(map[string]interface{}) 1869 if dhp.PlatformFaultDomain != nil { 1870 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 1871 } 1872 if dhp.AutoReplaceOnFailure != nil { 1873 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 1874 } 1875 if dhp.LicenseType != "" { 1876 objectMap["licenseType"] = dhp.LicenseType 1877 } 1878 return json.Marshal(objectMap) 1879} 1880 1881// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1882// long-running operation. 1883type DedicatedHostsCreateOrUpdateFuture struct { 1884 azure.FutureAPI 1885 // Result returns the result of the asynchronous operation. 1886 // If the operation has not completed it will return an error. 1887 Result func(DedicatedHostsClient) (DedicatedHost, error) 1888} 1889 1890// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1891func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1892 var azFuture azure.Future 1893 if err := json.Unmarshal(body, &azFuture); err != nil { 1894 return err 1895 } 1896 future.FutureAPI = &azFuture 1897 future.Result = future.result 1898 return nil 1899} 1900 1901// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. 1902func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 1903 var done bool 1904 done, err = future.DoneWithContext(context.Background(), client) 1905 if err != nil { 1906 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1907 return 1908 } 1909 if !done { 1910 dh.Response.Response = future.Response() 1911 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") 1912 return 1913 } 1914 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1915 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 1916 dh, err = client.CreateOrUpdateResponder(dh.Response.Response) 1917 if err != nil { 1918 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 1919 } 1920 } 1921 return 1922} 1923 1924// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1925// operation. 1926type DedicatedHostsDeleteFuture struct { 1927 azure.FutureAPI 1928 // Result returns the result of the asynchronous operation. 1929 // If the operation has not completed it will return an error. 1930 Result func(DedicatedHostsClient) (autorest.Response, error) 1931} 1932 1933// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1934func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { 1935 var azFuture azure.Future 1936 if err := json.Unmarshal(body, &azFuture); err != nil { 1937 return err 1938 } 1939 future.FutureAPI = &azFuture 1940 future.Result = future.result 1941 return nil 1942} 1943 1944// result is the default implementation for DedicatedHostsDeleteFuture.Result. 1945func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { 1946 var done bool 1947 done, err = future.DoneWithContext(context.Background(), client) 1948 if err != nil { 1949 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") 1950 return 1951 } 1952 if !done { 1953 ar.Response = future.Response() 1954 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") 1955 return 1956 } 1957 ar.Response = future.Response() 1958 return 1959} 1960 1961// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1962// operation. 1963type DedicatedHostsUpdateFuture struct { 1964 azure.FutureAPI 1965 // Result returns the result of the asynchronous operation. 1966 // If the operation has not completed it will return an error. 1967 Result func(DedicatedHostsClient) (DedicatedHost, error) 1968} 1969 1970// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1971func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { 1972 var azFuture azure.Future 1973 if err := json.Unmarshal(body, &azFuture); err != nil { 1974 return err 1975 } 1976 future.FutureAPI = &azFuture 1977 future.Result = future.result 1978 return nil 1979} 1980 1981// result is the default implementation for DedicatedHostsUpdateFuture.Result. 1982func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 1983 var done bool 1984 done, err = future.DoneWithContext(context.Background(), client) 1985 if err != nil { 1986 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") 1987 return 1988 } 1989 if !done { 1990 dh.Response.Response = future.Response() 1991 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") 1992 return 1993 } 1994 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1995 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 1996 dh, err = client.UpdateResponder(dh.Response.Response) 1997 if err != nil { 1998 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 1999 } 2000 } 2001 return 2002} 2003 2004// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 2005// licenseType may be updated. 2006type DedicatedHostUpdate struct { 2007 *DedicatedHostProperties `json:"properties,omitempty"` 2008 // Tags - Resource tags 2009 Tags map[string]*string `json:"tags"` 2010} 2011 2012// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 2013func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 2014 objectMap := make(map[string]interface{}) 2015 if dhu.DedicatedHostProperties != nil { 2016 objectMap["properties"] = dhu.DedicatedHostProperties 2017 } 2018 if dhu.Tags != nil { 2019 objectMap["tags"] = dhu.Tags 2020 } 2021 return json.Marshal(objectMap) 2022} 2023 2024// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 2025func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 2026 var m map[string]*json.RawMessage 2027 err := json.Unmarshal(body, &m) 2028 if err != nil { 2029 return err 2030 } 2031 for k, v := range m { 2032 switch k { 2033 case "properties": 2034 if v != nil { 2035 var dedicatedHostProperties DedicatedHostProperties 2036 err = json.Unmarshal(*v, &dedicatedHostProperties) 2037 if err != nil { 2038 return err 2039 } 2040 dhu.DedicatedHostProperties = &dedicatedHostProperties 2041 } 2042 case "tags": 2043 if v != nil { 2044 var tags map[string]*string 2045 err = json.Unmarshal(*v, &tags) 2046 if err != nil { 2047 return err 2048 } 2049 dhu.Tags = tags 2050 } 2051 } 2052 } 2053 2054 return nil 2055} 2056 2057// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2058// 2015-06-15. 2059type DiagnosticsProfile struct { 2060 // 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. 2061 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 2062} 2063 2064// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 2065// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 2066type DiffDiskSettings struct { 2067 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 2068 Option DiffDiskOptions `json:"option,omitempty"` 2069 // Placement - Specifies the ephemeral disk placement for operating system disk.<br><br> Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.<br><br> Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' 2070 Placement DiffDiskPlacement `json:"placement,omitempty"` 2071} 2072 2073// Disallowed describes the disallowed disk types. 2074type Disallowed struct { 2075 // DiskTypes - A list of disk types. 2076 DiskTypes *[]string `json:"diskTypes,omitempty"` 2077} 2078 2079// Disk disk resource. 2080type Disk struct { 2081 autorest.Response `json:"-"` 2082 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 2083 ManagedBy *string `json:"managedBy,omitempty"` 2084 // ManagedByExtended - READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. 2085 ManagedByExtended *[]string `json:"managedByExtended,omitempty"` 2086 Sku *DiskSku `json:"sku,omitempty"` 2087 // Zones - The Logical zone list for Disk. 2088 Zones *[]string `json:"zones,omitempty"` 2089 *DiskProperties `json:"properties,omitempty"` 2090 // ID - READ-ONLY; Resource Id 2091 ID *string `json:"id,omitempty"` 2092 // Name - READ-ONLY; Resource name 2093 Name *string `json:"name,omitempty"` 2094 // Type - READ-ONLY; Resource type 2095 Type *string `json:"type,omitempty"` 2096 // Location - Resource location 2097 Location *string `json:"location,omitempty"` 2098 // Tags - Resource tags 2099 Tags map[string]*string `json:"tags"` 2100} 2101 2102// MarshalJSON is the custom marshaler for Disk. 2103func (d Disk) MarshalJSON() ([]byte, error) { 2104 objectMap := make(map[string]interface{}) 2105 if d.Sku != nil { 2106 objectMap["sku"] = d.Sku 2107 } 2108 if d.Zones != nil { 2109 objectMap["zones"] = d.Zones 2110 } 2111 if d.DiskProperties != nil { 2112 objectMap["properties"] = d.DiskProperties 2113 } 2114 if d.Location != nil { 2115 objectMap["location"] = d.Location 2116 } 2117 if d.Tags != nil { 2118 objectMap["tags"] = d.Tags 2119 } 2120 return json.Marshal(objectMap) 2121} 2122 2123// UnmarshalJSON is the custom unmarshaler for Disk struct. 2124func (d *Disk) UnmarshalJSON(body []byte) error { 2125 var m map[string]*json.RawMessage 2126 err := json.Unmarshal(body, &m) 2127 if err != nil { 2128 return err 2129 } 2130 for k, v := range m { 2131 switch k { 2132 case "managedBy": 2133 if v != nil { 2134 var managedBy string 2135 err = json.Unmarshal(*v, &managedBy) 2136 if err != nil { 2137 return err 2138 } 2139 d.ManagedBy = &managedBy 2140 } 2141 case "managedByExtended": 2142 if v != nil { 2143 var managedByExtended []string 2144 err = json.Unmarshal(*v, &managedByExtended) 2145 if err != nil { 2146 return err 2147 } 2148 d.ManagedByExtended = &managedByExtended 2149 } 2150 case "sku": 2151 if v != nil { 2152 var sku DiskSku 2153 err = json.Unmarshal(*v, &sku) 2154 if err != nil { 2155 return err 2156 } 2157 d.Sku = &sku 2158 } 2159 case "zones": 2160 if v != nil { 2161 var zones []string 2162 err = json.Unmarshal(*v, &zones) 2163 if err != nil { 2164 return err 2165 } 2166 d.Zones = &zones 2167 } 2168 case "properties": 2169 if v != nil { 2170 var diskProperties DiskProperties 2171 err = json.Unmarshal(*v, &diskProperties) 2172 if err != nil { 2173 return err 2174 } 2175 d.DiskProperties = &diskProperties 2176 } 2177 case "id": 2178 if v != nil { 2179 var ID string 2180 err = json.Unmarshal(*v, &ID) 2181 if err != nil { 2182 return err 2183 } 2184 d.ID = &ID 2185 } 2186 case "name": 2187 if v != nil { 2188 var name string 2189 err = json.Unmarshal(*v, &name) 2190 if err != nil { 2191 return err 2192 } 2193 d.Name = &name 2194 } 2195 case "type": 2196 if v != nil { 2197 var typeVar string 2198 err = json.Unmarshal(*v, &typeVar) 2199 if err != nil { 2200 return err 2201 } 2202 d.Type = &typeVar 2203 } 2204 case "location": 2205 if v != nil { 2206 var location string 2207 err = json.Unmarshal(*v, &location) 2208 if err != nil { 2209 return err 2210 } 2211 d.Location = &location 2212 } 2213 case "tags": 2214 if v != nil { 2215 var tags map[string]*string 2216 err = json.Unmarshal(*v, &tags) 2217 if err != nil { 2218 return err 2219 } 2220 d.Tags = tags 2221 } 2222 } 2223 } 2224 2225 return nil 2226} 2227 2228// DiskEncryptionSet disk encryption set resource. 2229type DiskEncryptionSet struct { 2230 autorest.Response `json:"-"` 2231 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 2232 *EncryptionSetProperties `json:"properties,omitempty"` 2233 // ID - READ-ONLY; Resource Id 2234 ID *string `json:"id,omitempty"` 2235 // Name - READ-ONLY; Resource name 2236 Name *string `json:"name,omitempty"` 2237 // Type - READ-ONLY; Resource type 2238 Type *string `json:"type,omitempty"` 2239 // Location - Resource location 2240 Location *string `json:"location,omitempty"` 2241 // Tags - Resource tags 2242 Tags map[string]*string `json:"tags"` 2243} 2244 2245// MarshalJSON is the custom marshaler for DiskEncryptionSet. 2246func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 2247 objectMap := make(map[string]interface{}) 2248 if desVar.Identity != nil { 2249 objectMap["identity"] = desVar.Identity 2250 } 2251 if desVar.EncryptionSetProperties != nil { 2252 objectMap["properties"] = desVar.EncryptionSetProperties 2253 } 2254 if desVar.Location != nil { 2255 objectMap["location"] = desVar.Location 2256 } 2257 if desVar.Tags != nil { 2258 objectMap["tags"] = desVar.Tags 2259 } 2260 return json.Marshal(objectMap) 2261} 2262 2263// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 2264func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 2265 var m map[string]*json.RawMessage 2266 err := json.Unmarshal(body, &m) 2267 if err != nil { 2268 return err 2269 } 2270 for k, v := range m { 2271 switch k { 2272 case "identity": 2273 if v != nil { 2274 var identity EncryptionSetIdentity 2275 err = json.Unmarshal(*v, &identity) 2276 if err != nil { 2277 return err 2278 } 2279 desVar.Identity = &identity 2280 } 2281 case "properties": 2282 if v != nil { 2283 var encryptionSetProperties EncryptionSetProperties 2284 err = json.Unmarshal(*v, &encryptionSetProperties) 2285 if err != nil { 2286 return err 2287 } 2288 desVar.EncryptionSetProperties = &encryptionSetProperties 2289 } 2290 case "id": 2291 if v != nil { 2292 var ID string 2293 err = json.Unmarshal(*v, &ID) 2294 if err != nil { 2295 return err 2296 } 2297 desVar.ID = &ID 2298 } 2299 case "name": 2300 if v != nil { 2301 var name string 2302 err = json.Unmarshal(*v, &name) 2303 if err != nil { 2304 return err 2305 } 2306 desVar.Name = &name 2307 } 2308 case "type": 2309 if v != nil { 2310 var typeVar string 2311 err = json.Unmarshal(*v, &typeVar) 2312 if err != nil { 2313 return err 2314 } 2315 desVar.Type = &typeVar 2316 } 2317 case "location": 2318 if v != nil { 2319 var location string 2320 err = json.Unmarshal(*v, &location) 2321 if err != nil { 2322 return err 2323 } 2324 desVar.Location = &location 2325 } 2326 case "tags": 2327 if v != nil { 2328 var tags map[string]*string 2329 err = json.Unmarshal(*v, &tags) 2330 if err != nil { 2331 return err 2332 } 2333 desVar.Tags = tags 2334 } 2335 } 2336 } 2337 2338 return nil 2339} 2340 2341// DiskEncryptionSetList the List disk encryption set operation response. 2342type DiskEncryptionSetList struct { 2343 autorest.Response `json:"-"` 2344 // Value - A list of disk encryption sets. 2345 Value *[]DiskEncryptionSet `json:"value,omitempty"` 2346 // 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. 2347 NextLink *string `json:"nextLink,omitempty"` 2348} 2349 2350// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 2351type DiskEncryptionSetListIterator struct { 2352 i int 2353 page DiskEncryptionSetListPage 2354} 2355 2356// NextWithContext advances to the next value. If there was an error making 2357// the request the iterator does not advance and the error is returned. 2358func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 2359 if tracing.IsEnabled() { 2360 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 2361 defer func() { 2362 sc := -1 2363 if iter.Response().Response.Response != nil { 2364 sc = iter.Response().Response.Response.StatusCode 2365 } 2366 tracing.EndSpan(ctx, sc, err) 2367 }() 2368 } 2369 iter.i++ 2370 if iter.i < len(iter.page.Values()) { 2371 return nil 2372 } 2373 err = iter.page.NextWithContext(ctx) 2374 if err != nil { 2375 iter.i-- 2376 return err 2377 } 2378 iter.i = 0 2379 return nil 2380} 2381 2382// Next advances to the next value. If there was an error making 2383// the request the iterator does not advance and the error is returned. 2384// Deprecated: Use NextWithContext() instead. 2385func (iter *DiskEncryptionSetListIterator) Next() error { 2386 return iter.NextWithContext(context.Background()) 2387} 2388 2389// NotDone returns true if the enumeration should be started or is not yet complete. 2390func (iter DiskEncryptionSetListIterator) NotDone() bool { 2391 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2392} 2393 2394// Response returns the raw server response from the last page request. 2395func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 2396 return iter.page.Response() 2397} 2398 2399// Value returns the current value or a zero-initialized value if the 2400// iterator has advanced beyond the end of the collection. 2401func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 2402 if !iter.page.NotDone() { 2403 return DiskEncryptionSet{} 2404 } 2405 return iter.page.Values()[iter.i] 2406} 2407 2408// Creates a new instance of the DiskEncryptionSetListIterator type. 2409func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 2410 return DiskEncryptionSetListIterator{page: page} 2411} 2412 2413// IsEmpty returns true if the ListResult contains no values. 2414func (desl DiskEncryptionSetList) IsEmpty() bool { 2415 return desl.Value == nil || len(*desl.Value) == 0 2416} 2417 2418// hasNextLink returns true if the NextLink is not empty. 2419func (desl DiskEncryptionSetList) hasNextLink() bool { 2420 return desl.NextLink != nil && len(*desl.NextLink) != 0 2421} 2422 2423// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 2424// It returns nil if no more results exist. 2425func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 2426 if !desl.hasNextLink() { 2427 return nil, nil 2428 } 2429 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2430 autorest.AsJSON(), 2431 autorest.AsGet(), 2432 autorest.WithBaseURL(to.String(desl.NextLink))) 2433} 2434 2435// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 2436type DiskEncryptionSetListPage struct { 2437 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 2438 desl DiskEncryptionSetList 2439} 2440 2441// NextWithContext 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. 2443func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 2444 if tracing.IsEnabled() { 2445 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 2446 defer func() { 2447 sc := -1 2448 if page.Response().Response.Response != nil { 2449 sc = page.Response().Response.Response.StatusCode 2450 } 2451 tracing.EndSpan(ctx, sc, err) 2452 }() 2453 } 2454 for { 2455 next, err := page.fn(ctx, page.desl) 2456 if err != nil { 2457 return err 2458 } 2459 page.desl = next 2460 if !next.hasNextLink() || !next.IsEmpty() { 2461 break 2462 } 2463 } 2464 return nil 2465} 2466 2467// Next advances to the next page of values. If there was an error making 2468// the request the page does not advance and the error is returned. 2469// Deprecated: Use NextWithContext() instead. 2470func (page *DiskEncryptionSetListPage) Next() error { 2471 return page.NextWithContext(context.Background()) 2472} 2473 2474// NotDone returns true if the page enumeration should be started or is not yet complete. 2475func (page DiskEncryptionSetListPage) NotDone() bool { 2476 return !page.desl.IsEmpty() 2477} 2478 2479// Response returns the raw server response from the last page request. 2480func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 2481 return page.desl 2482} 2483 2484// Values returns the slice of values for the current page or nil if there are no values. 2485func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 2486 if page.desl.IsEmpty() { 2487 return nil 2488 } 2489 return *page.desl.Value 2490} 2491 2492// Creates a new instance of the DiskEncryptionSetListPage type. 2493func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 2494 return DiskEncryptionSetListPage{ 2495 fn: getNextPage, 2496 desl: cur, 2497 } 2498} 2499 2500// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 2501// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 2502// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 2503type DiskEncryptionSetParameters struct { 2504 // ID - Resource Id 2505 ID *string `json:"id,omitempty"` 2506} 2507 2508// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2509// long-running operation. 2510type DiskEncryptionSetsCreateOrUpdateFuture struct { 2511 azure.FutureAPI 2512 // Result returns the result of the asynchronous operation. 2513 // If the operation has not completed it will return an error. 2514 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2515} 2516 2517// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2518func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2519 var azFuture azure.Future 2520 if err := json.Unmarshal(body, &azFuture); err != nil { 2521 return err 2522 } 2523 future.FutureAPI = &azFuture 2524 future.Result = future.result 2525 return nil 2526} 2527 2528// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. 2529func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 2530 var done bool 2531 done, err = future.DoneWithContext(context.Background(), client) 2532 if err != nil { 2533 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2534 return 2535 } 2536 if !done { 2537 desVar.Response.Response = future.Response() 2538 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") 2539 return 2540 } 2541 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2542 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 2543 desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) 2544 if err != nil { 2545 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 2546 } 2547 } 2548 return 2549} 2550 2551// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 2552// long-running operation. 2553type DiskEncryptionSetsDeleteFuture struct { 2554 azure.FutureAPI 2555 // Result returns the result of the asynchronous operation. 2556 // If the operation has not completed it will return an error. 2557 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 2558} 2559 2560// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2561func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { 2562 var azFuture azure.Future 2563 if err := json.Unmarshal(body, &azFuture); err != nil { 2564 return err 2565 } 2566 future.FutureAPI = &azFuture 2567 future.Result = future.result 2568 return nil 2569} 2570 2571// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. 2572func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { 2573 var done bool 2574 done, err = future.DoneWithContext(context.Background(), client) 2575 if err != nil { 2576 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") 2577 return 2578 } 2579 if !done { 2580 ar.Response = future.Response() 2581 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") 2582 return 2583 } 2584 ar.Response = future.Response() 2585 return 2586} 2587 2588// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 2589// long-running operation. 2590type DiskEncryptionSetsUpdateFuture struct { 2591 azure.FutureAPI 2592 // Result returns the result of the asynchronous operation. 2593 // If the operation has not completed it will return an error. 2594 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2595} 2596 2597// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2598func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { 2599 var azFuture azure.Future 2600 if err := json.Unmarshal(body, &azFuture); err != nil { 2601 return err 2602 } 2603 future.FutureAPI = &azFuture 2604 future.Result = future.result 2605 return nil 2606} 2607 2608// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. 2609func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 2610 var done bool 2611 done, err = future.DoneWithContext(context.Background(), client) 2612 if err != nil { 2613 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") 2614 return 2615 } 2616 if !done { 2617 desVar.Response.Response = future.Response() 2618 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") 2619 return 2620 } 2621 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2622 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 2623 desVar, err = client.UpdateResponder(desVar.Response.Response) 2624 if err != nil { 2625 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 2626 } 2627 } 2628 return 2629} 2630 2631// DiskEncryptionSettings describes a Encryption Settings for a Disk 2632type DiskEncryptionSettings struct { 2633 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 2634 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 2635 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 2636 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 2637 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 2638 Enabled *bool `json:"enabled,omitempty"` 2639} 2640 2641// DiskEncryptionSetUpdate disk encryption set update resource. 2642type DiskEncryptionSetUpdate struct { 2643 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 2644 // Tags - Resource tags 2645 Tags map[string]*string `json:"tags"` 2646} 2647 2648// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 2649func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 2650 objectMap := make(map[string]interface{}) 2651 if desu.DiskEncryptionSetUpdateProperties != nil { 2652 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 2653 } 2654 if desu.Tags != nil { 2655 objectMap["tags"] = desu.Tags 2656 } 2657 return json.Marshal(objectMap) 2658} 2659 2660// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 2661func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 2662 var m map[string]*json.RawMessage 2663 err := json.Unmarshal(body, &m) 2664 if err != nil { 2665 return err 2666 } 2667 for k, v := range m { 2668 switch k { 2669 case "properties": 2670 if v != nil { 2671 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 2672 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 2673 if err != nil { 2674 return err 2675 } 2676 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 2677 } 2678 case "tags": 2679 if v != nil { 2680 var tags map[string]*string 2681 err = json.Unmarshal(*v, &tags) 2682 if err != nil { 2683 return err 2684 } 2685 desu.Tags = tags 2686 } 2687 } 2688 } 2689 2690 return nil 2691} 2692 2693// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 2694type DiskEncryptionSetUpdateProperties struct { 2695 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2696} 2697 2698// DiskImageEncryption this is the disk image encryption base class. 2699type DiskImageEncryption struct { 2700 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 2701 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2702} 2703 2704// DiskInstanceView the instance view of the disk. 2705type DiskInstanceView struct { 2706 // Name - The disk name. 2707 Name *string `json:"name,omitempty"` 2708 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 2709 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 2710 // Statuses - The resource status information. 2711 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2712} 2713 2714// DiskList the List Disks operation response. 2715type DiskList struct { 2716 autorest.Response `json:"-"` 2717 // Value - A list of disks. 2718 Value *[]Disk `json:"value,omitempty"` 2719 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 2720 NextLink *string `json:"nextLink,omitempty"` 2721} 2722 2723// DiskListIterator provides access to a complete listing of Disk values. 2724type DiskListIterator struct { 2725 i int 2726 page DiskListPage 2727} 2728 2729// NextWithContext advances to the next value. If there was an error making 2730// the request the iterator does not advance and the error is returned. 2731func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 2732 if tracing.IsEnabled() { 2733 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 2734 defer func() { 2735 sc := -1 2736 if iter.Response().Response.Response != nil { 2737 sc = iter.Response().Response.Response.StatusCode 2738 } 2739 tracing.EndSpan(ctx, sc, err) 2740 }() 2741 } 2742 iter.i++ 2743 if iter.i < len(iter.page.Values()) { 2744 return nil 2745 } 2746 err = iter.page.NextWithContext(ctx) 2747 if err != nil { 2748 iter.i-- 2749 return err 2750 } 2751 iter.i = 0 2752 return nil 2753} 2754 2755// Next advances to the next value. If there was an error making 2756// the request the iterator does not advance and the error is returned. 2757// Deprecated: Use NextWithContext() instead. 2758func (iter *DiskListIterator) Next() error { 2759 return iter.NextWithContext(context.Background()) 2760} 2761 2762// NotDone returns true if the enumeration should be started or is not yet complete. 2763func (iter DiskListIterator) NotDone() bool { 2764 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2765} 2766 2767// Response returns the raw server response from the last page request. 2768func (iter DiskListIterator) Response() DiskList { 2769 return iter.page.Response() 2770} 2771 2772// Value returns the current value or a zero-initialized value if the 2773// iterator has advanced beyond the end of the collection. 2774func (iter DiskListIterator) Value() Disk { 2775 if !iter.page.NotDone() { 2776 return Disk{} 2777 } 2778 return iter.page.Values()[iter.i] 2779} 2780 2781// Creates a new instance of the DiskListIterator type. 2782func NewDiskListIterator(page DiskListPage) DiskListIterator { 2783 return DiskListIterator{page: page} 2784} 2785 2786// IsEmpty returns true if the ListResult contains no values. 2787func (dl DiskList) IsEmpty() bool { 2788 return dl.Value == nil || len(*dl.Value) == 0 2789} 2790 2791// hasNextLink returns true if the NextLink is not empty. 2792func (dl DiskList) hasNextLink() bool { 2793 return dl.NextLink != nil && len(*dl.NextLink) != 0 2794} 2795 2796// diskListPreparer prepares a request to retrieve the next set of results. 2797// It returns nil if no more results exist. 2798func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 2799 if !dl.hasNextLink() { 2800 return nil, nil 2801 } 2802 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2803 autorest.AsJSON(), 2804 autorest.AsGet(), 2805 autorest.WithBaseURL(to.String(dl.NextLink))) 2806} 2807 2808// DiskListPage contains a page of Disk values. 2809type DiskListPage struct { 2810 fn func(context.Context, DiskList) (DiskList, error) 2811 dl DiskList 2812} 2813 2814// NextWithContext advances to the next page of values. If there was an error making 2815// the request the page does not advance and the error is returned. 2816func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 2817 if tracing.IsEnabled() { 2818 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 2819 defer func() { 2820 sc := -1 2821 if page.Response().Response.Response != nil { 2822 sc = page.Response().Response.Response.StatusCode 2823 } 2824 tracing.EndSpan(ctx, sc, err) 2825 }() 2826 } 2827 for { 2828 next, err := page.fn(ctx, page.dl) 2829 if err != nil { 2830 return err 2831 } 2832 page.dl = next 2833 if !next.hasNextLink() || !next.IsEmpty() { 2834 break 2835 } 2836 } 2837 return nil 2838} 2839 2840// Next advances to the next page of values. If there was an error making 2841// the request the page does not advance and the error is returned. 2842// Deprecated: Use NextWithContext() instead. 2843func (page *DiskListPage) Next() error { 2844 return page.NextWithContext(context.Background()) 2845} 2846 2847// NotDone returns true if the page enumeration should be started or is not yet complete. 2848func (page DiskListPage) NotDone() bool { 2849 return !page.dl.IsEmpty() 2850} 2851 2852// Response returns the raw server response from the last page request. 2853func (page DiskListPage) Response() DiskList { 2854 return page.dl 2855} 2856 2857// Values returns the slice of values for the current page or nil if there are no values. 2858func (page DiskListPage) Values() []Disk { 2859 if page.dl.IsEmpty() { 2860 return nil 2861 } 2862 return *page.dl.Value 2863} 2864 2865// Creates a new instance of the DiskListPage type. 2866func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 2867 return DiskListPage{ 2868 fn: getNextPage, 2869 dl: cur, 2870 } 2871} 2872 2873// DiskProperties disk resource properties. 2874type DiskProperties struct { 2875 // TimeCreated - READ-ONLY; The time when the disk was created. 2876 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2877 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 2878 OsType OperatingSystemTypes `json:"osType,omitempty"` 2879 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 2880 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 2881 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 2882 CreationData *CreationData `json:"creationData,omitempty"` 2883 // 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. 2884 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2885 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 2886 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 2887 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 2888 UniqueID *string `json:"uniqueId,omitempty"` 2889 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2890 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2891 // ProvisioningState - READ-ONLY; The disk provisioning state. 2892 ProvisioningState *string `json:"provisioningState,omitempty"` 2893 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2894 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2895 // 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. 2896 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 2897 // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. 2898 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 2899 // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 2900 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 2901 // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 2902 DiskState DiskState `json:"diskState,omitempty"` 2903 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2904 Encryption *Encryption `json:"encryption,omitempty"` 2905 // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. 2906 MaxShares *int32 `json:"maxShares,omitempty"` 2907 // ShareInfo - READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. 2908 ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` 2909} 2910 2911// MarshalJSON is the custom marshaler for DiskProperties. 2912func (dp DiskProperties) MarshalJSON() ([]byte, error) { 2913 objectMap := make(map[string]interface{}) 2914 if dp.OsType != "" { 2915 objectMap["osType"] = dp.OsType 2916 } 2917 if dp.HyperVGeneration != "" { 2918 objectMap["hyperVGeneration"] = dp.HyperVGeneration 2919 } 2920 if dp.CreationData != nil { 2921 objectMap["creationData"] = dp.CreationData 2922 } 2923 if dp.DiskSizeGB != nil { 2924 objectMap["diskSizeGB"] = dp.DiskSizeGB 2925 } 2926 if dp.EncryptionSettingsCollection != nil { 2927 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 2928 } 2929 if dp.DiskIOPSReadWrite != nil { 2930 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 2931 } 2932 if dp.DiskMBpsReadWrite != nil { 2933 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 2934 } 2935 if dp.DiskIOPSReadOnly != nil { 2936 objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly 2937 } 2938 if dp.DiskMBpsReadOnly != nil { 2939 objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly 2940 } 2941 if dp.Encryption != nil { 2942 objectMap["encryption"] = dp.Encryption 2943 } 2944 if dp.MaxShares != nil { 2945 objectMap["maxShares"] = dp.MaxShares 2946 } 2947 return json.Marshal(objectMap) 2948} 2949 2950// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2951// operation. 2952type DisksCreateOrUpdateFuture struct { 2953 azure.FutureAPI 2954 // Result returns the result of the asynchronous operation. 2955 // If the operation has not completed it will return an error. 2956 Result func(DisksClient) (Disk, error) 2957} 2958 2959// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2960func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2961 var azFuture azure.Future 2962 if err := json.Unmarshal(body, &azFuture); err != nil { 2963 return err 2964 } 2965 future.FutureAPI = &azFuture 2966 future.Result = future.result 2967 return nil 2968} 2969 2970// result is the default implementation for DisksCreateOrUpdateFuture.Result. 2971func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 2972 var done bool 2973 done, err = future.DoneWithContext(context.Background(), client) 2974 if err != nil { 2975 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2976 return 2977 } 2978 if !done { 2979 d.Response.Response = future.Response() 2980 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 2981 return 2982 } 2983 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2984 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 2985 d, err = client.CreateOrUpdateResponder(d.Response.Response) 2986 if err != nil { 2987 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 2988 } 2989 } 2990 return 2991} 2992 2993// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2994type DisksDeleteFuture struct { 2995 azure.FutureAPI 2996 // Result returns the result of the asynchronous operation. 2997 // If the operation has not completed it will return an error. 2998 Result func(DisksClient) (autorest.Response, error) 2999} 3000 3001// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3002func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 3003 var azFuture azure.Future 3004 if err := json.Unmarshal(body, &azFuture); err != nil { 3005 return err 3006 } 3007 future.FutureAPI = &azFuture 3008 future.Result = future.result 3009 return nil 3010} 3011 3012// result is the default implementation for DisksDeleteFuture.Result. 3013func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 3014 var done bool 3015 done, err = future.DoneWithContext(context.Background(), client) 3016 if err != nil { 3017 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 3018 return 3019 } 3020 if !done { 3021 ar.Response = future.Response() 3022 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 3023 return 3024 } 3025 ar.Response = future.Response() 3026 return 3027} 3028 3029// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 3030// operation. 3031type DisksGrantAccessFuture struct { 3032 azure.FutureAPI 3033 // Result returns the result of the asynchronous operation. 3034 // If the operation has not completed it will return an error. 3035 Result func(DisksClient) (AccessURI, error) 3036} 3037 3038// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3039func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 3040 var azFuture azure.Future 3041 if err := json.Unmarshal(body, &azFuture); err != nil { 3042 return err 3043 } 3044 future.FutureAPI = &azFuture 3045 future.Result = future.result 3046 return nil 3047} 3048 3049// result is the default implementation for DisksGrantAccessFuture.Result. 3050func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 3051 var done bool 3052 done, err = future.DoneWithContext(context.Background(), client) 3053 if err != nil { 3054 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 3055 return 3056 } 3057 if !done { 3058 au.Response.Response = future.Response() 3059 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 3060 return 3061 } 3062 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3063 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 3064 au, err = client.GrantAccessResponder(au.Response.Response) 3065 if err != nil { 3066 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 3067 } 3068 } 3069 return 3070} 3071 3072// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 3073type DiskSku struct { 3074 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 3075 Name DiskStorageAccountTypes `json:"name,omitempty"` 3076 // Tier - READ-ONLY; The sku tier. 3077 Tier *string `json:"tier,omitempty"` 3078} 3079 3080// MarshalJSON is the custom marshaler for DiskSku. 3081func (ds DiskSku) MarshalJSON() ([]byte, error) { 3082 objectMap := make(map[string]interface{}) 3083 if ds.Name != "" { 3084 objectMap["name"] = ds.Name 3085 } 3086 return json.Marshal(objectMap) 3087} 3088 3089// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 3090// operation. 3091type DisksRevokeAccessFuture struct { 3092 azure.FutureAPI 3093 // Result returns the result of the asynchronous operation. 3094 // If the operation has not completed it will return an error. 3095 Result func(DisksClient) (autorest.Response, error) 3096} 3097 3098// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3099func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 3100 var azFuture azure.Future 3101 if err := json.Unmarshal(body, &azFuture); err != nil { 3102 return err 3103 } 3104 future.FutureAPI = &azFuture 3105 future.Result = future.result 3106 return nil 3107} 3108 3109// result is the default implementation for DisksRevokeAccessFuture.Result. 3110func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 3111 var done bool 3112 done, err = future.DoneWithContext(context.Background(), client) 3113 if err != nil { 3114 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 3115 return 3116 } 3117 if !done { 3118 ar.Response = future.Response() 3119 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 3120 return 3121 } 3122 ar.Response = future.Response() 3123 return 3124} 3125 3126// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3127type DisksUpdateFuture struct { 3128 azure.FutureAPI 3129 // Result returns the result of the asynchronous operation. 3130 // If the operation has not completed it will return an error. 3131 Result func(DisksClient) (Disk, error) 3132} 3133 3134// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3135func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 3136 var azFuture azure.Future 3137 if err := json.Unmarshal(body, &azFuture); err != nil { 3138 return err 3139 } 3140 future.FutureAPI = &azFuture 3141 future.Result = future.result 3142 return nil 3143} 3144 3145// result is the default implementation for DisksUpdateFuture.Result. 3146func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 3147 var done bool 3148 done, err = future.DoneWithContext(context.Background(), client) 3149 if err != nil { 3150 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 3151 return 3152 } 3153 if !done { 3154 d.Response.Response = future.Response() 3155 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 3156 return 3157 } 3158 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3159 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 3160 d, err = client.UpdateResponder(d.Response.Response) 3161 if err != nil { 3162 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 3163 } 3164 } 3165 return 3166} 3167 3168// DiskUpdate disk update resource. 3169type DiskUpdate struct { 3170 *DiskUpdateProperties `json:"properties,omitempty"` 3171 // Tags - Resource tags 3172 Tags map[string]*string `json:"tags"` 3173 Sku *DiskSku `json:"sku,omitempty"` 3174} 3175 3176// MarshalJSON is the custom marshaler for DiskUpdate. 3177func (du DiskUpdate) MarshalJSON() ([]byte, error) { 3178 objectMap := make(map[string]interface{}) 3179 if du.DiskUpdateProperties != nil { 3180 objectMap["properties"] = du.DiskUpdateProperties 3181 } 3182 if du.Tags != nil { 3183 objectMap["tags"] = du.Tags 3184 } 3185 if du.Sku != nil { 3186 objectMap["sku"] = du.Sku 3187 } 3188 return json.Marshal(objectMap) 3189} 3190 3191// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 3192func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 3193 var m map[string]*json.RawMessage 3194 err := json.Unmarshal(body, &m) 3195 if err != nil { 3196 return err 3197 } 3198 for k, v := range m { 3199 switch k { 3200 case "properties": 3201 if v != nil { 3202 var diskUpdateProperties DiskUpdateProperties 3203 err = json.Unmarshal(*v, &diskUpdateProperties) 3204 if err != nil { 3205 return err 3206 } 3207 du.DiskUpdateProperties = &diskUpdateProperties 3208 } 3209 case "tags": 3210 if v != nil { 3211 var tags map[string]*string 3212 err = json.Unmarshal(*v, &tags) 3213 if err != nil { 3214 return err 3215 } 3216 du.Tags = tags 3217 } 3218 case "sku": 3219 if v != nil { 3220 var sku DiskSku 3221 err = json.Unmarshal(*v, &sku) 3222 if err != nil { 3223 return err 3224 } 3225 du.Sku = &sku 3226 } 3227 } 3228 } 3229 3230 return nil 3231} 3232 3233// DiskUpdateProperties disk resource update properties. 3234type DiskUpdateProperties struct { 3235 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 3236 OsType OperatingSystemTypes `json:"osType,omitempty"` 3237 // 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. 3238 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3239 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 3240 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 3241 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 3242 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 3243 // 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. 3244 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 3245 // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. 3246 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 3247 // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 3248 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 3249 // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. 3250 MaxShares *int32 `json:"maxShares,omitempty"` 3251 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 3252 Encryption *Encryption `json:"encryption,omitempty"` 3253} 3254 3255// Encryption encryption at rest settings for disk or snapshot 3256type Encryption struct { 3257 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 3258 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 3259 // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' 3260 Type EncryptionType `json:"type,omitempty"` 3261} 3262 3263// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data 3264// disks in the gallery artifact. 3265type EncryptionImages struct { 3266 OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` 3267 // DataDiskImages - A list of encryption specifications for data disk images. 3268 DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` 3269} 3270 3271// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 3272// the key vault before it can be used to encrypt disks. 3273type EncryptionSetIdentity struct { 3274 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' 3275 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 3276 // 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 3277 PrincipalID *string `json:"principalId,omitempty"` 3278 // 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 3279 TenantID *string `json:"tenantId,omitempty"` 3280} 3281 3282// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 3283func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 3284 objectMap := make(map[string]interface{}) 3285 if esi.Type != "" { 3286 objectMap["type"] = esi.Type 3287 } 3288 return json.Marshal(objectMap) 3289} 3290 3291// EncryptionSetProperties ... 3292type EncryptionSetProperties struct { 3293 // ActiveKey - The key vault key which is currently used by this disk encryption set. 3294 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 3295 // 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. 3296 PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` 3297 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 3298 ProvisioningState *string `json:"provisioningState,omitempty"` 3299} 3300 3301// MarshalJSON is the custom marshaler for EncryptionSetProperties. 3302func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 3303 objectMap := make(map[string]interface{}) 3304 if esp.ActiveKey != nil { 3305 objectMap["activeKey"] = esp.ActiveKey 3306 } 3307 return json.Marshal(objectMap) 3308} 3309 3310// EncryptionSettingsCollection encryption settings for disk or snapshot 3311type EncryptionSettingsCollection struct { 3312 // 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. 3313 Enabled *bool `json:"enabled,omitempty"` 3314 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 3315 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 3316 // 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. 3317 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 3318} 3319 3320// EncryptionSettingsElement encryption settings for one disk volume. 3321type EncryptionSettingsElement struct { 3322 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 3323 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 3324 // 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. 3325 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 3326} 3327 3328// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3329// operation. 3330type GalleriesCreateOrUpdateFuture struct { 3331 azure.FutureAPI 3332 // Result returns the result of the asynchronous operation. 3333 // If the operation has not completed it will return an error. 3334 Result func(GalleriesClient) (Gallery, error) 3335} 3336 3337// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3338func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3339 var azFuture azure.Future 3340 if err := json.Unmarshal(body, &azFuture); err != nil { 3341 return err 3342 } 3343 future.FutureAPI = &azFuture 3344 future.Result = future.result 3345 return nil 3346} 3347 3348// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. 3349func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 3350 var done bool 3351 done, err = future.DoneWithContext(context.Background(), client) 3352 if err != nil { 3353 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3354 return 3355 } 3356 if !done { 3357 g.Response.Response = future.Response() 3358 err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") 3359 return 3360 } 3361 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3362 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 3363 g, err = client.CreateOrUpdateResponder(g.Response.Response) 3364 if err != nil { 3365 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 3366 } 3367 } 3368 return 3369} 3370 3371// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3372// operation. 3373type GalleriesDeleteFuture struct { 3374 azure.FutureAPI 3375 // Result returns the result of the asynchronous operation. 3376 // If the operation has not completed it will return an error. 3377 Result func(GalleriesClient) (autorest.Response, error) 3378} 3379 3380// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3381func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { 3382 var azFuture azure.Future 3383 if err := json.Unmarshal(body, &azFuture); err != nil { 3384 return err 3385 } 3386 future.FutureAPI = &azFuture 3387 future.Result = future.result 3388 return nil 3389} 3390 3391// result is the default implementation for GalleriesDeleteFuture.Result. 3392func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { 3393 var done bool 3394 done, err = future.DoneWithContext(context.Background(), client) 3395 if err != nil { 3396 err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") 3397 return 3398 } 3399 if !done { 3400 ar.Response = future.Response() 3401 err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") 3402 return 3403 } 3404 ar.Response = future.Response() 3405 return 3406} 3407 3408// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3409// operation. 3410type GalleriesUpdateFuture struct { 3411 azure.FutureAPI 3412 // Result returns the result of the asynchronous operation. 3413 // If the operation has not completed it will return an error. 3414 Result func(GalleriesClient) (Gallery, error) 3415} 3416 3417// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3418func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { 3419 var azFuture azure.Future 3420 if err := json.Unmarshal(body, &azFuture); err != nil { 3421 return err 3422 } 3423 future.FutureAPI = &azFuture 3424 future.Result = future.result 3425 return nil 3426} 3427 3428// result is the default implementation for GalleriesUpdateFuture.Result. 3429func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 3430 var done bool 3431 done, err = future.DoneWithContext(context.Background(), client) 3432 if err != nil { 3433 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") 3434 return 3435 } 3436 if !done { 3437 g.Response.Response = future.Response() 3438 err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") 3439 return 3440 } 3441 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3442 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 3443 g, err = client.UpdateResponder(g.Response.Response) 3444 if err != nil { 3445 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 3446 } 3447 } 3448 return 3449} 3450 3451// Gallery specifies information about the Shared Image Gallery that you want to create or update. 3452type Gallery struct { 3453 autorest.Response `json:"-"` 3454 *GalleryProperties `json:"properties,omitempty"` 3455 // ID - READ-ONLY; Resource Id 3456 ID *string `json:"id,omitempty"` 3457 // Name - READ-ONLY; Resource name 3458 Name *string `json:"name,omitempty"` 3459 // Type - READ-ONLY; Resource type 3460 Type *string `json:"type,omitempty"` 3461 // Location - Resource location 3462 Location *string `json:"location,omitempty"` 3463 // Tags - Resource tags 3464 Tags map[string]*string `json:"tags"` 3465} 3466 3467// MarshalJSON is the custom marshaler for Gallery. 3468func (g Gallery) MarshalJSON() ([]byte, error) { 3469 objectMap := make(map[string]interface{}) 3470 if g.GalleryProperties != nil { 3471 objectMap["properties"] = g.GalleryProperties 3472 } 3473 if g.Location != nil { 3474 objectMap["location"] = g.Location 3475 } 3476 if g.Tags != nil { 3477 objectMap["tags"] = g.Tags 3478 } 3479 return json.Marshal(objectMap) 3480} 3481 3482// UnmarshalJSON is the custom unmarshaler for Gallery struct. 3483func (g *Gallery) UnmarshalJSON(body []byte) error { 3484 var m map[string]*json.RawMessage 3485 err := json.Unmarshal(body, &m) 3486 if err != nil { 3487 return err 3488 } 3489 for k, v := range m { 3490 switch k { 3491 case "properties": 3492 if v != nil { 3493 var galleryProperties GalleryProperties 3494 err = json.Unmarshal(*v, &galleryProperties) 3495 if err != nil { 3496 return err 3497 } 3498 g.GalleryProperties = &galleryProperties 3499 } 3500 case "id": 3501 if v != nil { 3502 var ID string 3503 err = json.Unmarshal(*v, &ID) 3504 if err != nil { 3505 return err 3506 } 3507 g.ID = &ID 3508 } 3509 case "name": 3510 if v != nil { 3511 var name string 3512 err = json.Unmarshal(*v, &name) 3513 if err != nil { 3514 return err 3515 } 3516 g.Name = &name 3517 } 3518 case "type": 3519 if v != nil { 3520 var typeVar string 3521 err = json.Unmarshal(*v, &typeVar) 3522 if err != nil { 3523 return err 3524 } 3525 g.Type = &typeVar 3526 } 3527 case "location": 3528 if v != nil { 3529 var location string 3530 err = json.Unmarshal(*v, &location) 3531 if err != nil { 3532 return err 3533 } 3534 g.Location = &location 3535 } 3536 case "tags": 3537 if v != nil { 3538 var tags map[string]*string 3539 err = json.Unmarshal(*v, &tags) 3540 if err != nil { 3541 return err 3542 } 3543 g.Tags = tags 3544 } 3545 } 3546 } 3547 3548 return nil 3549} 3550 3551// GalleryApplication specifies information about the gallery Application Definition that you want to 3552// create or update. 3553type GalleryApplication struct { 3554 autorest.Response `json:"-"` 3555 *GalleryApplicationProperties `json:"properties,omitempty"` 3556 // ID - READ-ONLY; Resource Id 3557 ID *string `json:"id,omitempty"` 3558 // Name - READ-ONLY; Resource name 3559 Name *string `json:"name,omitempty"` 3560 // Type - READ-ONLY; Resource type 3561 Type *string `json:"type,omitempty"` 3562 // Location - Resource location 3563 Location *string `json:"location,omitempty"` 3564 // Tags - Resource tags 3565 Tags map[string]*string `json:"tags"` 3566} 3567 3568// MarshalJSON is the custom marshaler for GalleryApplication. 3569func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 3570 objectMap := make(map[string]interface{}) 3571 if ga.GalleryApplicationProperties != nil { 3572 objectMap["properties"] = ga.GalleryApplicationProperties 3573 } 3574 if ga.Location != nil { 3575 objectMap["location"] = ga.Location 3576 } 3577 if ga.Tags != nil { 3578 objectMap["tags"] = ga.Tags 3579 } 3580 return json.Marshal(objectMap) 3581} 3582 3583// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 3584func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 3585 var m map[string]*json.RawMessage 3586 err := json.Unmarshal(body, &m) 3587 if err != nil { 3588 return err 3589 } 3590 for k, v := range m { 3591 switch k { 3592 case "properties": 3593 if v != nil { 3594 var galleryApplicationProperties GalleryApplicationProperties 3595 err = json.Unmarshal(*v, &galleryApplicationProperties) 3596 if err != nil { 3597 return err 3598 } 3599 ga.GalleryApplicationProperties = &galleryApplicationProperties 3600 } 3601 case "id": 3602 if v != nil { 3603 var ID string 3604 err = json.Unmarshal(*v, &ID) 3605 if err != nil { 3606 return err 3607 } 3608 ga.ID = &ID 3609 } 3610 case "name": 3611 if v != nil { 3612 var name string 3613 err = json.Unmarshal(*v, &name) 3614 if err != nil { 3615 return err 3616 } 3617 ga.Name = &name 3618 } 3619 case "type": 3620 if v != nil { 3621 var typeVar string 3622 err = json.Unmarshal(*v, &typeVar) 3623 if err != nil { 3624 return err 3625 } 3626 ga.Type = &typeVar 3627 } 3628 case "location": 3629 if v != nil { 3630 var location string 3631 err = json.Unmarshal(*v, &location) 3632 if err != nil { 3633 return err 3634 } 3635 ga.Location = &location 3636 } 3637 case "tags": 3638 if v != nil { 3639 var tags map[string]*string 3640 err = json.Unmarshal(*v, &tags) 3641 if err != nil { 3642 return err 3643 } 3644 ga.Tags = tags 3645 } 3646 } 3647 } 3648 3649 return nil 3650} 3651 3652// GalleryApplicationList the List Gallery Applications operation response. 3653type GalleryApplicationList struct { 3654 autorest.Response `json:"-"` 3655 // Value - A list of Gallery Applications. 3656 Value *[]GalleryApplication `json:"value,omitempty"` 3657 // 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. 3658 NextLink *string `json:"nextLink,omitempty"` 3659} 3660 3661// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 3662type GalleryApplicationListIterator struct { 3663 i int 3664 page GalleryApplicationListPage 3665} 3666 3667// NextWithContext advances to the next value. If there was an error making 3668// the request the iterator does not advance and the error is returned. 3669func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 3670 if tracing.IsEnabled() { 3671 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 3672 defer func() { 3673 sc := -1 3674 if iter.Response().Response.Response != nil { 3675 sc = iter.Response().Response.Response.StatusCode 3676 } 3677 tracing.EndSpan(ctx, sc, err) 3678 }() 3679 } 3680 iter.i++ 3681 if iter.i < len(iter.page.Values()) { 3682 return nil 3683 } 3684 err = iter.page.NextWithContext(ctx) 3685 if err != nil { 3686 iter.i-- 3687 return err 3688 } 3689 iter.i = 0 3690 return nil 3691} 3692 3693// Next advances to the next value. If there was an error making 3694// the request the iterator does not advance and the error is returned. 3695// Deprecated: Use NextWithContext() instead. 3696func (iter *GalleryApplicationListIterator) Next() error { 3697 return iter.NextWithContext(context.Background()) 3698} 3699 3700// NotDone returns true if the enumeration should be started or is not yet complete. 3701func (iter GalleryApplicationListIterator) NotDone() bool { 3702 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3703} 3704 3705// Response returns the raw server response from the last page request. 3706func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 3707 return iter.page.Response() 3708} 3709 3710// Value returns the current value or a zero-initialized value if the 3711// iterator has advanced beyond the end of the collection. 3712func (iter GalleryApplicationListIterator) Value() GalleryApplication { 3713 if !iter.page.NotDone() { 3714 return GalleryApplication{} 3715 } 3716 return iter.page.Values()[iter.i] 3717} 3718 3719// Creates a new instance of the GalleryApplicationListIterator type. 3720func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 3721 return GalleryApplicationListIterator{page: page} 3722} 3723 3724// IsEmpty returns true if the ListResult contains no values. 3725func (gal GalleryApplicationList) IsEmpty() bool { 3726 return gal.Value == nil || len(*gal.Value) == 0 3727} 3728 3729// hasNextLink returns true if the NextLink is not empty. 3730func (gal GalleryApplicationList) hasNextLink() bool { 3731 return gal.NextLink != nil && len(*gal.NextLink) != 0 3732} 3733 3734// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 3735// It returns nil if no more results exist. 3736func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 3737 if !gal.hasNextLink() { 3738 return nil, nil 3739 } 3740 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3741 autorest.AsJSON(), 3742 autorest.AsGet(), 3743 autorest.WithBaseURL(to.String(gal.NextLink))) 3744} 3745 3746// GalleryApplicationListPage contains a page of GalleryApplication values. 3747type GalleryApplicationListPage struct { 3748 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 3749 gal GalleryApplicationList 3750} 3751 3752// NextWithContext advances to the next page of values. If there was an error making 3753// the request the page does not advance and the error is returned. 3754func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 3755 if tracing.IsEnabled() { 3756 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 3757 defer func() { 3758 sc := -1 3759 if page.Response().Response.Response != nil { 3760 sc = page.Response().Response.Response.StatusCode 3761 } 3762 tracing.EndSpan(ctx, sc, err) 3763 }() 3764 } 3765 for { 3766 next, err := page.fn(ctx, page.gal) 3767 if err != nil { 3768 return err 3769 } 3770 page.gal = next 3771 if !next.hasNextLink() || !next.IsEmpty() { 3772 break 3773 } 3774 } 3775 return nil 3776} 3777 3778// Next advances to the next page of values. If there was an error making 3779// the request the page does not advance and the error is returned. 3780// Deprecated: Use NextWithContext() instead. 3781func (page *GalleryApplicationListPage) Next() error { 3782 return page.NextWithContext(context.Background()) 3783} 3784 3785// NotDone returns true if the page enumeration should be started or is not yet complete. 3786func (page GalleryApplicationListPage) NotDone() bool { 3787 return !page.gal.IsEmpty() 3788} 3789 3790// Response returns the raw server response from the last page request. 3791func (page GalleryApplicationListPage) Response() GalleryApplicationList { 3792 return page.gal 3793} 3794 3795// Values returns the slice of values for the current page or nil if there are no values. 3796func (page GalleryApplicationListPage) Values() []GalleryApplication { 3797 if page.gal.IsEmpty() { 3798 return nil 3799 } 3800 return *page.gal.Value 3801} 3802 3803// Creates a new instance of the GalleryApplicationListPage type. 3804func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 3805 return GalleryApplicationListPage{ 3806 fn: getNextPage, 3807 gal: cur, 3808 } 3809} 3810 3811// GalleryApplicationProperties describes the properties of a gallery Application Definition. 3812type GalleryApplicationProperties struct { 3813 // Description - The description of this gallery Application Definition resource. This property is updatable. 3814 Description *string `json:"description,omitempty"` 3815 // Eula - The Eula agreement for the gallery Application Definition. 3816 Eula *string `json:"eula,omitempty"` 3817 // PrivacyStatementURI - The privacy statement uri. 3818 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 3819 // ReleaseNoteURI - The release note uri. 3820 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 3821 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 3822 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3823 // 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' 3824 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 3825} 3826 3827// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3828// long-running operation. 3829type GalleryApplicationsCreateOrUpdateFuture struct { 3830 azure.FutureAPI 3831 // Result returns the result of the asynchronous operation. 3832 // If the operation has not completed it will return an error. 3833 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3834} 3835 3836// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3837func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3838 var azFuture azure.Future 3839 if err := json.Unmarshal(body, &azFuture); err != nil { 3840 return err 3841 } 3842 future.FutureAPI = &azFuture 3843 future.Result = future.result 3844 return nil 3845} 3846 3847// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. 3848func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 3849 var done bool 3850 done, err = future.DoneWithContext(context.Background(), client) 3851 if err != nil { 3852 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3853 return 3854 } 3855 if !done { 3856 ga.Response.Response = future.Response() 3857 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") 3858 return 3859 } 3860 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3861 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 3862 ga, err = client.CreateOrUpdateResponder(ga.Response.Response) 3863 if err != nil { 3864 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 3865 } 3866 } 3867 return 3868} 3869 3870// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 3871// long-running operation. 3872type GalleryApplicationsDeleteFuture struct { 3873 azure.FutureAPI 3874 // Result returns the result of the asynchronous operation. 3875 // If the operation has not completed it will return an error. 3876 Result func(GalleryApplicationsClient) (autorest.Response, error) 3877} 3878 3879// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3880func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { 3881 var azFuture azure.Future 3882 if err := json.Unmarshal(body, &azFuture); err != nil { 3883 return err 3884 } 3885 future.FutureAPI = &azFuture 3886 future.Result = future.result 3887 return nil 3888} 3889 3890// result is the default implementation for GalleryApplicationsDeleteFuture.Result. 3891func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { 3892 var done bool 3893 done, err = future.DoneWithContext(context.Background(), client) 3894 if err != nil { 3895 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") 3896 return 3897 } 3898 if !done { 3899 ar.Response = future.Response() 3900 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") 3901 return 3902 } 3903 ar.Response = future.Response() 3904 return 3905} 3906 3907// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 3908// long-running operation. 3909type GalleryApplicationsUpdateFuture struct { 3910 azure.FutureAPI 3911 // Result returns the result of the asynchronous operation. 3912 // If the operation has not completed it will return an error. 3913 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3914} 3915 3916// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3917func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { 3918 var azFuture azure.Future 3919 if err := json.Unmarshal(body, &azFuture); err != nil { 3920 return err 3921 } 3922 future.FutureAPI = &azFuture 3923 future.Result = future.result 3924 return nil 3925} 3926 3927// result is the default implementation for GalleryApplicationsUpdateFuture.Result. 3928func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 3929 var done bool 3930 done, err = future.DoneWithContext(context.Background(), client) 3931 if err != nil { 3932 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") 3933 return 3934 } 3935 if !done { 3936 ga.Response.Response = future.Response() 3937 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") 3938 return 3939 } 3940 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3941 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 3942 ga, err = client.UpdateResponder(ga.Response.Response) 3943 if err != nil { 3944 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 3945 } 3946 } 3947 return 3948} 3949 3950// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 3951// update. 3952type GalleryApplicationUpdate struct { 3953 *GalleryApplicationProperties `json:"properties,omitempty"` 3954 // ID - READ-ONLY; Resource Id 3955 ID *string `json:"id,omitempty"` 3956 // Name - READ-ONLY; Resource name 3957 Name *string `json:"name,omitempty"` 3958 // Type - READ-ONLY; Resource type 3959 Type *string `json:"type,omitempty"` 3960 // Tags - Resource tags 3961 Tags map[string]*string `json:"tags"` 3962} 3963 3964// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 3965func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 3966 objectMap := make(map[string]interface{}) 3967 if gau.GalleryApplicationProperties != nil { 3968 objectMap["properties"] = gau.GalleryApplicationProperties 3969 } 3970 if gau.Tags != nil { 3971 objectMap["tags"] = gau.Tags 3972 } 3973 return json.Marshal(objectMap) 3974} 3975 3976// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 3977func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 3978 var m map[string]*json.RawMessage 3979 err := json.Unmarshal(body, &m) 3980 if err != nil { 3981 return err 3982 } 3983 for k, v := range m { 3984 switch k { 3985 case "properties": 3986 if v != nil { 3987 var galleryApplicationProperties GalleryApplicationProperties 3988 err = json.Unmarshal(*v, &galleryApplicationProperties) 3989 if err != nil { 3990 return err 3991 } 3992 gau.GalleryApplicationProperties = &galleryApplicationProperties 3993 } 3994 case "id": 3995 if v != nil { 3996 var ID string 3997 err = json.Unmarshal(*v, &ID) 3998 if err != nil { 3999 return err 4000 } 4001 gau.ID = &ID 4002 } 4003 case "name": 4004 if v != nil { 4005 var name string 4006 err = json.Unmarshal(*v, &name) 4007 if err != nil { 4008 return err 4009 } 4010 gau.Name = &name 4011 } 4012 case "type": 4013 if v != nil { 4014 var typeVar string 4015 err = json.Unmarshal(*v, &typeVar) 4016 if err != nil { 4017 return err 4018 } 4019 gau.Type = &typeVar 4020 } 4021 case "tags": 4022 if v != nil { 4023 var tags map[string]*string 4024 err = json.Unmarshal(*v, &tags) 4025 if err != nil { 4026 return err 4027 } 4028 gau.Tags = tags 4029 } 4030 } 4031 } 4032 4033 return nil 4034} 4035 4036// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 4037// create or update. 4038type GalleryApplicationVersion struct { 4039 autorest.Response `json:"-"` 4040 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 4041 // ID - READ-ONLY; Resource Id 4042 ID *string `json:"id,omitempty"` 4043 // Name - READ-ONLY; Resource name 4044 Name *string `json:"name,omitempty"` 4045 // Type - READ-ONLY; Resource type 4046 Type *string `json:"type,omitempty"` 4047 // Location - Resource location 4048 Location *string `json:"location,omitempty"` 4049 // Tags - Resource tags 4050 Tags map[string]*string `json:"tags"` 4051} 4052 4053// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 4054func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 4055 objectMap := make(map[string]interface{}) 4056 if gav.GalleryApplicationVersionProperties != nil { 4057 objectMap["properties"] = gav.GalleryApplicationVersionProperties 4058 } 4059 if gav.Location != nil { 4060 objectMap["location"] = gav.Location 4061 } 4062 if gav.Tags != nil { 4063 objectMap["tags"] = gav.Tags 4064 } 4065 return json.Marshal(objectMap) 4066} 4067 4068// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 4069func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 4070 var m map[string]*json.RawMessage 4071 err := json.Unmarshal(body, &m) 4072 if err != nil { 4073 return err 4074 } 4075 for k, v := range m { 4076 switch k { 4077 case "properties": 4078 if v != nil { 4079 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 4080 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 4081 if err != nil { 4082 return err 4083 } 4084 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 4085 } 4086 case "id": 4087 if v != nil { 4088 var ID string 4089 err = json.Unmarshal(*v, &ID) 4090 if err != nil { 4091 return err 4092 } 4093 gav.ID = &ID 4094 } 4095 case "name": 4096 if v != nil { 4097 var name string 4098 err = json.Unmarshal(*v, &name) 4099 if err != nil { 4100 return err 4101 } 4102 gav.Name = &name 4103 } 4104 case "type": 4105 if v != nil { 4106 var typeVar string 4107 err = json.Unmarshal(*v, &typeVar) 4108 if err != nil { 4109 return err 4110 } 4111 gav.Type = &typeVar 4112 } 4113 case "location": 4114 if v != nil { 4115 var location string 4116 err = json.Unmarshal(*v, &location) 4117 if err != nil { 4118 return err 4119 } 4120 gav.Location = &location 4121 } 4122 case "tags": 4123 if v != nil { 4124 var tags map[string]*string 4125 err = json.Unmarshal(*v, &tags) 4126 if err != nil { 4127 return err 4128 } 4129 gav.Tags = tags 4130 } 4131 } 4132 } 4133 4134 return nil 4135} 4136 4137// GalleryApplicationVersionList the List Gallery Application version operation response. 4138type GalleryApplicationVersionList struct { 4139 autorest.Response `json:"-"` 4140 // Value - A list of gallery Application Versions. 4141 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 4142 // 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. 4143 NextLink *string `json:"nextLink,omitempty"` 4144} 4145 4146// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 4147// values. 4148type GalleryApplicationVersionListIterator struct { 4149 i int 4150 page GalleryApplicationVersionListPage 4151} 4152 4153// NextWithContext advances to the next value. If there was an error making 4154// the request the iterator does not advance and the error is returned. 4155func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 4156 if tracing.IsEnabled() { 4157 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 4158 defer func() { 4159 sc := -1 4160 if iter.Response().Response.Response != nil { 4161 sc = iter.Response().Response.Response.StatusCode 4162 } 4163 tracing.EndSpan(ctx, sc, err) 4164 }() 4165 } 4166 iter.i++ 4167 if iter.i < len(iter.page.Values()) { 4168 return nil 4169 } 4170 err = iter.page.NextWithContext(ctx) 4171 if err != nil { 4172 iter.i-- 4173 return err 4174 } 4175 iter.i = 0 4176 return nil 4177} 4178 4179// Next advances to the next value. If there was an error making 4180// the request the iterator does not advance and the error is returned. 4181// Deprecated: Use NextWithContext() instead. 4182func (iter *GalleryApplicationVersionListIterator) Next() error { 4183 return iter.NextWithContext(context.Background()) 4184} 4185 4186// NotDone returns true if the enumeration should be started or is not yet complete. 4187func (iter GalleryApplicationVersionListIterator) NotDone() bool { 4188 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4189} 4190 4191// Response returns the raw server response from the last page request. 4192func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 4193 return iter.page.Response() 4194} 4195 4196// Value returns the current value or a zero-initialized value if the 4197// iterator has advanced beyond the end of the collection. 4198func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 4199 if !iter.page.NotDone() { 4200 return GalleryApplicationVersion{} 4201 } 4202 return iter.page.Values()[iter.i] 4203} 4204 4205// Creates a new instance of the GalleryApplicationVersionListIterator type. 4206func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 4207 return GalleryApplicationVersionListIterator{page: page} 4208} 4209 4210// IsEmpty returns true if the ListResult contains no values. 4211func (gavl GalleryApplicationVersionList) IsEmpty() bool { 4212 return gavl.Value == nil || len(*gavl.Value) == 0 4213} 4214 4215// hasNextLink returns true if the NextLink is not empty. 4216func (gavl GalleryApplicationVersionList) hasNextLink() bool { 4217 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 4218} 4219 4220// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 4221// It returns nil if no more results exist. 4222func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 4223 if !gavl.hasNextLink() { 4224 return nil, nil 4225 } 4226 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4227 autorest.AsJSON(), 4228 autorest.AsGet(), 4229 autorest.WithBaseURL(to.String(gavl.NextLink))) 4230} 4231 4232// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 4233type GalleryApplicationVersionListPage struct { 4234 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 4235 gavl GalleryApplicationVersionList 4236} 4237 4238// NextWithContext advances to the next page of values. If there was an error making 4239// the request the page does not advance and the error is returned. 4240func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 4241 if tracing.IsEnabled() { 4242 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 4243 defer func() { 4244 sc := -1 4245 if page.Response().Response.Response != nil { 4246 sc = page.Response().Response.Response.StatusCode 4247 } 4248 tracing.EndSpan(ctx, sc, err) 4249 }() 4250 } 4251 for { 4252 next, err := page.fn(ctx, page.gavl) 4253 if err != nil { 4254 return err 4255 } 4256 page.gavl = next 4257 if !next.hasNextLink() || !next.IsEmpty() { 4258 break 4259 } 4260 } 4261 return nil 4262} 4263 4264// Next advances to the next page of values. If there was an error making 4265// the request the page does not advance and the error is returned. 4266// Deprecated: Use NextWithContext() instead. 4267func (page *GalleryApplicationVersionListPage) Next() error { 4268 return page.NextWithContext(context.Background()) 4269} 4270 4271// NotDone returns true if the page enumeration should be started or is not yet complete. 4272func (page GalleryApplicationVersionListPage) NotDone() bool { 4273 return !page.gavl.IsEmpty() 4274} 4275 4276// Response returns the raw server response from the last page request. 4277func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 4278 return page.gavl 4279} 4280 4281// Values returns the slice of values for the current page or nil if there are no values. 4282func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 4283 if page.gavl.IsEmpty() { 4284 return nil 4285 } 4286 return *page.gavl.Value 4287} 4288 4289// Creates a new instance of the GalleryApplicationVersionListPage type. 4290func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 4291 return GalleryApplicationVersionListPage{ 4292 fn: getNextPage, 4293 gavl: cur, 4294 } 4295} 4296 4297// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. 4298type GalleryApplicationVersionProperties struct { 4299 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 4300 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 4301 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 4302 // ReplicationStatus - READ-ONLY 4303 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 4304} 4305 4306// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 4307func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 4308 objectMap := make(map[string]interface{}) 4309 if gavp.PublishingProfile != nil { 4310 objectMap["publishingProfile"] = gavp.PublishingProfile 4311 } 4312 return json.Marshal(objectMap) 4313} 4314 4315// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. 4316type GalleryApplicationVersionPublishingProfile struct { 4317 Source *UserArtifactSource `json:"source,omitempty"` 4318 // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. 4319 ContentType *string `json:"contentType,omitempty"` 4320 // EnableHealthCheck - Optional. Whether or not this application reports health. 4321 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 4322 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4323 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4324 // 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. 4325 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4326 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4327 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4328 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4329 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4330 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4331 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4332 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 4333 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4334} 4335 4336// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 4337func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 4338 objectMap := make(map[string]interface{}) 4339 if gavpp.Source != nil { 4340 objectMap["source"] = gavpp.Source 4341 } 4342 if gavpp.ContentType != nil { 4343 objectMap["contentType"] = gavpp.ContentType 4344 } 4345 if gavpp.EnableHealthCheck != nil { 4346 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 4347 } 4348 if gavpp.TargetRegions != nil { 4349 objectMap["targetRegions"] = gavpp.TargetRegions 4350 } 4351 if gavpp.ReplicaCount != nil { 4352 objectMap["replicaCount"] = gavpp.ReplicaCount 4353 } 4354 if gavpp.ExcludeFromLatest != nil { 4355 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 4356 } 4357 if gavpp.EndOfLifeDate != nil { 4358 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 4359 } 4360 if gavpp.StorageAccountType != "" { 4361 objectMap["storageAccountType"] = gavpp.StorageAccountType 4362 } 4363 return json.Marshal(objectMap) 4364} 4365 4366// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 4367// of a long-running operation. 4368type GalleryApplicationVersionsCreateOrUpdateFuture struct { 4369 azure.FutureAPI 4370 // Result returns the result of the asynchronous operation. 4371 // If the operation has not completed it will return an error. 4372 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4373} 4374 4375// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4376func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4377 var azFuture azure.Future 4378 if err := json.Unmarshal(body, &azFuture); err != nil { 4379 return err 4380 } 4381 future.FutureAPI = &azFuture 4382 future.Result = future.result 4383 return nil 4384} 4385 4386// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. 4387func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 4388 var done bool 4389 done, err = future.DoneWithContext(context.Background(), client) 4390 if err != nil { 4391 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4392 return 4393 } 4394 if !done { 4395 gav.Response.Response = future.Response() 4396 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") 4397 return 4398 } 4399 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4400 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 4401 gav, err = client.CreateOrUpdateResponder(gav.Response.Response) 4402 if err != nil { 4403 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 4404 } 4405 } 4406 return 4407} 4408 4409// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 4410// long-running operation. 4411type GalleryApplicationVersionsDeleteFuture struct { 4412 azure.FutureAPI 4413 // Result returns the result of the asynchronous operation. 4414 // If the operation has not completed it will return an error. 4415 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 4416} 4417 4418// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4419func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 4420 var azFuture azure.Future 4421 if err := json.Unmarshal(body, &azFuture); err != nil { 4422 return err 4423 } 4424 future.FutureAPI = &azFuture 4425 future.Result = future.result 4426 return nil 4427} 4428 4429// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. 4430func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { 4431 var done bool 4432 done, err = future.DoneWithContext(context.Background(), client) 4433 if err != nil { 4434 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 4435 return 4436 } 4437 if !done { 4438 ar.Response = future.Response() 4439 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") 4440 return 4441 } 4442 ar.Response = future.Response() 4443 return 4444} 4445 4446// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 4447// long-running operation. 4448type GalleryApplicationVersionsUpdateFuture struct { 4449 azure.FutureAPI 4450 // Result returns the result of the asynchronous operation. 4451 // If the operation has not completed it will return an error. 4452 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4453} 4454 4455// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4456func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 4457 var azFuture azure.Future 4458 if err := json.Unmarshal(body, &azFuture); err != nil { 4459 return err 4460 } 4461 future.FutureAPI = &azFuture 4462 future.Result = future.result 4463 return nil 4464} 4465 4466// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. 4467func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 4468 var done bool 4469 done, err = future.DoneWithContext(context.Background(), client) 4470 if err != nil { 4471 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 4472 return 4473 } 4474 if !done { 4475 gav.Response.Response = future.Response() 4476 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") 4477 return 4478 } 4479 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4480 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 4481 gav, err = client.UpdateResponder(gav.Response.Response) 4482 if err != nil { 4483 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 4484 } 4485 } 4486 return 4487} 4488 4489// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 4490// want to update. 4491type GalleryApplicationVersionUpdate struct { 4492 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 4493 // ID - READ-ONLY; Resource Id 4494 ID *string `json:"id,omitempty"` 4495 // Name - READ-ONLY; Resource name 4496 Name *string `json:"name,omitempty"` 4497 // Type - READ-ONLY; Resource type 4498 Type *string `json:"type,omitempty"` 4499 // Tags - Resource tags 4500 Tags map[string]*string `json:"tags"` 4501} 4502 4503// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 4504func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 4505 objectMap := make(map[string]interface{}) 4506 if gavu.GalleryApplicationVersionProperties != nil { 4507 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 4508 } 4509 if gavu.Tags != nil { 4510 objectMap["tags"] = gavu.Tags 4511 } 4512 return json.Marshal(objectMap) 4513} 4514 4515// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 4516func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 4517 var m map[string]*json.RawMessage 4518 err := json.Unmarshal(body, &m) 4519 if err != nil { 4520 return err 4521 } 4522 for k, v := range m { 4523 switch k { 4524 case "properties": 4525 if v != nil { 4526 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 4527 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 4528 if err != nil { 4529 return err 4530 } 4531 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 4532 } 4533 case "id": 4534 if v != nil { 4535 var ID string 4536 err = json.Unmarshal(*v, &ID) 4537 if err != nil { 4538 return err 4539 } 4540 gavu.ID = &ID 4541 } 4542 case "name": 4543 if v != nil { 4544 var name string 4545 err = json.Unmarshal(*v, &name) 4546 if err != nil { 4547 return err 4548 } 4549 gavu.Name = &name 4550 } 4551 case "type": 4552 if v != nil { 4553 var typeVar string 4554 err = json.Unmarshal(*v, &typeVar) 4555 if err != nil { 4556 return err 4557 } 4558 gavu.Type = &typeVar 4559 } 4560 case "tags": 4561 if v != nil { 4562 var tags map[string]*string 4563 err = json.Unmarshal(*v, &tags) 4564 if err != nil { 4565 return err 4566 } 4567 gavu.Tags = tags 4568 } 4569 } 4570 } 4571 4572 return nil 4573} 4574 4575// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 4576type GalleryArtifactPublishingProfileBase struct { 4577 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4578 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4579 // 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. 4580 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4581 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4582 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4583 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4584 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4585 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4586 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4587 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 4588 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4589} 4590 4591// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 4592func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 4593 objectMap := make(map[string]interface{}) 4594 if gappb.TargetRegions != nil { 4595 objectMap["targetRegions"] = gappb.TargetRegions 4596 } 4597 if gappb.ReplicaCount != nil { 4598 objectMap["replicaCount"] = gappb.ReplicaCount 4599 } 4600 if gappb.ExcludeFromLatest != nil { 4601 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 4602 } 4603 if gappb.EndOfLifeDate != nil { 4604 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 4605 } 4606 if gappb.StorageAccountType != "" { 4607 objectMap["storageAccountType"] = gappb.StorageAccountType 4608 } 4609 return json.Marshal(objectMap) 4610} 4611 4612// GalleryArtifactSource the source image from which the Image Version is going to be created. 4613type GalleryArtifactSource struct { 4614 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 4615} 4616 4617// GalleryArtifactVersionSource the gallery artifact version source. 4618type GalleryArtifactVersionSource struct { 4619 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. 4620 ID *string `json:"id,omitempty"` 4621} 4622 4623// GalleryDataDiskImage this is the data disk image. 4624type GalleryDataDiskImage struct { 4625 // 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. 4626 Lun *int32 `json:"lun,omitempty"` 4627 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 4628 SizeInGB *int32 `json:"sizeInGB,omitempty"` 4629 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 4630 HostCaching HostCaching `json:"hostCaching,omitempty"` 4631 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4632} 4633 4634// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 4635func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 4636 objectMap := make(map[string]interface{}) 4637 if gddi.Lun != nil { 4638 objectMap["lun"] = gddi.Lun 4639 } 4640 if gddi.HostCaching != "" { 4641 objectMap["hostCaching"] = gddi.HostCaching 4642 } 4643 if gddi.Source != nil { 4644 objectMap["source"] = gddi.Source 4645 } 4646 return json.Marshal(objectMap) 4647} 4648 4649// GalleryDiskImage this is the disk image base class. 4650type GalleryDiskImage struct { 4651 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 4652 SizeInGB *int32 `json:"sizeInGB,omitempty"` 4653 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 4654 HostCaching HostCaching `json:"hostCaching,omitempty"` 4655 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4656} 4657 4658// MarshalJSON is the custom marshaler for GalleryDiskImage. 4659func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 4660 objectMap := make(map[string]interface{}) 4661 if gdi.HostCaching != "" { 4662 objectMap["hostCaching"] = gdi.HostCaching 4663 } 4664 if gdi.Source != nil { 4665 objectMap["source"] = gdi.Source 4666 } 4667 return json.Marshal(objectMap) 4668} 4669 4670// GalleryIdentifier describes the gallery unique name. 4671type GalleryIdentifier struct { 4672 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 4673 UniqueName *string `json:"uniqueName,omitempty"` 4674} 4675 4676// MarshalJSON is the custom marshaler for GalleryIdentifier. 4677func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { 4678 objectMap := make(map[string]interface{}) 4679 return json.Marshal(objectMap) 4680} 4681 4682// GalleryImage specifies information about the gallery Image Definition that you want to create or update. 4683type GalleryImage struct { 4684 autorest.Response `json:"-"` 4685 *GalleryImageProperties `json:"properties,omitempty"` 4686 // ID - READ-ONLY; Resource Id 4687 ID *string `json:"id,omitempty"` 4688 // Name - READ-ONLY; Resource name 4689 Name *string `json:"name,omitempty"` 4690 // Type - READ-ONLY; Resource type 4691 Type *string `json:"type,omitempty"` 4692 // Location - Resource location 4693 Location *string `json:"location,omitempty"` 4694 // Tags - Resource tags 4695 Tags map[string]*string `json:"tags"` 4696} 4697 4698// MarshalJSON is the custom marshaler for GalleryImage. 4699func (gi GalleryImage) MarshalJSON() ([]byte, error) { 4700 objectMap := make(map[string]interface{}) 4701 if gi.GalleryImageProperties != nil { 4702 objectMap["properties"] = gi.GalleryImageProperties 4703 } 4704 if gi.Location != nil { 4705 objectMap["location"] = gi.Location 4706 } 4707 if gi.Tags != nil { 4708 objectMap["tags"] = gi.Tags 4709 } 4710 return json.Marshal(objectMap) 4711} 4712 4713// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 4714func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 4715 var m map[string]*json.RawMessage 4716 err := json.Unmarshal(body, &m) 4717 if err != nil { 4718 return err 4719 } 4720 for k, v := range m { 4721 switch k { 4722 case "properties": 4723 if v != nil { 4724 var galleryImageProperties GalleryImageProperties 4725 err = json.Unmarshal(*v, &galleryImageProperties) 4726 if err != nil { 4727 return err 4728 } 4729 gi.GalleryImageProperties = &galleryImageProperties 4730 } 4731 case "id": 4732 if v != nil { 4733 var ID string 4734 err = json.Unmarshal(*v, &ID) 4735 if err != nil { 4736 return err 4737 } 4738 gi.ID = &ID 4739 } 4740 case "name": 4741 if v != nil { 4742 var name string 4743 err = json.Unmarshal(*v, &name) 4744 if err != nil { 4745 return err 4746 } 4747 gi.Name = &name 4748 } 4749 case "type": 4750 if v != nil { 4751 var typeVar string 4752 err = json.Unmarshal(*v, &typeVar) 4753 if err != nil { 4754 return err 4755 } 4756 gi.Type = &typeVar 4757 } 4758 case "location": 4759 if v != nil { 4760 var location string 4761 err = json.Unmarshal(*v, &location) 4762 if err != nil { 4763 return err 4764 } 4765 gi.Location = &location 4766 } 4767 case "tags": 4768 if v != nil { 4769 var tags map[string]*string 4770 err = json.Unmarshal(*v, &tags) 4771 if err != nil { 4772 return err 4773 } 4774 gi.Tags = tags 4775 } 4776 } 4777 } 4778 4779 return nil 4780} 4781 4782// GalleryImageIdentifier this is the gallery Image Definition identifier. 4783type GalleryImageIdentifier struct { 4784 // Publisher - The name of the gallery Image Definition publisher. 4785 Publisher *string `json:"publisher,omitempty"` 4786 // Offer - The name of the gallery Image Definition offer. 4787 Offer *string `json:"offer,omitempty"` 4788 // Sku - The name of the gallery Image Definition SKU. 4789 Sku *string `json:"sku,omitempty"` 4790} 4791 4792// GalleryImageList the List Gallery Images operation response. 4793type GalleryImageList struct { 4794 autorest.Response `json:"-"` 4795 // Value - A list of Shared Image Gallery images. 4796 Value *[]GalleryImage `json:"value,omitempty"` 4797 // 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. 4798 NextLink *string `json:"nextLink,omitempty"` 4799} 4800 4801// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 4802type GalleryImageListIterator struct { 4803 i int 4804 page GalleryImageListPage 4805} 4806 4807// NextWithContext advances to the next value. If there was an error making 4808// the request the iterator does not advance and the error is returned. 4809func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 4810 if tracing.IsEnabled() { 4811 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 4812 defer func() { 4813 sc := -1 4814 if iter.Response().Response.Response != nil { 4815 sc = iter.Response().Response.Response.StatusCode 4816 } 4817 tracing.EndSpan(ctx, sc, err) 4818 }() 4819 } 4820 iter.i++ 4821 if iter.i < len(iter.page.Values()) { 4822 return nil 4823 } 4824 err = iter.page.NextWithContext(ctx) 4825 if err != nil { 4826 iter.i-- 4827 return err 4828 } 4829 iter.i = 0 4830 return nil 4831} 4832 4833// Next advances to the next value. If there was an error making 4834// the request the iterator does not advance and the error is returned. 4835// Deprecated: Use NextWithContext() instead. 4836func (iter *GalleryImageListIterator) Next() error { 4837 return iter.NextWithContext(context.Background()) 4838} 4839 4840// NotDone returns true if the enumeration should be started or is not yet complete. 4841func (iter GalleryImageListIterator) NotDone() bool { 4842 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4843} 4844 4845// Response returns the raw server response from the last page request. 4846func (iter GalleryImageListIterator) Response() GalleryImageList { 4847 return iter.page.Response() 4848} 4849 4850// Value returns the current value or a zero-initialized value if the 4851// iterator has advanced beyond the end of the collection. 4852func (iter GalleryImageListIterator) Value() GalleryImage { 4853 if !iter.page.NotDone() { 4854 return GalleryImage{} 4855 } 4856 return iter.page.Values()[iter.i] 4857} 4858 4859// Creates a new instance of the GalleryImageListIterator type. 4860func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 4861 return GalleryImageListIterator{page: page} 4862} 4863 4864// IsEmpty returns true if the ListResult contains no values. 4865func (gil GalleryImageList) IsEmpty() bool { 4866 return gil.Value == nil || len(*gil.Value) == 0 4867} 4868 4869// hasNextLink returns true if the NextLink is not empty. 4870func (gil GalleryImageList) hasNextLink() bool { 4871 return gil.NextLink != nil && len(*gil.NextLink) != 0 4872} 4873 4874// galleryImageListPreparer prepares a request to retrieve the next set of results. 4875// It returns nil if no more results exist. 4876func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 4877 if !gil.hasNextLink() { 4878 return nil, nil 4879 } 4880 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4881 autorest.AsJSON(), 4882 autorest.AsGet(), 4883 autorest.WithBaseURL(to.String(gil.NextLink))) 4884} 4885 4886// GalleryImageListPage contains a page of GalleryImage values. 4887type GalleryImageListPage struct { 4888 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 4889 gil GalleryImageList 4890} 4891 4892// NextWithContext advances to the next page of values. If there was an error making 4893// the request the page does not advance and the error is returned. 4894func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 4895 if tracing.IsEnabled() { 4896 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 4897 defer func() { 4898 sc := -1 4899 if page.Response().Response.Response != nil { 4900 sc = page.Response().Response.Response.StatusCode 4901 } 4902 tracing.EndSpan(ctx, sc, err) 4903 }() 4904 } 4905 for { 4906 next, err := page.fn(ctx, page.gil) 4907 if err != nil { 4908 return err 4909 } 4910 page.gil = next 4911 if !next.hasNextLink() || !next.IsEmpty() { 4912 break 4913 } 4914 } 4915 return nil 4916} 4917 4918// Next advances to the next page of values. If there was an error making 4919// the request the page does not advance and the error is returned. 4920// Deprecated: Use NextWithContext() instead. 4921func (page *GalleryImageListPage) Next() error { 4922 return page.NextWithContext(context.Background()) 4923} 4924 4925// NotDone returns true if the page enumeration should be started or is not yet complete. 4926func (page GalleryImageListPage) NotDone() bool { 4927 return !page.gil.IsEmpty() 4928} 4929 4930// Response returns the raw server response from the last page request. 4931func (page GalleryImageListPage) Response() GalleryImageList { 4932 return page.gil 4933} 4934 4935// Values returns the slice of values for the current page or nil if there are no values. 4936func (page GalleryImageListPage) Values() []GalleryImage { 4937 if page.gil.IsEmpty() { 4938 return nil 4939 } 4940 return *page.gil.Value 4941} 4942 4943// Creates a new instance of the GalleryImageListPage type. 4944func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 4945 return GalleryImageListPage{ 4946 fn: getNextPage, 4947 gil: cur, 4948 } 4949} 4950 4951// GalleryImageProperties describes the properties of a gallery Image Definition. 4952type GalleryImageProperties struct { 4953 // Description - The description of this gallery Image Definition resource. This property is updatable. 4954 Description *string `json:"description,omitempty"` 4955 // Eula - The Eula agreement for the gallery Image Definition. 4956 Eula *string `json:"eula,omitempty"` 4957 // PrivacyStatementURI - The privacy statement uri. 4958 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 4959 // ReleaseNoteURI - The release note uri. 4960 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 4961 // 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' 4962 OsType OperatingSystemTypes `json:"osType,omitempty"` 4963 // 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' 4964 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 4965 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 4966 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4967 // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. 4968 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4969 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 4970 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 4971 Disallowed *Disallowed `json:"disallowed,omitempty"` 4972 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 4973 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 4974 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 4975} 4976 4977// MarshalJSON is the custom marshaler for GalleryImageProperties. 4978func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 4979 objectMap := make(map[string]interface{}) 4980 if gip.Description != nil { 4981 objectMap["description"] = gip.Description 4982 } 4983 if gip.Eula != nil { 4984 objectMap["eula"] = gip.Eula 4985 } 4986 if gip.PrivacyStatementURI != nil { 4987 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 4988 } 4989 if gip.ReleaseNoteURI != nil { 4990 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 4991 } 4992 if gip.OsType != "" { 4993 objectMap["osType"] = gip.OsType 4994 } 4995 if gip.OsState != "" { 4996 objectMap["osState"] = gip.OsState 4997 } 4998 if gip.HyperVGeneration != "" { 4999 objectMap["hyperVGeneration"] = gip.HyperVGeneration 5000 } 5001 if gip.EndOfLifeDate != nil { 5002 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 5003 } 5004 if gip.Identifier != nil { 5005 objectMap["identifier"] = gip.Identifier 5006 } 5007 if gip.Recommended != nil { 5008 objectMap["recommended"] = gip.Recommended 5009 } 5010 if gip.Disallowed != nil { 5011 objectMap["disallowed"] = gip.Disallowed 5012 } 5013 if gip.PurchasePlan != nil { 5014 objectMap["purchasePlan"] = gip.PurchasePlan 5015 } 5016 return json.Marshal(objectMap) 5017} 5018 5019// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5020// long-running operation. 5021type GalleryImagesCreateOrUpdateFuture struct { 5022 azure.FutureAPI 5023 // Result returns the result of the asynchronous operation. 5024 // If the operation has not completed it will return an error. 5025 Result func(GalleryImagesClient) (GalleryImage, error) 5026} 5027 5028// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5029func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5030 var azFuture azure.Future 5031 if err := json.Unmarshal(body, &azFuture); err != nil { 5032 return err 5033 } 5034 future.FutureAPI = &azFuture 5035 future.Result = future.result 5036 return nil 5037} 5038 5039// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. 5040func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 5041 var done bool 5042 done, err = future.DoneWithContext(context.Background(), client) 5043 if err != nil { 5044 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5045 return 5046 } 5047 if !done { 5048 gi.Response.Response = future.Response() 5049 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") 5050 return 5051 } 5052 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5053 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 5054 gi, err = client.CreateOrUpdateResponder(gi.Response.Response) 5055 if err != nil { 5056 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 5057 } 5058 } 5059 return 5060} 5061 5062// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5063// operation. 5064type GalleryImagesDeleteFuture struct { 5065 azure.FutureAPI 5066 // Result returns the result of the asynchronous operation. 5067 // If the operation has not completed it will return an error. 5068 Result func(GalleryImagesClient) (autorest.Response, error) 5069} 5070 5071// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5072func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { 5073 var azFuture azure.Future 5074 if err := json.Unmarshal(body, &azFuture); err != nil { 5075 return err 5076 } 5077 future.FutureAPI = &azFuture 5078 future.Result = future.result 5079 return nil 5080} 5081 5082// result is the default implementation for GalleryImagesDeleteFuture.Result. 5083func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { 5084 var done bool 5085 done, err = future.DoneWithContext(context.Background(), client) 5086 if err != nil { 5087 err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") 5088 return 5089 } 5090 if !done { 5091 ar.Response = future.Response() 5092 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") 5093 return 5094 } 5095 ar.Response = future.Response() 5096 return 5097} 5098 5099// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5100// operation. 5101type GalleryImagesUpdateFuture struct { 5102 azure.FutureAPI 5103 // Result returns the result of the asynchronous operation. 5104 // If the operation has not completed it will return an error. 5105 Result func(GalleryImagesClient) (GalleryImage, error) 5106} 5107 5108// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5109func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { 5110 var azFuture azure.Future 5111 if err := json.Unmarshal(body, &azFuture); err != nil { 5112 return err 5113 } 5114 future.FutureAPI = &azFuture 5115 future.Result = future.result 5116 return nil 5117} 5118 5119// result is the default implementation for GalleryImagesUpdateFuture.Result. 5120func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 5121 var done bool 5122 done, err = future.DoneWithContext(context.Background(), client) 5123 if err != nil { 5124 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") 5125 return 5126 } 5127 if !done { 5128 gi.Response.Response = future.Response() 5129 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") 5130 return 5131 } 5132 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5133 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 5134 gi, err = client.UpdateResponder(gi.Response.Response) 5135 if err != nil { 5136 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 5137 } 5138 } 5139 return 5140} 5141 5142// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. 5143type GalleryImageUpdate struct { 5144 *GalleryImageProperties `json:"properties,omitempty"` 5145 // ID - READ-ONLY; Resource Id 5146 ID *string `json:"id,omitempty"` 5147 // Name - READ-ONLY; Resource name 5148 Name *string `json:"name,omitempty"` 5149 // Type - READ-ONLY; Resource type 5150 Type *string `json:"type,omitempty"` 5151 // Tags - Resource tags 5152 Tags map[string]*string `json:"tags"` 5153} 5154 5155// MarshalJSON is the custom marshaler for GalleryImageUpdate. 5156func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 5157 objectMap := make(map[string]interface{}) 5158 if giu.GalleryImageProperties != nil { 5159 objectMap["properties"] = giu.GalleryImageProperties 5160 } 5161 if giu.Tags != nil { 5162 objectMap["tags"] = giu.Tags 5163 } 5164 return json.Marshal(objectMap) 5165} 5166 5167// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 5168func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 5169 var m map[string]*json.RawMessage 5170 err := json.Unmarshal(body, &m) 5171 if err != nil { 5172 return err 5173 } 5174 for k, v := range m { 5175 switch k { 5176 case "properties": 5177 if v != nil { 5178 var galleryImageProperties GalleryImageProperties 5179 err = json.Unmarshal(*v, &galleryImageProperties) 5180 if err != nil { 5181 return err 5182 } 5183 giu.GalleryImageProperties = &galleryImageProperties 5184 } 5185 case "id": 5186 if v != nil { 5187 var ID string 5188 err = json.Unmarshal(*v, &ID) 5189 if err != nil { 5190 return err 5191 } 5192 giu.ID = &ID 5193 } 5194 case "name": 5195 if v != nil { 5196 var name string 5197 err = json.Unmarshal(*v, &name) 5198 if err != nil { 5199 return err 5200 } 5201 giu.Name = &name 5202 } 5203 case "type": 5204 if v != nil { 5205 var typeVar string 5206 err = json.Unmarshal(*v, &typeVar) 5207 if err != nil { 5208 return err 5209 } 5210 giu.Type = &typeVar 5211 } 5212 case "tags": 5213 if v != nil { 5214 var tags map[string]*string 5215 err = json.Unmarshal(*v, &tags) 5216 if err != nil { 5217 return err 5218 } 5219 giu.Tags = tags 5220 } 5221 } 5222 } 5223 5224 return nil 5225} 5226 5227// GalleryImageVersion specifies information about the gallery Image Version that you want to create or 5228// update. 5229type GalleryImageVersion struct { 5230 autorest.Response `json:"-"` 5231 *GalleryImageVersionProperties `json:"properties,omitempty"` 5232 // ID - READ-ONLY; Resource Id 5233 ID *string `json:"id,omitempty"` 5234 // Name - READ-ONLY; Resource name 5235 Name *string `json:"name,omitempty"` 5236 // Type - READ-ONLY; Resource type 5237 Type *string `json:"type,omitempty"` 5238 // Location - Resource location 5239 Location *string `json:"location,omitempty"` 5240 // Tags - Resource tags 5241 Tags map[string]*string `json:"tags"` 5242} 5243 5244// MarshalJSON is the custom marshaler for GalleryImageVersion. 5245func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 5246 objectMap := make(map[string]interface{}) 5247 if giv.GalleryImageVersionProperties != nil { 5248 objectMap["properties"] = giv.GalleryImageVersionProperties 5249 } 5250 if giv.Location != nil { 5251 objectMap["location"] = giv.Location 5252 } 5253 if giv.Tags != nil { 5254 objectMap["tags"] = giv.Tags 5255 } 5256 return json.Marshal(objectMap) 5257} 5258 5259// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 5260func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 5261 var m map[string]*json.RawMessage 5262 err := json.Unmarshal(body, &m) 5263 if err != nil { 5264 return err 5265 } 5266 for k, v := range m { 5267 switch k { 5268 case "properties": 5269 if v != nil { 5270 var galleryImageVersionProperties GalleryImageVersionProperties 5271 err = json.Unmarshal(*v, &galleryImageVersionProperties) 5272 if err != nil { 5273 return err 5274 } 5275 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 5276 } 5277 case "id": 5278 if v != nil { 5279 var ID string 5280 err = json.Unmarshal(*v, &ID) 5281 if err != nil { 5282 return err 5283 } 5284 giv.ID = &ID 5285 } 5286 case "name": 5287 if v != nil { 5288 var name string 5289 err = json.Unmarshal(*v, &name) 5290 if err != nil { 5291 return err 5292 } 5293 giv.Name = &name 5294 } 5295 case "type": 5296 if v != nil { 5297 var typeVar string 5298 err = json.Unmarshal(*v, &typeVar) 5299 if err != nil { 5300 return err 5301 } 5302 giv.Type = &typeVar 5303 } 5304 case "location": 5305 if v != nil { 5306 var location string 5307 err = json.Unmarshal(*v, &location) 5308 if err != nil { 5309 return err 5310 } 5311 giv.Location = &location 5312 } 5313 case "tags": 5314 if v != nil { 5315 var tags map[string]*string 5316 err = json.Unmarshal(*v, &tags) 5317 if err != nil { 5318 return err 5319 } 5320 giv.Tags = tags 5321 } 5322 } 5323 } 5324 5325 return nil 5326} 5327 5328// GalleryImageVersionList the List Gallery Image version operation response. 5329type GalleryImageVersionList struct { 5330 autorest.Response `json:"-"` 5331 // Value - A list of gallery Image Versions. 5332 Value *[]GalleryImageVersion `json:"value,omitempty"` 5333 // 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. 5334 NextLink *string `json:"nextLink,omitempty"` 5335} 5336 5337// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 5338type GalleryImageVersionListIterator struct { 5339 i int 5340 page GalleryImageVersionListPage 5341} 5342 5343// NextWithContext advances to the next value. If there was an error making 5344// the request the iterator does not advance and the error is returned. 5345func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 5346 if tracing.IsEnabled() { 5347 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 5348 defer func() { 5349 sc := -1 5350 if iter.Response().Response.Response != nil { 5351 sc = iter.Response().Response.Response.StatusCode 5352 } 5353 tracing.EndSpan(ctx, sc, err) 5354 }() 5355 } 5356 iter.i++ 5357 if iter.i < len(iter.page.Values()) { 5358 return nil 5359 } 5360 err = iter.page.NextWithContext(ctx) 5361 if err != nil { 5362 iter.i-- 5363 return err 5364 } 5365 iter.i = 0 5366 return nil 5367} 5368 5369// Next advances to the next value. If there was an error making 5370// the request the iterator does not advance and the error is returned. 5371// Deprecated: Use NextWithContext() instead. 5372func (iter *GalleryImageVersionListIterator) Next() error { 5373 return iter.NextWithContext(context.Background()) 5374} 5375 5376// NotDone returns true if the enumeration should be started or is not yet complete. 5377func (iter GalleryImageVersionListIterator) NotDone() bool { 5378 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5379} 5380 5381// Response returns the raw server response from the last page request. 5382func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 5383 return iter.page.Response() 5384} 5385 5386// Value returns the current value or a zero-initialized value if the 5387// iterator has advanced beyond the end of the collection. 5388func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 5389 if !iter.page.NotDone() { 5390 return GalleryImageVersion{} 5391 } 5392 return iter.page.Values()[iter.i] 5393} 5394 5395// Creates a new instance of the GalleryImageVersionListIterator type. 5396func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 5397 return GalleryImageVersionListIterator{page: page} 5398} 5399 5400// IsEmpty returns true if the ListResult contains no values. 5401func (givl GalleryImageVersionList) IsEmpty() bool { 5402 return givl.Value == nil || len(*givl.Value) == 0 5403} 5404 5405// hasNextLink returns true if the NextLink is not empty. 5406func (givl GalleryImageVersionList) hasNextLink() bool { 5407 return givl.NextLink != nil && len(*givl.NextLink) != 0 5408} 5409 5410// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 5411// It returns nil if no more results exist. 5412func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 5413 if !givl.hasNextLink() { 5414 return nil, nil 5415 } 5416 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5417 autorest.AsJSON(), 5418 autorest.AsGet(), 5419 autorest.WithBaseURL(to.String(givl.NextLink))) 5420} 5421 5422// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 5423type GalleryImageVersionListPage struct { 5424 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 5425 givl GalleryImageVersionList 5426} 5427 5428// NextWithContext advances to the next page of values. If there was an error making 5429// the request the page does not advance and the error is returned. 5430func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 5431 if tracing.IsEnabled() { 5432 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 5433 defer func() { 5434 sc := -1 5435 if page.Response().Response.Response != nil { 5436 sc = page.Response().Response.Response.StatusCode 5437 } 5438 tracing.EndSpan(ctx, sc, err) 5439 }() 5440 } 5441 for { 5442 next, err := page.fn(ctx, page.givl) 5443 if err != nil { 5444 return err 5445 } 5446 page.givl = next 5447 if !next.hasNextLink() || !next.IsEmpty() { 5448 break 5449 } 5450 } 5451 return nil 5452} 5453 5454// Next advances to the next page of values. If there was an error making 5455// the request the page does not advance and the error is returned. 5456// Deprecated: Use NextWithContext() instead. 5457func (page *GalleryImageVersionListPage) Next() error { 5458 return page.NextWithContext(context.Background()) 5459} 5460 5461// NotDone returns true if the page enumeration should be started or is not yet complete. 5462func (page GalleryImageVersionListPage) NotDone() bool { 5463 return !page.givl.IsEmpty() 5464} 5465 5466// Response returns the raw server response from the last page request. 5467func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 5468 return page.givl 5469} 5470 5471// Values returns the slice of values for the current page or nil if there are no values. 5472func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 5473 if page.givl.IsEmpty() { 5474 return nil 5475 } 5476 return *page.givl.Value 5477} 5478 5479// Creates a new instance of the GalleryImageVersionListPage type. 5480func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 5481 return GalleryImageVersionListPage{ 5482 fn: getNextPage, 5483 givl: cur, 5484 } 5485} 5486 5487// GalleryImageVersionProperties describes the properties of a gallery Image Version. 5488type GalleryImageVersionProperties struct { 5489 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 5490 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 5491 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 5492 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 5493 // ReplicationStatus - READ-ONLY 5494 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 5495} 5496 5497// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 5498func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 5499 objectMap := make(map[string]interface{}) 5500 if givp.PublishingProfile != nil { 5501 objectMap["publishingProfile"] = givp.PublishingProfile 5502 } 5503 if givp.StorageProfile != nil { 5504 objectMap["storageProfile"] = givp.StorageProfile 5505 } 5506 return json.Marshal(objectMap) 5507} 5508 5509// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. 5510type GalleryImageVersionPublishingProfile struct { 5511 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 5512 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 5513 // 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. 5514 ReplicaCount *int32 `json:"replicaCount,omitempty"` 5515 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 5516 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 5517 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 5518 PublishedDate *date.Time `json:"publishedDate,omitempty"` 5519 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 5520 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 5521 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 5522 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 5523} 5524 5525// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 5526func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 5527 objectMap := make(map[string]interface{}) 5528 if givpp.TargetRegions != nil { 5529 objectMap["targetRegions"] = givpp.TargetRegions 5530 } 5531 if givpp.ReplicaCount != nil { 5532 objectMap["replicaCount"] = givpp.ReplicaCount 5533 } 5534 if givpp.ExcludeFromLatest != nil { 5535 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 5536 } 5537 if givpp.EndOfLifeDate != nil { 5538 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 5539 } 5540 if givpp.StorageAccountType != "" { 5541 objectMap["storageAccountType"] = givpp.StorageAccountType 5542 } 5543 return json.Marshal(objectMap) 5544} 5545 5546// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5547// long-running operation. 5548type GalleryImageVersionsCreateOrUpdateFuture struct { 5549 azure.FutureAPI 5550 // Result returns the result of the asynchronous operation. 5551 // If the operation has not completed it will return an error. 5552 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 5553} 5554 5555// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5556func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5557 var azFuture azure.Future 5558 if err := json.Unmarshal(body, &azFuture); err != nil { 5559 return err 5560 } 5561 future.FutureAPI = &azFuture 5562 future.Result = future.result 5563 return nil 5564} 5565 5566// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. 5567func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 5568 var done bool 5569 done, err = future.DoneWithContext(context.Background(), client) 5570 if err != nil { 5571 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5572 return 5573 } 5574 if !done { 5575 giv.Response.Response = future.Response() 5576 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") 5577 return 5578 } 5579 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5580 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 5581 giv, err = client.CreateOrUpdateResponder(giv.Response.Response) 5582 if err != nil { 5583 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 5584 } 5585 } 5586 return 5587} 5588 5589// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 5590// long-running operation. 5591type GalleryImageVersionsDeleteFuture struct { 5592 azure.FutureAPI 5593 // Result returns the result of the asynchronous operation. 5594 // If the operation has not completed it will return an error. 5595 Result func(GalleryImageVersionsClient) (autorest.Response, error) 5596} 5597 5598// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5599func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 5600 var azFuture azure.Future 5601 if err := json.Unmarshal(body, &azFuture); err != nil { 5602 return err 5603 } 5604 future.FutureAPI = &azFuture 5605 future.Result = future.result 5606 return nil 5607} 5608 5609// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. 5610func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { 5611 var done bool 5612 done, err = future.DoneWithContext(context.Background(), client) 5613 if err != nil { 5614 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 5615 return 5616 } 5617 if !done { 5618 ar.Response = future.Response() 5619 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") 5620 return 5621 } 5622 ar.Response = future.Response() 5623 return 5624} 5625 5626// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 5627type GalleryImageVersionStorageProfile struct { 5628 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5629 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 5630 // DataDiskImages - A list of data disk images. 5631 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 5632} 5633 5634// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 5635// long-running operation. 5636type GalleryImageVersionsUpdateFuture struct { 5637 azure.FutureAPI 5638 // Result returns the result of the asynchronous operation. 5639 // If the operation has not completed it will return an error. 5640 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 5641} 5642 5643// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5644func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 5645 var azFuture azure.Future 5646 if err := json.Unmarshal(body, &azFuture); err != nil { 5647 return err 5648 } 5649 future.FutureAPI = &azFuture 5650 future.Result = future.result 5651 return nil 5652} 5653 5654// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. 5655func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 5656 var done bool 5657 done, err = future.DoneWithContext(context.Background(), client) 5658 if err != nil { 5659 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 5660 return 5661 } 5662 if !done { 5663 giv.Response.Response = future.Response() 5664 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") 5665 return 5666 } 5667 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5668 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 5669 giv, err = client.UpdateResponder(giv.Response.Response) 5670 if err != nil { 5671 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 5672 } 5673 } 5674 return 5675} 5676 5677// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. 5678type GalleryImageVersionUpdate struct { 5679 *GalleryImageVersionProperties `json:"properties,omitempty"` 5680 // ID - READ-ONLY; Resource Id 5681 ID *string `json:"id,omitempty"` 5682 // Name - READ-ONLY; Resource name 5683 Name *string `json:"name,omitempty"` 5684 // Type - READ-ONLY; Resource type 5685 Type *string `json:"type,omitempty"` 5686 // Tags - Resource tags 5687 Tags map[string]*string `json:"tags"` 5688} 5689 5690// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 5691func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 5692 objectMap := make(map[string]interface{}) 5693 if givu.GalleryImageVersionProperties != nil { 5694 objectMap["properties"] = givu.GalleryImageVersionProperties 5695 } 5696 if givu.Tags != nil { 5697 objectMap["tags"] = givu.Tags 5698 } 5699 return json.Marshal(objectMap) 5700} 5701 5702// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 5703func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 5704 var m map[string]*json.RawMessage 5705 err := json.Unmarshal(body, &m) 5706 if err != nil { 5707 return err 5708 } 5709 for k, v := range m { 5710 switch k { 5711 case "properties": 5712 if v != nil { 5713 var galleryImageVersionProperties GalleryImageVersionProperties 5714 err = json.Unmarshal(*v, &galleryImageVersionProperties) 5715 if err != nil { 5716 return err 5717 } 5718 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 5719 } 5720 case "id": 5721 if v != nil { 5722 var ID string 5723 err = json.Unmarshal(*v, &ID) 5724 if err != nil { 5725 return err 5726 } 5727 givu.ID = &ID 5728 } 5729 case "name": 5730 if v != nil { 5731 var name string 5732 err = json.Unmarshal(*v, &name) 5733 if err != nil { 5734 return err 5735 } 5736 givu.Name = &name 5737 } 5738 case "type": 5739 if v != nil { 5740 var typeVar string 5741 err = json.Unmarshal(*v, &typeVar) 5742 if err != nil { 5743 return err 5744 } 5745 givu.Type = &typeVar 5746 } 5747 case "tags": 5748 if v != nil { 5749 var tags map[string]*string 5750 err = json.Unmarshal(*v, &tags) 5751 if err != nil { 5752 return err 5753 } 5754 givu.Tags = tags 5755 } 5756 } 5757 } 5758 5759 return nil 5760} 5761 5762// GalleryList the List Galleries operation response. 5763type GalleryList struct { 5764 autorest.Response `json:"-"` 5765 // Value - A list of galleries. 5766 Value *[]Gallery `json:"value,omitempty"` 5767 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 5768 NextLink *string `json:"nextLink,omitempty"` 5769} 5770 5771// GalleryListIterator provides access to a complete listing of Gallery values. 5772type GalleryListIterator struct { 5773 i int 5774 page GalleryListPage 5775} 5776 5777// NextWithContext advances to the next value. If there was an error making 5778// the request the iterator does not advance and the error is returned. 5779func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 5780 if tracing.IsEnabled() { 5781 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 5782 defer func() { 5783 sc := -1 5784 if iter.Response().Response.Response != nil { 5785 sc = iter.Response().Response.Response.StatusCode 5786 } 5787 tracing.EndSpan(ctx, sc, err) 5788 }() 5789 } 5790 iter.i++ 5791 if iter.i < len(iter.page.Values()) { 5792 return nil 5793 } 5794 err = iter.page.NextWithContext(ctx) 5795 if err != nil { 5796 iter.i-- 5797 return err 5798 } 5799 iter.i = 0 5800 return nil 5801} 5802 5803// Next advances to the next value. If there was an error making 5804// the request the iterator does not advance and the error is returned. 5805// Deprecated: Use NextWithContext() instead. 5806func (iter *GalleryListIterator) Next() error { 5807 return iter.NextWithContext(context.Background()) 5808} 5809 5810// NotDone returns true if the enumeration should be started or is not yet complete. 5811func (iter GalleryListIterator) NotDone() bool { 5812 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5813} 5814 5815// Response returns the raw server response from the last page request. 5816func (iter GalleryListIterator) Response() GalleryList { 5817 return iter.page.Response() 5818} 5819 5820// Value returns the current value or a zero-initialized value if the 5821// iterator has advanced beyond the end of the collection. 5822func (iter GalleryListIterator) Value() Gallery { 5823 if !iter.page.NotDone() { 5824 return Gallery{} 5825 } 5826 return iter.page.Values()[iter.i] 5827} 5828 5829// Creates a new instance of the GalleryListIterator type. 5830func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 5831 return GalleryListIterator{page: page} 5832} 5833 5834// IsEmpty returns true if the ListResult contains no values. 5835func (gl GalleryList) IsEmpty() bool { 5836 return gl.Value == nil || len(*gl.Value) == 0 5837} 5838 5839// hasNextLink returns true if the NextLink is not empty. 5840func (gl GalleryList) hasNextLink() bool { 5841 return gl.NextLink != nil && len(*gl.NextLink) != 0 5842} 5843 5844// galleryListPreparer prepares a request to retrieve the next set of results. 5845// It returns nil if no more results exist. 5846func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 5847 if !gl.hasNextLink() { 5848 return nil, nil 5849 } 5850 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5851 autorest.AsJSON(), 5852 autorest.AsGet(), 5853 autorest.WithBaseURL(to.String(gl.NextLink))) 5854} 5855 5856// GalleryListPage contains a page of Gallery values. 5857type GalleryListPage struct { 5858 fn func(context.Context, GalleryList) (GalleryList, error) 5859 gl GalleryList 5860} 5861 5862// NextWithContext advances to the next page of values. If there was an error making 5863// the request the page does not advance and the error is returned. 5864func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 5865 if tracing.IsEnabled() { 5866 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 5867 defer func() { 5868 sc := -1 5869 if page.Response().Response.Response != nil { 5870 sc = page.Response().Response.Response.StatusCode 5871 } 5872 tracing.EndSpan(ctx, sc, err) 5873 }() 5874 } 5875 for { 5876 next, err := page.fn(ctx, page.gl) 5877 if err != nil { 5878 return err 5879 } 5880 page.gl = next 5881 if !next.hasNextLink() || !next.IsEmpty() { 5882 break 5883 } 5884 } 5885 return nil 5886} 5887 5888// Next advances to the next page of values. If there was an error making 5889// the request the page does not advance and the error is returned. 5890// Deprecated: Use NextWithContext() instead. 5891func (page *GalleryListPage) Next() error { 5892 return page.NextWithContext(context.Background()) 5893} 5894 5895// NotDone returns true if the page enumeration should be started or is not yet complete. 5896func (page GalleryListPage) NotDone() bool { 5897 return !page.gl.IsEmpty() 5898} 5899 5900// Response returns the raw server response from the last page request. 5901func (page GalleryListPage) Response() GalleryList { 5902 return page.gl 5903} 5904 5905// Values returns the slice of values for the current page or nil if there are no values. 5906func (page GalleryListPage) Values() []Gallery { 5907 if page.gl.IsEmpty() { 5908 return nil 5909 } 5910 return *page.gl.Value 5911} 5912 5913// Creates a new instance of the GalleryListPage type. 5914func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 5915 return GalleryListPage{ 5916 fn: getNextPage, 5917 gl: cur, 5918 } 5919} 5920 5921// GalleryOSDiskImage this is the OS disk image. 5922type GalleryOSDiskImage struct { 5923 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 5924 SizeInGB *int32 `json:"sizeInGB,omitempty"` 5925 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 5926 HostCaching HostCaching `json:"hostCaching,omitempty"` 5927 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5928} 5929 5930// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 5931func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 5932 objectMap := make(map[string]interface{}) 5933 if godi.HostCaching != "" { 5934 objectMap["hostCaching"] = godi.HostCaching 5935 } 5936 if godi.Source != nil { 5937 objectMap["source"] = godi.Source 5938 } 5939 return json.Marshal(objectMap) 5940} 5941 5942// GalleryProperties describes the properties of a Shared Image Gallery. 5943type GalleryProperties struct { 5944 // Description - The description of this Shared Image Gallery resource. This property is updatable. 5945 Description *string `json:"description,omitempty"` 5946 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 5947 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 5948 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 5949} 5950 5951// MarshalJSON is the custom marshaler for GalleryProperties. 5952func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 5953 objectMap := make(map[string]interface{}) 5954 if gp.Description != nil { 5955 objectMap["description"] = gp.Description 5956 } 5957 if gp.Identifier != nil { 5958 objectMap["identifier"] = gp.Identifier 5959 } 5960 return json.Marshal(objectMap) 5961} 5962 5963// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 5964type GalleryUpdate struct { 5965 *GalleryProperties `json:"properties,omitempty"` 5966 // ID - READ-ONLY; Resource Id 5967 ID *string `json:"id,omitempty"` 5968 // Name - READ-ONLY; Resource name 5969 Name *string `json:"name,omitempty"` 5970 // Type - READ-ONLY; Resource type 5971 Type *string `json:"type,omitempty"` 5972 // Tags - Resource tags 5973 Tags map[string]*string `json:"tags"` 5974} 5975 5976// MarshalJSON is the custom marshaler for GalleryUpdate. 5977func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 5978 objectMap := make(map[string]interface{}) 5979 if gu.GalleryProperties != nil { 5980 objectMap["properties"] = gu.GalleryProperties 5981 } 5982 if gu.Tags != nil { 5983 objectMap["tags"] = gu.Tags 5984 } 5985 return json.Marshal(objectMap) 5986} 5987 5988// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 5989func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 5990 var m map[string]*json.RawMessage 5991 err := json.Unmarshal(body, &m) 5992 if err != nil { 5993 return err 5994 } 5995 for k, v := range m { 5996 switch k { 5997 case "properties": 5998 if v != nil { 5999 var galleryProperties GalleryProperties 6000 err = json.Unmarshal(*v, &galleryProperties) 6001 if err != nil { 6002 return err 6003 } 6004 gu.GalleryProperties = &galleryProperties 6005 } 6006 case "id": 6007 if v != nil { 6008 var ID string 6009 err = json.Unmarshal(*v, &ID) 6010 if err != nil { 6011 return err 6012 } 6013 gu.ID = &ID 6014 } 6015 case "name": 6016 if v != nil { 6017 var name string 6018 err = json.Unmarshal(*v, &name) 6019 if err != nil { 6020 return err 6021 } 6022 gu.Name = &name 6023 } 6024 case "type": 6025 if v != nil { 6026 var typeVar string 6027 err = json.Unmarshal(*v, &typeVar) 6028 if err != nil { 6029 return err 6030 } 6031 gu.Type = &typeVar 6032 } 6033 case "tags": 6034 if v != nil { 6035 var tags map[string]*string 6036 err = json.Unmarshal(*v, &tags) 6037 if err != nil { 6038 return err 6039 } 6040 gu.Tags = tags 6041 } 6042 } 6043 } 6044 6045 return nil 6046} 6047 6048// GrantAccessData data used for requesting a SAS. 6049type GrantAccessData struct { 6050 // Access - Possible values include: 'None', 'Read', 'Write' 6051 Access AccessLevel `json:"access,omitempty"` 6052 // DurationInSeconds - Time duration in seconds until the SAS access expires. 6053 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 6054} 6055 6056// HardwareProfile specifies the hardware settings for the virtual machine. 6057type HardwareProfile struct { 6058 // 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' 6059 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 6060} 6061 6062// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 6063// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 6064// exist. 6065type Image struct { 6066 autorest.Response `json:"-"` 6067 *ImageProperties `json:"properties,omitempty"` 6068 // ID - READ-ONLY; Resource Id 6069 ID *string `json:"id,omitempty"` 6070 // Name - READ-ONLY; Resource name 6071 Name *string `json:"name,omitempty"` 6072 // Type - READ-ONLY; Resource type 6073 Type *string `json:"type,omitempty"` 6074 // Location - Resource location 6075 Location *string `json:"location,omitempty"` 6076 // Tags - Resource tags 6077 Tags map[string]*string `json:"tags"` 6078} 6079 6080// MarshalJSON is the custom marshaler for Image. 6081func (i Image) MarshalJSON() ([]byte, error) { 6082 objectMap := make(map[string]interface{}) 6083 if i.ImageProperties != nil { 6084 objectMap["properties"] = i.ImageProperties 6085 } 6086 if i.Location != nil { 6087 objectMap["location"] = i.Location 6088 } 6089 if i.Tags != nil { 6090 objectMap["tags"] = i.Tags 6091 } 6092 return json.Marshal(objectMap) 6093} 6094 6095// UnmarshalJSON is the custom unmarshaler for Image struct. 6096func (i *Image) UnmarshalJSON(body []byte) error { 6097 var m map[string]*json.RawMessage 6098 err := json.Unmarshal(body, &m) 6099 if err != nil { 6100 return err 6101 } 6102 for k, v := range m { 6103 switch k { 6104 case "properties": 6105 if v != nil { 6106 var imageProperties ImageProperties 6107 err = json.Unmarshal(*v, &imageProperties) 6108 if err != nil { 6109 return err 6110 } 6111 i.ImageProperties = &imageProperties 6112 } 6113 case "id": 6114 if v != nil { 6115 var ID string 6116 err = json.Unmarshal(*v, &ID) 6117 if err != nil { 6118 return err 6119 } 6120 i.ID = &ID 6121 } 6122 case "name": 6123 if v != nil { 6124 var name string 6125 err = json.Unmarshal(*v, &name) 6126 if err != nil { 6127 return err 6128 } 6129 i.Name = &name 6130 } 6131 case "type": 6132 if v != nil { 6133 var typeVar string 6134 err = json.Unmarshal(*v, &typeVar) 6135 if err != nil { 6136 return err 6137 } 6138 i.Type = &typeVar 6139 } 6140 case "location": 6141 if v != nil { 6142 var location string 6143 err = json.Unmarshal(*v, &location) 6144 if err != nil { 6145 return err 6146 } 6147 i.Location = &location 6148 } 6149 case "tags": 6150 if v != nil { 6151 var tags map[string]*string 6152 err = json.Unmarshal(*v, &tags) 6153 if err != nil { 6154 return err 6155 } 6156 i.Tags = tags 6157 } 6158 } 6159 } 6160 6161 return nil 6162} 6163 6164// ImageDataDisk describes a data disk. 6165type ImageDataDisk struct { 6166 // 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. 6167 Lun *int32 `json:"lun,omitempty"` 6168 // Snapshot - The snapshot. 6169 Snapshot *SubResource `json:"snapshot,omitempty"` 6170 // ManagedDisk - The managedDisk. 6171 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 6172 // BlobURI - The Virtual Hard Disk. 6173 BlobURI *string `json:"blobUri,omitempty"` 6174 // 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' 6175 Caching CachingTypes `json:"caching,omitempty"` 6176 // 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 6177 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6178 // 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' 6179 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6180 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 6181 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6182} 6183 6184// ImageDisk describes a image disk. 6185type ImageDisk struct { 6186 // Snapshot - The snapshot. 6187 Snapshot *SubResource `json:"snapshot,omitempty"` 6188 // ManagedDisk - The managedDisk. 6189 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 6190 // BlobURI - The Virtual Hard Disk. 6191 BlobURI *string `json:"blobUri,omitempty"` 6192 // 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' 6193 Caching CachingTypes `json:"caching,omitempty"` 6194 // 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 6195 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6196 // 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' 6197 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6198 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 6199 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6200} 6201 6202// ImageDiskReference the source image used for creating the disk. 6203type ImageDiskReference struct { 6204 // ID - A relative uri containing either a Platform Image Repository or user image reference. 6205 ID *string `json:"id,omitempty"` 6206 // 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. 6207 Lun *int32 `json:"lun,omitempty"` 6208} 6209 6210// ImageListResult the List Image operation response. 6211type ImageListResult struct { 6212 autorest.Response `json:"-"` 6213 // Value - The list of Images. 6214 Value *[]Image `json:"value,omitempty"` 6215 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 6216 NextLink *string `json:"nextLink,omitempty"` 6217} 6218 6219// ImageListResultIterator provides access to a complete listing of Image values. 6220type ImageListResultIterator struct { 6221 i int 6222 page ImageListResultPage 6223} 6224 6225// NextWithContext advances to the next value. If there was an error making 6226// the request the iterator does not advance and the error is returned. 6227func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 6228 if tracing.IsEnabled() { 6229 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 6230 defer func() { 6231 sc := -1 6232 if iter.Response().Response.Response != nil { 6233 sc = iter.Response().Response.Response.StatusCode 6234 } 6235 tracing.EndSpan(ctx, sc, err) 6236 }() 6237 } 6238 iter.i++ 6239 if iter.i < len(iter.page.Values()) { 6240 return nil 6241 } 6242 err = iter.page.NextWithContext(ctx) 6243 if err != nil { 6244 iter.i-- 6245 return err 6246 } 6247 iter.i = 0 6248 return nil 6249} 6250 6251// Next advances to the next value. If there was an error making 6252// the request the iterator does not advance and the error is returned. 6253// Deprecated: Use NextWithContext() instead. 6254func (iter *ImageListResultIterator) Next() error { 6255 return iter.NextWithContext(context.Background()) 6256} 6257 6258// NotDone returns true if the enumeration should be started or is not yet complete. 6259func (iter ImageListResultIterator) NotDone() bool { 6260 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6261} 6262 6263// Response returns the raw server response from the last page request. 6264func (iter ImageListResultIterator) Response() ImageListResult { 6265 return iter.page.Response() 6266} 6267 6268// Value returns the current value or a zero-initialized value if the 6269// iterator has advanced beyond the end of the collection. 6270func (iter ImageListResultIterator) Value() Image { 6271 if !iter.page.NotDone() { 6272 return Image{} 6273 } 6274 return iter.page.Values()[iter.i] 6275} 6276 6277// Creates a new instance of the ImageListResultIterator type. 6278func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 6279 return ImageListResultIterator{page: page} 6280} 6281 6282// IsEmpty returns true if the ListResult contains no values. 6283func (ilr ImageListResult) IsEmpty() bool { 6284 return ilr.Value == nil || len(*ilr.Value) == 0 6285} 6286 6287// hasNextLink returns true if the NextLink is not empty. 6288func (ilr ImageListResult) hasNextLink() bool { 6289 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 6290} 6291 6292// imageListResultPreparer prepares a request to retrieve the next set of results. 6293// It returns nil if no more results exist. 6294func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 6295 if !ilr.hasNextLink() { 6296 return nil, nil 6297 } 6298 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6299 autorest.AsJSON(), 6300 autorest.AsGet(), 6301 autorest.WithBaseURL(to.String(ilr.NextLink))) 6302} 6303 6304// ImageListResultPage contains a page of Image values. 6305type ImageListResultPage struct { 6306 fn func(context.Context, ImageListResult) (ImageListResult, error) 6307 ilr ImageListResult 6308} 6309 6310// NextWithContext advances to the next page of values. If there was an error making 6311// the request the page does not advance and the error is returned. 6312func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 6313 if tracing.IsEnabled() { 6314 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 6315 defer func() { 6316 sc := -1 6317 if page.Response().Response.Response != nil { 6318 sc = page.Response().Response.Response.StatusCode 6319 } 6320 tracing.EndSpan(ctx, sc, err) 6321 }() 6322 } 6323 for { 6324 next, err := page.fn(ctx, page.ilr) 6325 if err != nil { 6326 return err 6327 } 6328 page.ilr = next 6329 if !next.hasNextLink() || !next.IsEmpty() { 6330 break 6331 } 6332 } 6333 return nil 6334} 6335 6336// Next advances to the next page of values. If there was an error making 6337// the request the page does not advance and the error is returned. 6338// Deprecated: Use NextWithContext() instead. 6339func (page *ImageListResultPage) Next() error { 6340 return page.NextWithContext(context.Background()) 6341} 6342 6343// NotDone returns true if the page enumeration should be started or is not yet complete. 6344func (page ImageListResultPage) NotDone() bool { 6345 return !page.ilr.IsEmpty() 6346} 6347 6348// Response returns the raw server response from the last page request. 6349func (page ImageListResultPage) Response() ImageListResult { 6350 return page.ilr 6351} 6352 6353// Values returns the slice of values for the current page or nil if there are no values. 6354func (page ImageListResultPage) Values() []Image { 6355 if page.ilr.IsEmpty() { 6356 return nil 6357 } 6358 return *page.ilr.Value 6359} 6360 6361// Creates a new instance of the ImageListResultPage type. 6362func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 6363 return ImageListResultPage{ 6364 fn: getNextPage, 6365 ilr: cur, 6366 } 6367} 6368 6369// ImageOSDisk describes an Operating System disk. 6370type ImageOSDisk struct { 6371 // 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' 6372 OsType OperatingSystemTypes `json:"osType,omitempty"` 6373 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 6374 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 6375 // Snapshot - The snapshot. 6376 Snapshot *SubResource `json:"snapshot,omitempty"` 6377 // ManagedDisk - The managedDisk. 6378 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 6379 // BlobURI - The Virtual Hard Disk. 6380 BlobURI *string `json:"blobUri,omitempty"` 6381 // 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' 6382 Caching CachingTypes `json:"caching,omitempty"` 6383 // 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 6384 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6385 // 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' 6386 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6387 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 6388 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6389} 6390 6391// ImageProperties describes the properties of an Image. 6392type ImageProperties struct { 6393 // SourceVirtualMachine - The source virtual machine from which Image is created. 6394 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 6395 // StorageProfile - Specifies the storage settings for the virtual machine disks. 6396 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 6397 // ProvisioningState - READ-ONLY; The provisioning state. 6398 ProvisioningState *string `json:"provisioningState,omitempty"` 6399 // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 6400 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 6401} 6402 6403// MarshalJSON is the custom marshaler for ImageProperties. 6404func (IP ImageProperties) MarshalJSON() ([]byte, error) { 6405 objectMap := make(map[string]interface{}) 6406 if IP.SourceVirtualMachine != nil { 6407 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 6408 } 6409 if IP.StorageProfile != nil { 6410 objectMap["storageProfile"] = IP.StorageProfile 6411 } 6412 if IP.HyperVGeneration != "" { 6413 objectMap["hyperVGeneration"] = IP.HyperVGeneration 6414 } 6415 return json.Marshal(objectMap) 6416} 6417 6418// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace 6419// images. 6420type ImagePurchasePlan struct { 6421 // Name - The plan ID. 6422 Name *string `json:"name,omitempty"` 6423 // Publisher - The publisher ID. 6424 Publisher *string `json:"publisher,omitempty"` 6425 // Product - The product ID. 6426 Product *string `json:"product,omitempty"` 6427} 6428 6429// ImageReference specifies information about the image to use. You can specify information about platform 6430// images, marketplace images, or virtual machine images. This element is required when you want to use a 6431// platform image, marketplace image, or virtual machine image, but is not used in other creation 6432// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 6433type ImageReference struct { 6434 // Publisher - The image publisher. 6435 Publisher *string `json:"publisher,omitempty"` 6436 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 6437 Offer *string `json:"offer,omitempty"` 6438 // Sku - The image SKU. 6439 Sku *string `json:"sku,omitempty"` 6440 // 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. 6441 Version *string `json:"version,omitempty"` 6442 // 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'. 6443 ExactVersion *string `json:"exactVersion,omitempty"` 6444 // ID - Resource Id 6445 ID *string `json:"id,omitempty"` 6446} 6447 6448// MarshalJSON is the custom marshaler for ImageReference. 6449func (ir ImageReference) MarshalJSON() ([]byte, error) { 6450 objectMap := make(map[string]interface{}) 6451 if ir.Publisher != nil { 6452 objectMap["publisher"] = ir.Publisher 6453 } 6454 if ir.Offer != nil { 6455 objectMap["offer"] = ir.Offer 6456 } 6457 if ir.Sku != nil { 6458 objectMap["sku"] = ir.Sku 6459 } 6460 if ir.Version != nil { 6461 objectMap["version"] = ir.Version 6462 } 6463 if ir.ID != nil { 6464 objectMap["id"] = ir.ID 6465 } 6466 return json.Marshal(objectMap) 6467} 6468 6469// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6470// operation. 6471type ImagesCreateOrUpdateFuture struct { 6472 azure.FutureAPI 6473 // Result returns the result of the asynchronous operation. 6474 // If the operation has not completed it will return an error. 6475 Result func(ImagesClient) (Image, error) 6476} 6477 6478// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6479func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6480 var azFuture azure.Future 6481 if err := json.Unmarshal(body, &azFuture); err != nil { 6482 return err 6483 } 6484 future.FutureAPI = &azFuture 6485 future.Result = future.result 6486 return nil 6487} 6488 6489// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 6490func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 6491 var done bool 6492 done, err = future.DoneWithContext(context.Background(), client) 6493 if err != nil { 6494 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6495 return 6496 } 6497 if !done { 6498 i.Response.Response = future.Response() 6499 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 6500 return 6501 } 6502 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6503 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 6504 i, err = client.CreateOrUpdateResponder(i.Response.Response) 6505 if err != nil { 6506 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 6507 } 6508 } 6509 return 6510} 6511 6512// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 6513type ImagesDeleteFuture struct { 6514 azure.FutureAPI 6515 // Result returns the result of the asynchronous operation. 6516 // If the operation has not completed it will return an error. 6517 Result func(ImagesClient) (autorest.Response, error) 6518} 6519 6520// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6521func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 6522 var azFuture azure.Future 6523 if err := json.Unmarshal(body, &azFuture); err != nil { 6524 return err 6525 } 6526 future.FutureAPI = &azFuture 6527 future.Result = future.result 6528 return nil 6529} 6530 6531// result is the default implementation for ImagesDeleteFuture.Result. 6532func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 6533 var done bool 6534 done, err = future.DoneWithContext(context.Background(), client) 6535 if err != nil { 6536 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 6537 return 6538 } 6539 if !done { 6540 ar.Response = future.Response() 6541 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 6542 return 6543 } 6544 ar.Response = future.Response() 6545 return 6546} 6547 6548// ImageStorageProfile describes a storage profile. 6549type ImageStorageProfile struct { 6550 // 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). 6551 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 6552 // 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). 6553 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 6554 // 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). 6555 ZoneResilient *bool `json:"zoneResilient,omitempty"` 6556} 6557 6558// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 6559type ImagesUpdateFuture struct { 6560 azure.FutureAPI 6561 // Result returns the result of the asynchronous operation. 6562 // If the operation has not completed it will return an error. 6563 Result func(ImagesClient) (Image, error) 6564} 6565 6566// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6567func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 6568 var azFuture azure.Future 6569 if err := json.Unmarshal(body, &azFuture); err != nil { 6570 return err 6571 } 6572 future.FutureAPI = &azFuture 6573 future.Result = future.result 6574 return nil 6575} 6576 6577// result is the default implementation for ImagesUpdateFuture.Result. 6578func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 6579 var done bool 6580 done, err = future.DoneWithContext(context.Background(), client) 6581 if err != nil { 6582 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 6583 return 6584 } 6585 if !done { 6586 i.Response.Response = future.Response() 6587 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 6588 return 6589 } 6590 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6591 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 6592 i, err = client.UpdateResponder(i.Response.Response) 6593 if err != nil { 6594 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 6595 } 6596 } 6597 return 6598} 6599 6600// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 6601type ImageUpdate struct { 6602 *ImageProperties `json:"properties,omitempty"` 6603 // Tags - Resource tags 6604 Tags map[string]*string `json:"tags"` 6605} 6606 6607// MarshalJSON is the custom marshaler for ImageUpdate. 6608func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 6609 objectMap := make(map[string]interface{}) 6610 if iu.ImageProperties != nil { 6611 objectMap["properties"] = iu.ImageProperties 6612 } 6613 if iu.Tags != nil { 6614 objectMap["tags"] = iu.Tags 6615 } 6616 return json.Marshal(objectMap) 6617} 6618 6619// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 6620func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 6621 var m map[string]*json.RawMessage 6622 err := json.Unmarshal(body, &m) 6623 if err != nil { 6624 return err 6625 } 6626 for k, v := range m { 6627 switch k { 6628 case "properties": 6629 if v != nil { 6630 var imageProperties ImageProperties 6631 err = json.Unmarshal(*v, &imageProperties) 6632 if err != nil { 6633 return err 6634 } 6635 iu.ImageProperties = &imageProperties 6636 } 6637 case "tags": 6638 if v != nil { 6639 var tags map[string]*string 6640 err = json.Unmarshal(*v, &tags) 6641 if err != nil { 6642 return err 6643 } 6644 iu.Tags = tags 6645 } 6646 } 6647 } 6648 6649 return nil 6650} 6651 6652// InnerError inner error details. 6653type InnerError struct { 6654 // Exceptiontype - The exception type. 6655 Exceptiontype *string `json:"exceptiontype,omitempty"` 6656 // Errordetail - The internal error message or exception dump. 6657 Errordetail *string `json:"errordetail,omitempty"` 6658} 6659 6660// InstanceViewStatus instance view status. 6661type InstanceViewStatus struct { 6662 // Code - The status code. 6663 Code *string `json:"code,omitempty"` 6664 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 6665 Level StatusLevelTypes `json:"level,omitempty"` 6666 // DisplayStatus - The short localizable label for the status. 6667 DisplayStatus *string `json:"displayStatus,omitempty"` 6668 // Message - The detailed status message, including for alerts and error messages. 6669 Message *string `json:"message,omitempty"` 6670 // Time - The time of the status. 6671 Time *date.Time `json:"time,omitempty"` 6672} 6673 6674// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 6675// to unwrap the encryptionKey 6676type KeyVaultAndKeyReference struct { 6677 // SourceVault - Resource id of the KeyVault containing the key or secret 6678 SourceVault *SourceVault `json:"sourceVault,omitempty"` 6679 // KeyURL - Url pointing to a key or secret in KeyVault 6680 KeyURL *string `json:"keyUrl,omitempty"` 6681} 6682 6683// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 6684type KeyVaultAndSecretReference struct { 6685 // SourceVault - Resource id of the KeyVault containing the key or secret 6686 SourceVault *SourceVault `json:"sourceVault,omitempty"` 6687 // SecretURL - Url pointing to a key or secret in KeyVault 6688 SecretURL *string `json:"secretUrl,omitempty"` 6689} 6690 6691// KeyVaultKeyReference describes a reference to Key Vault Key 6692type KeyVaultKeyReference struct { 6693 // KeyURL - The URL referencing a key encryption key in Key Vault. 6694 KeyURL *string `json:"keyUrl,omitempty"` 6695 // SourceVault - The relative URL of the Key Vault containing the key. 6696 SourceVault *SubResource `json:"sourceVault,omitempty"` 6697} 6698 6699// KeyVaultSecretReference describes a reference to Key Vault Secret 6700type KeyVaultSecretReference struct { 6701 // SecretURL - The URL referencing a secret in a Key Vault. 6702 SecretURL *string `json:"secretUrl,omitempty"` 6703 // SourceVault - The relative URL of the Key Vault containing the secret. 6704 SourceVault *SubResource `json:"sourceVault,omitempty"` 6705} 6706 6707// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 6708// list of supported Linux distributions, see [Linux on Azure-Endorsed 6709// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 6710// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 6711// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 6712type LinuxConfiguration struct { 6713 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 6714 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 6715 // SSH - Specifies the ssh key configuration for a Linux OS. 6716 SSH *SSHConfiguration `json:"ssh,omitempty"` 6717 // 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. 6718 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 6719} 6720 6721// ListUsagesResult the List Usages operation response. 6722type ListUsagesResult struct { 6723 autorest.Response `json:"-"` 6724 // Value - The list of compute resource usages. 6725 Value *[]Usage `json:"value,omitempty"` 6726 // 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. 6727 NextLink *string `json:"nextLink,omitempty"` 6728} 6729 6730// ListUsagesResultIterator provides access to a complete listing of Usage values. 6731type ListUsagesResultIterator struct { 6732 i int 6733 page ListUsagesResultPage 6734} 6735 6736// NextWithContext advances to the next value. If there was an error making 6737// the request the iterator does not advance and the error is returned. 6738func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 6739 if tracing.IsEnabled() { 6740 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 6741 defer func() { 6742 sc := -1 6743 if iter.Response().Response.Response != nil { 6744 sc = iter.Response().Response.Response.StatusCode 6745 } 6746 tracing.EndSpan(ctx, sc, err) 6747 }() 6748 } 6749 iter.i++ 6750 if iter.i < len(iter.page.Values()) { 6751 return nil 6752 } 6753 err = iter.page.NextWithContext(ctx) 6754 if err != nil { 6755 iter.i-- 6756 return err 6757 } 6758 iter.i = 0 6759 return nil 6760} 6761 6762// Next advances to the next value. If there was an error making 6763// the request the iterator does not advance and the error is returned. 6764// Deprecated: Use NextWithContext() instead. 6765func (iter *ListUsagesResultIterator) Next() error { 6766 return iter.NextWithContext(context.Background()) 6767} 6768 6769// NotDone returns true if the enumeration should be started or is not yet complete. 6770func (iter ListUsagesResultIterator) NotDone() bool { 6771 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6772} 6773 6774// Response returns the raw server response from the last page request. 6775func (iter ListUsagesResultIterator) Response() ListUsagesResult { 6776 return iter.page.Response() 6777} 6778 6779// Value returns the current value or a zero-initialized value if the 6780// iterator has advanced beyond the end of the collection. 6781func (iter ListUsagesResultIterator) Value() Usage { 6782 if !iter.page.NotDone() { 6783 return Usage{} 6784 } 6785 return iter.page.Values()[iter.i] 6786} 6787 6788// Creates a new instance of the ListUsagesResultIterator type. 6789func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 6790 return ListUsagesResultIterator{page: page} 6791} 6792 6793// IsEmpty returns true if the ListResult contains no values. 6794func (lur ListUsagesResult) IsEmpty() bool { 6795 return lur.Value == nil || len(*lur.Value) == 0 6796} 6797 6798// hasNextLink returns true if the NextLink is not empty. 6799func (lur ListUsagesResult) hasNextLink() bool { 6800 return lur.NextLink != nil && len(*lur.NextLink) != 0 6801} 6802 6803// listUsagesResultPreparer prepares a request to retrieve the next set of results. 6804// It returns nil if no more results exist. 6805func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 6806 if !lur.hasNextLink() { 6807 return nil, nil 6808 } 6809 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6810 autorest.AsJSON(), 6811 autorest.AsGet(), 6812 autorest.WithBaseURL(to.String(lur.NextLink))) 6813} 6814 6815// ListUsagesResultPage contains a page of Usage values. 6816type ListUsagesResultPage struct { 6817 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 6818 lur ListUsagesResult 6819} 6820 6821// NextWithContext advances to the next page of values. If there was an error making 6822// the request the page does not advance and the error is returned. 6823func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 6824 if tracing.IsEnabled() { 6825 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 6826 defer func() { 6827 sc := -1 6828 if page.Response().Response.Response != nil { 6829 sc = page.Response().Response.Response.StatusCode 6830 } 6831 tracing.EndSpan(ctx, sc, err) 6832 }() 6833 } 6834 for { 6835 next, err := page.fn(ctx, page.lur) 6836 if err != nil { 6837 return err 6838 } 6839 page.lur = next 6840 if !next.hasNextLink() || !next.IsEmpty() { 6841 break 6842 } 6843 } 6844 return nil 6845} 6846 6847// Next advances to the next page of values. If there was an error making 6848// the request the page does not advance and the error is returned. 6849// Deprecated: Use NextWithContext() instead. 6850func (page *ListUsagesResultPage) Next() error { 6851 return page.NextWithContext(context.Background()) 6852} 6853 6854// NotDone returns true if the page enumeration should be started or is not yet complete. 6855func (page ListUsagesResultPage) NotDone() bool { 6856 return !page.lur.IsEmpty() 6857} 6858 6859// Response returns the raw server response from the last page request. 6860func (page ListUsagesResultPage) Response() ListUsagesResult { 6861 return page.lur 6862} 6863 6864// Values returns the slice of values for the current page or nil if there are no values. 6865func (page ListUsagesResultPage) Values() []Usage { 6866 if page.lur.IsEmpty() { 6867 return nil 6868 } 6869 return *page.lur.Value 6870} 6871 6872// Creates a new instance of the ListUsagesResultPage type. 6873func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 6874 return ListUsagesResultPage{ 6875 fn: getNextPage, 6876 lur: cur, 6877 } 6878} 6879 6880// ListVirtualMachineExtensionImage ... 6881type ListVirtualMachineExtensionImage struct { 6882 autorest.Response `json:"-"` 6883 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 6884} 6885 6886// ListVirtualMachineImageResource ... 6887type ListVirtualMachineImageResource struct { 6888 autorest.Response `json:"-"` 6889 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 6890} 6891 6892// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 6893// of a long-running operation. 6894type LogAnalyticsExportRequestRateByIntervalFuture struct { 6895 azure.FutureAPI 6896 // Result returns the result of the asynchronous operation. 6897 // If the operation has not completed it will return an error. 6898 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 6899} 6900 6901// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6902func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 6903 var azFuture azure.Future 6904 if err := json.Unmarshal(body, &azFuture); err != nil { 6905 return err 6906 } 6907 future.FutureAPI = &azFuture 6908 future.Result = future.result 6909 return nil 6910} 6911 6912// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 6913func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 6914 var done bool 6915 done, err = future.DoneWithContext(context.Background(), client) 6916 if err != nil { 6917 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 6918 return 6919 } 6920 if !done { 6921 laor.Response.Response = future.Response() 6922 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 6923 return 6924 } 6925 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6926 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 6927 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 6928 if err != nil { 6929 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 6930 } 6931 } 6932 return 6933} 6934 6935// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 6936// long-running operation. 6937type LogAnalyticsExportThrottledRequestsFuture struct { 6938 azure.FutureAPI 6939 // Result returns the result of the asynchronous operation. 6940 // If the operation has not completed it will return an error. 6941 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 6942} 6943 6944// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6945func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 6946 var azFuture azure.Future 6947 if err := json.Unmarshal(body, &azFuture); err != nil { 6948 return err 6949 } 6950 future.FutureAPI = &azFuture 6951 future.Result = future.result 6952 return nil 6953} 6954 6955// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 6956func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 6957 var done bool 6958 done, err = future.DoneWithContext(context.Background(), client) 6959 if err != nil { 6960 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 6961 return 6962 } 6963 if !done { 6964 laor.Response.Response = future.Response() 6965 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 6966 return 6967 } 6968 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6969 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 6970 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 6971 if err != nil { 6972 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 6973 } 6974 } 6975 return 6976} 6977 6978// LogAnalyticsInputBase api input base class for LogAnalytics Api. 6979type LogAnalyticsInputBase struct { 6980 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 6981 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 6982 // FromTime - From time of the query 6983 FromTime *date.Time `json:"fromTime,omitempty"` 6984 // ToTime - To time of the query 6985 ToTime *date.Time `json:"toTime,omitempty"` 6986 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 6987 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 6988 // GroupByOperationName - Group query result by Operation Name. 6989 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 6990 // GroupByResourceName - Group query result by Resource Name. 6991 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 6992} 6993 6994// LogAnalyticsOperationResult logAnalytics operation status response 6995type LogAnalyticsOperationResult struct { 6996 autorest.Response `json:"-"` 6997 // Properties - READ-ONLY; LogAnalyticsOutput 6998 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 6999} 7000 7001// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. 7002func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { 7003 objectMap := make(map[string]interface{}) 7004 return json.Marshal(objectMap) 7005} 7006 7007// LogAnalyticsOutput logAnalytics output properties 7008type LogAnalyticsOutput struct { 7009 // Output - READ-ONLY; Output file Uri path to blob container. 7010 Output *string `json:"output,omitempty"` 7011} 7012 7013// MarshalJSON is the custom marshaler for LogAnalyticsOutput. 7014func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { 7015 objectMap := make(map[string]interface{}) 7016 return json.Marshal(objectMap) 7017} 7018 7019// MaintenanceRedeployStatus maintenance Operation Status. 7020type MaintenanceRedeployStatus struct { 7021 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 7022 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 7023 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 7024 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 7025 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 7026 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 7027 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 7028 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 7029 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 7030 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 7031 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 7032 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 7033 // LastOperationMessage - Message returned for the last Maintenance Operation. 7034 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 7035} 7036 7037// ManagedArtifact the managed artifact. 7038type ManagedArtifact struct { 7039 // ID - The managed artifact id. 7040 ID *string `json:"id,omitempty"` 7041} 7042 7043// ManagedDiskParameters the parameters of a managed disk. 7044type ManagedDiskParameters struct { 7045 // 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' 7046 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 7047 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 7048 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 7049 // ID - Resource Id 7050 ID *string `json:"id,omitempty"` 7051} 7052 7053// NetworkInterfaceReference describes a network interface reference. 7054type NetworkInterfaceReference struct { 7055 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 7056 // ID - Resource Id 7057 ID *string `json:"id,omitempty"` 7058} 7059 7060// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 7061func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 7062 objectMap := make(map[string]interface{}) 7063 if nir.NetworkInterfaceReferenceProperties != nil { 7064 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 7065 } 7066 if nir.ID != nil { 7067 objectMap["id"] = nir.ID 7068 } 7069 return json.Marshal(objectMap) 7070} 7071 7072// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 7073func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 7074 var m map[string]*json.RawMessage 7075 err := json.Unmarshal(body, &m) 7076 if err != nil { 7077 return err 7078 } 7079 for k, v := range m { 7080 switch k { 7081 case "properties": 7082 if v != nil { 7083 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 7084 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 7085 if err != nil { 7086 return err 7087 } 7088 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 7089 } 7090 case "id": 7091 if v != nil { 7092 var ID string 7093 err = json.Unmarshal(*v, &ID) 7094 if err != nil { 7095 return err 7096 } 7097 nir.ID = &ID 7098 } 7099 } 7100 } 7101 7102 return nil 7103} 7104 7105// NetworkInterfaceReferenceProperties describes a network interface reference properties. 7106type NetworkInterfaceReferenceProperties struct { 7107 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 7108 Primary *bool `json:"primary,omitempty"` 7109} 7110 7111// NetworkProfile specifies the network interfaces of the virtual machine. 7112type NetworkProfile struct { 7113 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 7114 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 7115} 7116 7117// OperationListResult the List Compute Operation operation response. 7118type OperationListResult struct { 7119 autorest.Response `json:"-"` 7120 // Value - READ-ONLY; The list of compute operations 7121 Value *[]OperationValue `json:"value,omitempty"` 7122} 7123 7124// MarshalJSON is the custom marshaler for OperationListResult. 7125func (olr OperationListResult) MarshalJSON() ([]byte, error) { 7126 objectMap := make(map[string]interface{}) 7127 return json.Marshal(objectMap) 7128} 7129 7130// OperationValue describes the properties of a Compute Operation value. 7131type OperationValue struct { 7132 // Origin - READ-ONLY; The origin of the compute operation. 7133 Origin *string `json:"origin,omitempty"` 7134 // Name - READ-ONLY; The name of the compute operation. 7135 Name *string `json:"name,omitempty"` 7136 *OperationValueDisplay `json:"display,omitempty"` 7137} 7138 7139// MarshalJSON is the custom marshaler for OperationValue. 7140func (ov OperationValue) MarshalJSON() ([]byte, error) { 7141 objectMap := make(map[string]interface{}) 7142 if ov.OperationValueDisplay != nil { 7143 objectMap["display"] = ov.OperationValueDisplay 7144 } 7145 return json.Marshal(objectMap) 7146} 7147 7148// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 7149func (ov *OperationValue) UnmarshalJSON(body []byte) error { 7150 var m map[string]*json.RawMessage 7151 err := json.Unmarshal(body, &m) 7152 if err != nil { 7153 return err 7154 } 7155 for k, v := range m { 7156 switch k { 7157 case "origin": 7158 if v != nil { 7159 var origin string 7160 err = json.Unmarshal(*v, &origin) 7161 if err != nil { 7162 return err 7163 } 7164 ov.Origin = &origin 7165 } 7166 case "name": 7167 if v != nil { 7168 var name string 7169 err = json.Unmarshal(*v, &name) 7170 if err != nil { 7171 return err 7172 } 7173 ov.Name = &name 7174 } 7175 case "display": 7176 if v != nil { 7177 var operationValueDisplay OperationValueDisplay 7178 err = json.Unmarshal(*v, &operationValueDisplay) 7179 if err != nil { 7180 return err 7181 } 7182 ov.OperationValueDisplay = &operationValueDisplay 7183 } 7184 } 7185 } 7186 7187 return nil 7188} 7189 7190// OperationValueDisplay describes the properties of a Compute Operation Value Display. 7191type OperationValueDisplay struct { 7192 // Operation - READ-ONLY; The display name of the compute operation. 7193 Operation *string `json:"operation,omitempty"` 7194 // Resource - READ-ONLY; The display name of the resource the operation applies to. 7195 Resource *string `json:"resource,omitempty"` 7196 // Description - READ-ONLY; The description of the operation. 7197 Description *string `json:"description,omitempty"` 7198 // Provider - READ-ONLY; The resource provider for the operation. 7199 Provider *string `json:"provider,omitempty"` 7200} 7201 7202// MarshalJSON is the custom marshaler for OperationValueDisplay. 7203func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 7204 objectMap := make(map[string]interface{}) 7205 return json.Marshal(objectMap) 7206} 7207 7208// OrchestrationServiceStateInput the input for OrchestrationServiceState 7209type OrchestrationServiceStateInput struct { 7210 // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' 7211 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 7212 // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' 7213 Action OrchestrationServiceStateAction `json:"action,omitempty"` 7214} 7215 7216// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 7217type OrchestrationServiceSummary struct { 7218 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' 7219 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 7220 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' 7221 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 7222} 7223 7224// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. 7225func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { 7226 objectMap := make(map[string]interface{}) 7227 return json.Marshal(objectMap) 7228} 7229 7230// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 7231// more information about disks, see [About disks and VHDs for Azure virtual 7232// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 7233type OSDisk struct { 7234 // 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' 7235 OsType OperatingSystemTypes `json:"osType,omitempty"` 7236 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 7237 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 7238 // Name - The disk name. 7239 Name *string `json:"name,omitempty"` 7240 // Vhd - The virtual hard disk. 7241 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 7242 // 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. 7243 Image *VirtualHardDisk `json:"image,omitempty"` 7244 // 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' 7245 Caching CachingTypes `json:"caching,omitempty"` 7246 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 7247 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 7248 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 7249 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 7250 // 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' 7251 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 7252 // 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 7253 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7254 // ManagedDisk - The managed disk parameters. 7255 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 7256} 7257 7258// OSDiskImage contains the os disk image information. 7259type OSDiskImage struct { 7260 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 7261 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 7262} 7263 7264// OSDiskImageEncryption contains encryption settings for an OS disk image. 7265type OSDiskImageEncryption struct { 7266 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 7267 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 7268} 7269 7270// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 7271// be changed once VM is provisioned. 7272type OSProfile struct { 7273 // 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). 7274 ComputerName *string `json:"computerName,omitempty"` 7275 // 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) 7276 AdminUsername *string `json:"adminUsername,omitempty"` 7277 // 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) 7278 AdminPassword *string `json:"adminPassword,omitempty"` 7279 // 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://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <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) 7280 CustomData *string `json:"customData,omitempty"` 7281 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 7282 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 7283 // 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). 7284 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 7285 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 7286 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 7287 // 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. 7288 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 7289 // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. 7290 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 7291} 7292 7293// Plan specifies information about the marketplace image used to create the virtual machine. This element 7294// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 7295// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 7296// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 7297// then click **Save**. 7298type Plan struct { 7299 // Name - The plan ID. 7300 Name *string `json:"name,omitempty"` 7301 // Publisher - The publisher ID. 7302 Publisher *string `json:"publisher,omitempty"` 7303 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 7304 Product *string `json:"product,omitempty"` 7305 // PromotionCode - The promotion code. 7306 PromotionCode *string `json:"promotionCode,omitempty"` 7307} 7308 7309// ProximityPlacementGroup specifies information about the proximity placement group. 7310type ProximityPlacementGroup struct { 7311 autorest.Response `json:"-"` 7312 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 7313 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 7314 // ID - READ-ONLY; Resource Id 7315 ID *string `json:"id,omitempty"` 7316 // Name - READ-ONLY; Resource name 7317 Name *string `json:"name,omitempty"` 7318 // Type - READ-ONLY; Resource type 7319 Type *string `json:"type,omitempty"` 7320 // Location - Resource location 7321 Location *string `json:"location,omitempty"` 7322 // Tags - Resource tags 7323 Tags map[string]*string `json:"tags"` 7324} 7325 7326// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 7327func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 7328 objectMap := make(map[string]interface{}) 7329 if ppg.ProximityPlacementGroupProperties != nil { 7330 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 7331 } 7332 if ppg.Location != nil { 7333 objectMap["location"] = ppg.Location 7334 } 7335 if ppg.Tags != nil { 7336 objectMap["tags"] = ppg.Tags 7337 } 7338 return json.Marshal(objectMap) 7339} 7340 7341// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 7342func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 7343 var m map[string]*json.RawMessage 7344 err := json.Unmarshal(body, &m) 7345 if err != nil { 7346 return err 7347 } 7348 for k, v := range m { 7349 switch k { 7350 case "properties": 7351 if v != nil { 7352 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 7353 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 7354 if err != nil { 7355 return err 7356 } 7357 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 7358 } 7359 case "id": 7360 if v != nil { 7361 var ID string 7362 err = json.Unmarshal(*v, &ID) 7363 if err != nil { 7364 return err 7365 } 7366 ppg.ID = &ID 7367 } 7368 case "name": 7369 if v != nil { 7370 var name string 7371 err = json.Unmarshal(*v, &name) 7372 if err != nil { 7373 return err 7374 } 7375 ppg.Name = &name 7376 } 7377 case "type": 7378 if v != nil { 7379 var typeVar string 7380 err = json.Unmarshal(*v, &typeVar) 7381 if err != nil { 7382 return err 7383 } 7384 ppg.Type = &typeVar 7385 } 7386 case "location": 7387 if v != nil { 7388 var location string 7389 err = json.Unmarshal(*v, &location) 7390 if err != nil { 7391 return err 7392 } 7393 ppg.Location = &location 7394 } 7395 case "tags": 7396 if v != nil { 7397 var tags map[string]*string 7398 err = json.Unmarshal(*v, &tags) 7399 if err != nil { 7400 return err 7401 } 7402 ppg.Tags = tags 7403 } 7404 } 7405 } 7406 7407 return nil 7408} 7409 7410// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 7411type ProximityPlacementGroupListResult struct { 7412 autorest.Response `json:"-"` 7413 // Value - The list of proximity placement groups 7414 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 7415 // NextLink - The URI to fetch the next page of proximity placement groups. 7416 NextLink *string `json:"nextLink,omitempty"` 7417} 7418 7419// ProximityPlacementGroupListResultIterator provides access to a complete listing of 7420// ProximityPlacementGroup values. 7421type ProximityPlacementGroupListResultIterator struct { 7422 i int 7423 page ProximityPlacementGroupListResultPage 7424} 7425 7426// NextWithContext advances to the next value. If there was an error making 7427// the request the iterator does not advance and the error is returned. 7428func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 7429 if tracing.IsEnabled() { 7430 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 7431 defer func() { 7432 sc := -1 7433 if iter.Response().Response.Response != nil { 7434 sc = iter.Response().Response.Response.StatusCode 7435 } 7436 tracing.EndSpan(ctx, sc, err) 7437 }() 7438 } 7439 iter.i++ 7440 if iter.i < len(iter.page.Values()) { 7441 return nil 7442 } 7443 err = iter.page.NextWithContext(ctx) 7444 if err != nil { 7445 iter.i-- 7446 return err 7447 } 7448 iter.i = 0 7449 return nil 7450} 7451 7452// Next advances to the next value. If there was an error making 7453// the request the iterator does not advance and the error is returned. 7454// Deprecated: Use NextWithContext() instead. 7455func (iter *ProximityPlacementGroupListResultIterator) Next() error { 7456 return iter.NextWithContext(context.Background()) 7457} 7458 7459// NotDone returns true if the enumeration should be started or is not yet complete. 7460func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 7461 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7462} 7463 7464// Response returns the raw server response from the last page request. 7465func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 7466 return iter.page.Response() 7467} 7468 7469// Value returns the current value or a zero-initialized value if the 7470// iterator has advanced beyond the end of the collection. 7471func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 7472 if !iter.page.NotDone() { 7473 return ProximityPlacementGroup{} 7474 } 7475 return iter.page.Values()[iter.i] 7476} 7477 7478// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 7479func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 7480 return ProximityPlacementGroupListResultIterator{page: page} 7481} 7482 7483// IsEmpty returns true if the ListResult contains no values. 7484func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 7485 return ppglr.Value == nil || len(*ppglr.Value) == 0 7486} 7487 7488// hasNextLink returns true if the NextLink is not empty. 7489func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 7490 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 7491} 7492 7493// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 7494// It returns nil if no more results exist. 7495func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 7496 if !ppglr.hasNextLink() { 7497 return nil, nil 7498 } 7499 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7500 autorest.AsJSON(), 7501 autorest.AsGet(), 7502 autorest.WithBaseURL(to.String(ppglr.NextLink))) 7503} 7504 7505// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 7506type ProximityPlacementGroupListResultPage struct { 7507 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 7508 ppglr ProximityPlacementGroupListResult 7509} 7510 7511// NextWithContext advances to the next page of values. If there was an error making 7512// the request the page does not advance and the error is returned. 7513func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 7514 if tracing.IsEnabled() { 7515 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 7516 defer func() { 7517 sc := -1 7518 if page.Response().Response.Response != nil { 7519 sc = page.Response().Response.Response.StatusCode 7520 } 7521 tracing.EndSpan(ctx, sc, err) 7522 }() 7523 } 7524 for { 7525 next, err := page.fn(ctx, page.ppglr) 7526 if err != nil { 7527 return err 7528 } 7529 page.ppglr = next 7530 if !next.hasNextLink() || !next.IsEmpty() { 7531 break 7532 } 7533 } 7534 return nil 7535} 7536 7537// Next advances to the next page of values. If there was an error making 7538// the request the page does not advance and the error is returned. 7539// Deprecated: Use NextWithContext() instead. 7540func (page *ProximityPlacementGroupListResultPage) Next() error { 7541 return page.NextWithContext(context.Background()) 7542} 7543 7544// NotDone returns true if the page enumeration should be started or is not yet complete. 7545func (page ProximityPlacementGroupListResultPage) NotDone() bool { 7546 return !page.ppglr.IsEmpty() 7547} 7548 7549// Response returns the raw server response from the last page request. 7550func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 7551 return page.ppglr 7552} 7553 7554// Values returns the slice of values for the current page or nil if there are no values. 7555func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 7556 if page.ppglr.IsEmpty() { 7557 return nil 7558 } 7559 return *page.ppglr.Value 7560} 7561 7562// Creates a new instance of the ProximityPlacementGroupListResultPage type. 7563func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 7564 return ProximityPlacementGroupListResultPage{ 7565 fn: getNextPage, 7566 ppglr: cur, 7567 } 7568} 7569 7570// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 7571type ProximityPlacementGroupProperties struct { 7572 // 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' 7573 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 7574 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 7575 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 7576 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 7577 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 7578 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 7579 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 7580 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 7581 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 7582} 7583 7584// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 7585func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 7586 objectMap := make(map[string]interface{}) 7587 if ppgp.ProximityPlacementGroupType != "" { 7588 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 7589 } 7590 if ppgp.ColocationStatus != nil { 7591 objectMap["colocationStatus"] = ppgp.ColocationStatus 7592 } 7593 return json.Marshal(objectMap) 7594} 7595 7596// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 7597type ProximityPlacementGroupUpdate struct { 7598 // Tags - Resource tags 7599 Tags map[string]*string `json:"tags"` 7600} 7601 7602// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 7603func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 7604 objectMap := make(map[string]interface{}) 7605 if ppgu.Tags != nil { 7606 objectMap["tags"] = ppgu.Tags 7607 } 7608 return json.Marshal(objectMap) 7609} 7610 7611// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 7612type PurchasePlan struct { 7613 // Publisher - The publisher ID. 7614 Publisher *string `json:"publisher,omitempty"` 7615 // Name - The plan ID. 7616 Name *string `json:"name,omitempty"` 7617 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 7618 Product *string `json:"product,omitempty"` 7619} 7620 7621// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 7622// Image Definition. These properties are updatable. 7623type RecommendedMachineConfiguration struct { 7624 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 7625 Memory *ResourceRange `json:"memory,omitempty"` 7626} 7627 7628// RecoveryWalkResponse response after calling a manual recovery walk 7629type RecoveryWalkResponse struct { 7630 autorest.Response `json:"-"` 7631 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 7632 WalkPerformed *bool `json:"walkPerformed,omitempty"` 7633 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 7634 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 7635} 7636 7637// MarshalJSON is the custom marshaler for RecoveryWalkResponse. 7638func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { 7639 objectMap := make(map[string]interface{}) 7640 return json.Marshal(objectMap) 7641} 7642 7643// RegionalReplicationStatus this is the regional replication status. 7644type RegionalReplicationStatus struct { 7645 // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. 7646 Region *string `json:"region,omitempty"` 7647 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 7648 State ReplicationState `json:"state,omitempty"` 7649 // Details - READ-ONLY; The details of the replication status. 7650 Details *string `json:"details,omitempty"` 7651 // Progress - READ-ONLY; It indicates progress of the replication job. 7652 Progress *int32 `json:"progress,omitempty"` 7653} 7654 7655// MarshalJSON is the custom marshaler for RegionalReplicationStatus. 7656func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { 7657 objectMap := make(map[string]interface{}) 7658 return json.Marshal(objectMap) 7659} 7660 7661// ReplicationStatus this is the replication status of the gallery Image Version. 7662type ReplicationStatus struct { 7663 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' 7664 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 7665 // Summary - READ-ONLY; This is a summary of replication status for each region. 7666 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 7667} 7668 7669// MarshalJSON is the custom marshaler for ReplicationStatus. 7670func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { 7671 objectMap := make(map[string]interface{}) 7672 return json.Marshal(objectMap) 7673} 7674 7675// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 7676type RequestRateByIntervalInput struct { 7677 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 7678 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 7679 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 7680 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 7681 // FromTime - From time of the query 7682 FromTime *date.Time `json:"fromTime,omitempty"` 7683 // ToTime - To time of the query 7684 ToTime *date.Time `json:"toTime,omitempty"` 7685 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 7686 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 7687 // GroupByOperationName - Group query result by Operation Name. 7688 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 7689 // GroupByResourceName - Group query result by Resource Name. 7690 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 7691} 7692 7693// Resource the Resource model definition. 7694type Resource struct { 7695 // ID - READ-ONLY; Resource Id 7696 ID *string `json:"id,omitempty"` 7697 // Name - READ-ONLY; Resource name 7698 Name *string `json:"name,omitempty"` 7699 // Type - READ-ONLY; Resource type 7700 Type *string `json:"type,omitempty"` 7701 // Location - Resource location 7702 Location *string `json:"location,omitempty"` 7703 // Tags - Resource tags 7704 Tags map[string]*string `json:"tags"` 7705} 7706 7707// MarshalJSON is the custom marshaler for Resource. 7708func (r Resource) MarshalJSON() ([]byte, error) { 7709 objectMap := make(map[string]interface{}) 7710 if r.Location != nil { 7711 objectMap["location"] = r.Location 7712 } 7713 if r.Tags != nil { 7714 objectMap["tags"] = r.Tags 7715 } 7716 return json.Marshal(objectMap) 7717} 7718 7719// ResourceRange describes the resource range. 7720type ResourceRange struct { 7721 // Min - The minimum number of the resource. 7722 Min *int32 `json:"min,omitempty"` 7723 // Max - The maximum number of the resource. 7724 Max *int32 `json:"max,omitempty"` 7725} 7726 7727// ResourceSku describes an available Compute SKU. 7728type ResourceSku struct { 7729 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 7730 ResourceType *string `json:"resourceType,omitempty"` 7731 // Name - READ-ONLY; The name of SKU. 7732 Name *string `json:"name,omitempty"` 7733 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 7734 Tier *string `json:"tier,omitempty"` 7735 // Size - READ-ONLY; The Size of the SKU. 7736 Size *string `json:"size,omitempty"` 7737 // Family - READ-ONLY; The Family of this particular SKU. 7738 Family *string `json:"family,omitempty"` 7739 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 7740 Kind *string `json:"kind,omitempty"` 7741 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 7742 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 7743 // Locations - READ-ONLY; The set of locations that the SKU is available. 7744 Locations *[]string `json:"locations,omitempty"` 7745 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 7746 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 7747 // APIVersions - READ-ONLY; The api versions that support this SKU. 7748 APIVersions *[]string `json:"apiVersions,omitempty"` 7749 // Costs - READ-ONLY; Metadata for retrieving price info. 7750 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 7751 // Capabilities - READ-ONLY; A name value pair to describe the capability. 7752 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 7753 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 7754 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 7755} 7756 7757// MarshalJSON is the custom marshaler for ResourceSku. 7758func (rs ResourceSku) MarshalJSON() ([]byte, error) { 7759 objectMap := make(map[string]interface{}) 7760 return json.Marshal(objectMap) 7761} 7762 7763// ResourceSkuCapabilities describes The SKU capabilities object. 7764type ResourceSkuCapabilities struct { 7765 // Name - READ-ONLY; An invariant to describe the feature. 7766 Name *string `json:"name,omitempty"` 7767 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 7768 Value *string `json:"value,omitempty"` 7769} 7770 7771// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. 7772func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { 7773 objectMap := make(map[string]interface{}) 7774 return json.Marshal(objectMap) 7775} 7776 7777// ResourceSkuCapacity describes scaling information of a SKU. 7778type ResourceSkuCapacity struct { 7779 // Minimum - READ-ONLY; The minimum capacity. 7780 Minimum *int64 `json:"minimum,omitempty"` 7781 // Maximum - READ-ONLY; The maximum capacity that can be set. 7782 Maximum *int64 `json:"maximum,omitempty"` 7783 // Default - READ-ONLY; The default capacity. 7784 Default *int64 `json:"default,omitempty"` 7785 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 7786 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 7787} 7788 7789// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 7790func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 7791 objectMap := make(map[string]interface{}) 7792 return json.Marshal(objectMap) 7793} 7794 7795// ResourceSkuCosts describes metadata for retrieving price info. 7796type ResourceSkuCosts struct { 7797 // MeterID - READ-ONLY; Used for querying price from commerce. 7798 MeterID *string `json:"meterID,omitempty"` 7799 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 7800 Quantity *int64 `json:"quantity,omitempty"` 7801 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 7802 ExtendedUnit *string `json:"extendedUnit,omitempty"` 7803} 7804 7805// MarshalJSON is the custom marshaler for ResourceSkuCosts. 7806func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { 7807 objectMap := make(map[string]interface{}) 7808 return json.Marshal(objectMap) 7809} 7810 7811// ResourceSkuLocationInfo ... 7812type ResourceSkuLocationInfo struct { 7813 // Location - READ-ONLY; Location of the SKU 7814 Location *string `json:"location,omitempty"` 7815 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 7816 Zones *[]string `json:"zones,omitempty"` 7817 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 7818 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 7819} 7820 7821// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. 7822func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { 7823 objectMap := make(map[string]interface{}) 7824 return json.Marshal(objectMap) 7825} 7826 7827// ResourceSkuRestrictionInfo ... 7828type ResourceSkuRestrictionInfo struct { 7829 // Locations - READ-ONLY; Locations where the SKU is restricted 7830 Locations *[]string `json:"locations,omitempty"` 7831 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 7832 Zones *[]string `json:"zones,omitempty"` 7833} 7834 7835// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. 7836func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { 7837 objectMap := make(map[string]interface{}) 7838 return json.Marshal(objectMap) 7839} 7840 7841// ResourceSkuRestrictions describes scaling information of a SKU. 7842type ResourceSkuRestrictions struct { 7843 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 7844 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 7845 // 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. 7846 Values *[]string `json:"values,omitempty"` 7847 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 7848 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 7849 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 7850 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 7851} 7852 7853// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. 7854func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { 7855 objectMap := make(map[string]interface{}) 7856 return json.Marshal(objectMap) 7857} 7858 7859// ResourceSkusResult the List Resource Skus operation response. 7860type ResourceSkusResult struct { 7861 autorest.Response `json:"-"` 7862 // Value - The list of skus available for the subscription. 7863 Value *[]ResourceSku `json:"value,omitempty"` 7864 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 7865 NextLink *string `json:"nextLink,omitempty"` 7866} 7867 7868// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 7869type ResourceSkusResultIterator struct { 7870 i int 7871 page ResourceSkusResultPage 7872} 7873 7874// NextWithContext advances to the next value. If there was an error making 7875// the request the iterator does not advance and the error is returned. 7876func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 7877 if tracing.IsEnabled() { 7878 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 7879 defer func() { 7880 sc := -1 7881 if iter.Response().Response.Response != nil { 7882 sc = iter.Response().Response.Response.StatusCode 7883 } 7884 tracing.EndSpan(ctx, sc, err) 7885 }() 7886 } 7887 iter.i++ 7888 if iter.i < len(iter.page.Values()) { 7889 return nil 7890 } 7891 err = iter.page.NextWithContext(ctx) 7892 if err != nil { 7893 iter.i-- 7894 return err 7895 } 7896 iter.i = 0 7897 return nil 7898} 7899 7900// Next advances to the next value. If there was an error making 7901// the request the iterator does not advance and the error is returned. 7902// Deprecated: Use NextWithContext() instead. 7903func (iter *ResourceSkusResultIterator) Next() error { 7904 return iter.NextWithContext(context.Background()) 7905} 7906 7907// NotDone returns true if the enumeration should be started or is not yet complete. 7908func (iter ResourceSkusResultIterator) NotDone() bool { 7909 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7910} 7911 7912// Response returns the raw server response from the last page request. 7913func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 7914 return iter.page.Response() 7915} 7916 7917// Value returns the current value or a zero-initialized value if the 7918// iterator has advanced beyond the end of the collection. 7919func (iter ResourceSkusResultIterator) Value() ResourceSku { 7920 if !iter.page.NotDone() { 7921 return ResourceSku{} 7922 } 7923 return iter.page.Values()[iter.i] 7924} 7925 7926// Creates a new instance of the ResourceSkusResultIterator type. 7927func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 7928 return ResourceSkusResultIterator{page: page} 7929} 7930 7931// IsEmpty returns true if the ListResult contains no values. 7932func (rsr ResourceSkusResult) IsEmpty() bool { 7933 return rsr.Value == nil || len(*rsr.Value) == 0 7934} 7935 7936// hasNextLink returns true if the NextLink is not empty. 7937func (rsr ResourceSkusResult) hasNextLink() bool { 7938 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 7939} 7940 7941// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 7942// It returns nil if no more results exist. 7943func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 7944 if !rsr.hasNextLink() { 7945 return nil, nil 7946 } 7947 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7948 autorest.AsJSON(), 7949 autorest.AsGet(), 7950 autorest.WithBaseURL(to.String(rsr.NextLink))) 7951} 7952 7953// ResourceSkusResultPage contains a page of ResourceSku values. 7954type ResourceSkusResultPage struct { 7955 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 7956 rsr ResourceSkusResult 7957} 7958 7959// NextWithContext advances to the next page of values. If there was an error making 7960// the request the page does not advance and the error is returned. 7961func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 7962 if tracing.IsEnabled() { 7963 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 7964 defer func() { 7965 sc := -1 7966 if page.Response().Response.Response != nil { 7967 sc = page.Response().Response.Response.StatusCode 7968 } 7969 tracing.EndSpan(ctx, sc, err) 7970 }() 7971 } 7972 for { 7973 next, err := page.fn(ctx, page.rsr) 7974 if err != nil { 7975 return err 7976 } 7977 page.rsr = next 7978 if !next.hasNextLink() || !next.IsEmpty() { 7979 break 7980 } 7981 } 7982 return nil 7983} 7984 7985// Next advances to the next page of values. If there was an error making 7986// the request the page does not advance and the error is returned. 7987// Deprecated: Use NextWithContext() instead. 7988func (page *ResourceSkusResultPage) Next() error { 7989 return page.NextWithContext(context.Background()) 7990} 7991 7992// NotDone returns true if the page enumeration should be started or is not yet complete. 7993func (page ResourceSkusResultPage) NotDone() bool { 7994 return !page.rsr.IsEmpty() 7995} 7996 7997// Response returns the raw server response from the last page request. 7998func (page ResourceSkusResultPage) Response() ResourceSkusResult { 7999 return page.rsr 8000} 8001 8002// Values returns the slice of values for the current page or nil if there are no values. 8003func (page ResourceSkusResultPage) Values() []ResourceSku { 8004 if page.rsr.IsEmpty() { 8005 return nil 8006 } 8007 return *page.rsr.Value 8008} 8009 8010// Creates a new instance of the ResourceSkusResultPage type. 8011func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 8012 return ResourceSkusResultPage{ 8013 fn: getNextPage, 8014 rsr: cur, 8015 } 8016} 8017 8018// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 8019type ResourceSkuZoneDetails struct { 8020 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 8021 Name *[]string `json:"name,omitempty"` 8022 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 8023 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 8024} 8025 8026// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. 8027func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { 8028 objectMap := make(map[string]interface{}) 8029 return json.Marshal(objectMap) 8030} 8031 8032// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 8033type RollbackStatusInfo struct { 8034 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 8035 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 8036 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 8037 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 8038 // RollbackError - READ-ONLY; Error details if OS rollback failed. 8039 RollbackError *APIError `json:"rollbackError,omitempty"` 8040} 8041 8042// MarshalJSON is the custom marshaler for RollbackStatusInfo. 8043func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { 8044 objectMap := make(map[string]interface{}) 8045 return json.Marshal(objectMap) 8046} 8047 8048// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 8049type RollingUpgradePolicy struct { 8050 // 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%. 8051 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 8052 // 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%. 8053 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 8054 // 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%. 8055 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 8056 // 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). 8057 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 8058} 8059 8060// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 8061// state. 8062type RollingUpgradeProgressInfo struct { 8063 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 8064 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 8065 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 8066 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 8067 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 8068 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 8069 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 8070 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 8071} 8072 8073// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. 8074func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { 8075 objectMap := make(map[string]interface{}) 8076 return json.Marshal(objectMap) 8077} 8078 8079// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 8080type RollingUpgradeRunningStatus struct { 8081 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 8082 Code RollingUpgradeStatusCode `json:"code,omitempty"` 8083 // StartTime - READ-ONLY; Start time of the upgrade. 8084 StartTime *date.Time `json:"startTime,omitempty"` 8085 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 8086 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 8087 // LastActionTime - READ-ONLY; Last action time of the upgrade. 8088 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 8089} 8090 8091// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. 8092func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { 8093 objectMap := make(map[string]interface{}) 8094 return json.Marshal(objectMap) 8095} 8096 8097// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 8098type RollingUpgradeStatusInfo struct { 8099 autorest.Response `json:"-"` 8100 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 8101 // ID - READ-ONLY; Resource Id 8102 ID *string `json:"id,omitempty"` 8103 // Name - READ-ONLY; Resource name 8104 Name *string `json:"name,omitempty"` 8105 // Type - READ-ONLY; Resource type 8106 Type *string `json:"type,omitempty"` 8107 // Location - Resource location 8108 Location *string `json:"location,omitempty"` 8109 // Tags - Resource tags 8110 Tags map[string]*string `json:"tags"` 8111} 8112 8113// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 8114func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 8115 objectMap := make(map[string]interface{}) 8116 if rusi.RollingUpgradeStatusInfoProperties != nil { 8117 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 8118 } 8119 if rusi.Location != nil { 8120 objectMap["location"] = rusi.Location 8121 } 8122 if rusi.Tags != nil { 8123 objectMap["tags"] = rusi.Tags 8124 } 8125 return json.Marshal(objectMap) 8126} 8127 8128// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 8129func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 8130 var m map[string]*json.RawMessage 8131 err := json.Unmarshal(body, &m) 8132 if err != nil { 8133 return err 8134 } 8135 for k, v := range m { 8136 switch k { 8137 case "properties": 8138 if v != nil { 8139 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 8140 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 8141 if err != nil { 8142 return err 8143 } 8144 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 8145 } 8146 case "id": 8147 if v != nil { 8148 var ID string 8149 err = json.Unmarshal(*v, &ID) 8150 if err != nil { 8151 return err 8152 } 8153 rusi.ID = &ID 8154 } 8155 case "name": 8156 if v != nil { 8157 var name string 8158 err = json.Unmarshal(*v, &name) 8159 if err != nil { 8160 return err 8161 } 8162 rusi.Name = &name 8163 } 8164 case "type": 8165 if v != nil { 8166 var typeVar string 8167 err = json.Unmarshal(*v, &typeVar) 8168 if err != nil { 8169 return err 8170 } 8171 rusi.Type = &typeVar 8172 } 8173 case "location": 8174 if v != nil { 8175 var location string 8176 err = json.Unmarshal(*v, &location) 8177 if err != nil { 8178 return err 8179 } 8180 rusi.Location = &location 8181 } 8182 case "tags": 8183 if v != nil { 8184 var tags map[string]*string 8185 err = json.Unmarshal(*v, &tags) 8186 if err != nil { 8187 return err 8188 } 8189 rusi.Tags = tags 8190 } 8191 } 8192 } 8193 8194 return nil 8195} 8196 8197// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 8198type RollingUpgradeStatusInfoProperties struct { 8199 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 8200 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 8201 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 8202 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 8203 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 8204 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 8205 // Error - READ-ONLY; Error details for this upgrade, if there are any. 8206 Error *APIError `json:"error,omitempty"` 8207} 8208 8209// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. 8210func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { 8211 objectMap := make(map[string]interface{}) 8212 return json.Marshal(objectMap) 8213} 8214 8215// RunCommandDocument describes the properties of a Run Command. 8216type RunCommandDocument struct { 8217 autorest.Response `json:"-"` 8218 // Script - The script to be executed. 8219 Script *[]string `json:"script,omitempty"` 8220 // Parameters - The parameters used by the script. 8221 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 8222 // Schema - The VM run command schema. 8223 Schema *string `json:"$schema,omitempty"` 8224 // ID - The VM run command id. 8225 ID *string `json:"id,omitempty"` 8226 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 8227 OsType OperatingSystemTypes `json:"osType,omitempty"` 8228 // Label - The VM run command label. 8229 Label *string `json:"label,omitempty"` 8230 // Description - The VM run command description. 8231 Description *string `json:"description,omitempty"` 8232} 8233 8234// RunCommandDocumentBase describes the properties of a Run Command metadata. 8235type RunCommandDocumentBase struct { 8236 // Schema - The VM run command schema. 8237 Schema *string `json:"$schema,omitempty"` 8238 // ID - The VM run command id. 8239 ID *string `json:"id,omitempty"` 8240 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 8241 OsType OperatingSystemTypes `json:"osType,omitempty"` 8242 // Label - The VM run command label. 8243 Label *string `json:"label,omitempty"` 8244 // Description - The VM run command description. 8245 Description *string `json:"description,omitempty"` 8246} 8247 8248// RunCommandInput capture Virtual Machine parameters. 8249type RunCommandInput struct { 8250 // CommandID - The run command id. 8251 CommandID *string `json:"commandId,omitempty"` 8252 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 8253 Script *[]string `json:"script,omitempty"` 8254 // Parameters - The run command parameters. 8255 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 8256} 8257 8258// RunCommandInputParameter describes the properties of a run command parameter. 8259type RunCommandInputParameter struct { 8260 // Name - The run command parameter name. 8261 Name *string `json:"name,omitempty"` 8262 // Value - The run command parameter value. 8263 Value *string `json:"value,omitempty"` 8264} 8265 8266// RunCommandListResult the List Virtual Machine operation response. 8267type RunCommandListResult struct { 8268 autorest.Response `json:"-"` 8269 // Value - The list of virtual machine run commands. 8270 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 8271 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 8272 NextLink *string `json:"nextLink,omitempty"` 8273} 8274 8275// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 8276type RunCommandListResultIterator struct { 8277 i int 8278 page RunCommandListResultPage 8279} 8280 8281// NextWithContext advances to the next value. If there was an error making 8282// the request the iterator does not advance and the error is returned. 8283func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 8284 if tracing.IsEnabled() { 8285 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 8286 defer func() { 8287 sc := -1 8288 if iter.Response().Response.Response != nil { 8289 sc = iter.Response().Response.Response.StatusCode 8290 } 8291 tracing.EndSpan(ctx, sc, err) 8292 }() 8293 } 8294 iter.i++ 8295 if iter.i < len(iter.page.Values()) { 8296 return nil 8297 } 8298 err = iter.page.NextWithContext(ctx) 8299 if err != nil { 8300 iter.i-- 8301 return err 8302 } 8303 iter.i = 0 8304 return nil 8305} 8306 8307// Next advances to the next value. If there was an error making 8308// the request the iterator does not advance and the error is returned. 8309// Deprecated: Use NextWithContext() instead. 8310func (iter *RunCommandListResultIterator) Next() error { 8311 return iter.NextWithContext(context.Background()) 8312} 8313 8314// NotDone returns true if the enumeration should be started or is not yet complete. 8315func (iter RunCommandListResultIterator) NotDone() bool { 8316 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8317} 8318 8319// Response returns the raw server response from the last page request. 8320func (iter RunCommandListResultIterator) Response() RunCommandListResult { 8321 return iter.page.Response() 8322} 8323 8324// Value returns the current value or a zero-initialized value if the 8325// iterator has advanced beyond the end of the collection. 8326func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 8327 if !iter.page.NotDone() { 8328 return RunCommandDocumentBase{} 8329 } 8330 return iter.page.Values()[iter.i] 8331} 8332 8333// Creates a new instance of the RunCommandListResultIterator type. 8334func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 8335 return RunCommandListResultIterator{page: page} 8336} 8337 8338// IsEmpty returns true if the ListResult contains no values. 8339func (rclr RunCommandListResult) IsEmpty() bool { 8340 return rclr.Value == nil || len(*rclr.Value) == 0 8341} 8342 8343// hasNextLink returns true if the NextLink is not empty. 8344func (rclr RunCommandListResult) hasNextLink() bool { 8345 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 8346} 8347 8348// runCommandListResultPreparer prepares a request to retrieve the next set of results. 8349// It returns nil if no more results exist. 8350func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 8351 if !rclr.hasNextLink() { 8352 return nil, nil 8353 } 8354 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8355 autorest.AsJSON(), 8356 autorest.AsGet(), 8357 autorest.WithBaseURL(to.String(rclr.NextLink))) 8358} 8359 8360// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 8361type RunCommandListResultPage struct { 8362 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 8363 rclr RunCommandListResult 8364} 8365 8366// NextWithContext advances to the next page of values. If there was an error making 8367// the request the page does not advance and the error is returned. 8368func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 8369 if tracing.IsEnabled() { 8370 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 8371 defer func() { 8372 sc := -1 8373 if page.Response().Response.Response != nil { 8374 sc = page.Response().Response.Response.StatusCode 8375 } 8376 tracing.EndSpan(ctx, sc, err) 8377 }() 8378 } 8379 for { 8380 next, err := page.fn(ctx, page.rclr) 8381 if err != nil { 8382 return err 8383 } 8384 page.rclr = next 8385 if !next.hasNextLink() || !next.IsEmpty() { 8386 break 8387 } 8388 } 8389 return nil 8390} 8391 8392// Next advances to the next page of values. If there was an error making 8393// the request the page does not advance and the error is returned. 8394// Deprecated: Use NextWithContext() instead. 8395func (page *RunCommandListResultPage) Next() error { 8396 return page.NextWithContext(context.Background()) 8397} 8398 8399// NotDone returns true if the page enumeration should be started or is not yet complete. 8400func (page RunCommandListResultPage) NotDone() bool { 8401 return !page.rclr.IsEmpty() 8402} 8403 8404// Response returns the raw server response from the last page request. 8405func (page RunCommandListResultPage) Response() RunCommandListResult { 8406 return page.rclr 8407} 8408 8409// Values returns the slice of values for the current page or nil if there are no values. 8410func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 8411 if page.rclr.IsEmpty() { 8412 return nil 8413 } 8414 return *page.rclr.Value 8415} 8416 8417// Creates a new instance of the RunCommandListResultPage type. 8418func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 8419 return RunCommandListResultPage{ 8420 fn: getNextPage, 8421 rclr: cur, 8422 } 8423} 8424 8425// RunCommandParameterDefinition describes the properties of a run command parameter. 8426type RunCommandParameterDefinition struct { 8427 // Name - The run command parameter name. 8428 Name *string `json:"name,omitempty"` 8429 // Type - The run command parameter type. 8430 Type *string `json:"type,omitempty"` 8431 // DefaultValue - The run command parameter default value. 8432 DefaultValue *string `json:"defaultValue,omitempty"` 8433 // Required - The run command parameter required. 8434 Required *bool `json:"required,omitempty"` 8435} 8436 8437// RunCommandResult ... 8438type RunCommandResult struct { 8439 autorest.Response `json:"-"` 8440 // Value - Run command operation response. 8441 Value *[]InstanceViewStatus `json:"value,omitempty"` 8442} 8443 8444// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 8445type ScaleInPolicy struct { 8446 // 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> 8447 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 8448} 8449 8450// ScheduledEventsProfile ... 8451type ScheduledEventsProfile struct { 8452 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 8453 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 8454} 8455 8456// ShareInfoElement ... 8457type ShareInfoElement struct { 8458 // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 8459 VMURI *string `json:"vmUri,omitempty"` 8460} 8461 8462// MarshalJSON is the custom marshaler for ShareInfoElement. 8463func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { 8464 objectMap := make(map[string]interface{}) 8465 return json.Marshal(objectMap) 8466} 8467 8468// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 8469// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 8470// name. 8471type Sku struct { 8472 // Name - The sku name. 8473 Name *string `json:"name,omitempty"` 8474 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 8475 Tier *string `json:"tier,omitempty"` 8476 // Capacity - Specifies the number of virtual machines in the scale set. 8477 Capacity *int64 `json:"capacity,omitempty"` 8478} 8479 8480// Snapshot snapshot resource. 8481type Snapshot struct { 8482 autorest.Response `json:"-"` 8483 // ManagedBy - READ-ONLY; Unused. Always Null. 8484 ManagedBy *string `json:"managedBy,omitempty"` 8485 Sku *SnapshotSku `json:"sku,omitempty"` 8486 *SnapshotProperties `json:"properties,omitempty"` 8487 // ID - READ-ONLY; Resource Id 8488 ID *string `json:"id,omitempty"` 8489 // Name - READ-ONLY; Resource name 8490 Name *string `json:"name,omitempty"` 8491 // Type - READ-ONLY; Resource type 8492 Type *string `json:"type,omitempty"` 8493 // Location - Resource location 8494 Location *string `json:"location,omitempty"` 8495 // Tags - Resource tags 8496 Tags map[string]*string `json:"tags"` 8497} 8498 8499// MarshalJSON is the custom marshaler for Snapshot. 8500func (s Snapshot) MarshalJSON() ([]byte, error) { 8501 objectMap := make(map[string]interface{}) 8502 if s.Sku != nil { 8503 objectMap["sku"] = s.Sku 8504 } 8505 if s.SnapshotProperties != nil { 8506 objectMap["properties"] = s.SnapshotProperties 8507 } 8508 if s.Location != nil { 8509 objectMap["location"] = s.Location 8510 } 8511 if s.Tags != nil { 8512 objectMap["tags"] = s.Tags 8513 } 8514 return json.Marshal(objectMap) 8515} 8516 8517// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 8518func (s *Snapshot) UnmarshalJSON(body []byte) error { 8519 var m map[string]*json.RawMessage 8520 err := json.Unmarshal(body, &m) 8521 if err != nil { 8522 return err 8523 } 8524 for k, v := range m { 8525 switch k { 8526 case "managedBy": 8527 if v != nil { 8528 var managedBy string 8529 err = json.Unmarshal(*v, &managedBy) 8530 if err != nil { 8531 return err 8532 } 8533 s.ManagedBy = &managedBy 8534 } 8535 case "sku": 8536 if v != nil { 8537 var sku SnapshotSku 8538 err = json.Unmarshal(*v, &sku) 8539 if err != nil { 8540 return err 8541 } 8542 s.Sku = &sku 8543 } 8544 case "properties": 8545 if v != nil { 8546 var snapshotProperties SnapshotProperties 8547 err = json.Unmarshal(*v, &snapshotProperties) 8548 if err != nil { 8549 return err 8550 } 8551 s.SnapshotProperties = &snapshotProperties 8552 } 8553 case "id": 8554 if v != nil { 8555 var ID string 8556 err = json.Unmarshal(*v, &ID) 8557 if err != nil { 8558 return err 8559 } 8560 s.ID = &ID 8561 } 8562 case "name": 8563 if v != nil { 8564 var name string 8565 err = json.Unmarshal(*v, &name) 8566 if err != nil { 8567 return err 8568 } 8569 s.Name = &name 8570 } 8571 case "type": 8572 if v != nil { 8573 var typeVar string 8574 err = json.Unmarshal(*v, &typeVar) 8575 if err != nil { 8576 return err 8577 } 8578 s.Type = &typeVar 8579 } 8580 case "location": 8581 if v != nil { 8582 var location string 8583 err = json.Unmarshal(*v, &location) 8584 if err != nil { 8585 return err 8586 } 8587 s.Location = &location 8588 } 8589 case "tags": 8590 if v != nil { 8591 var tags map[string]*string 8592 err = json.Unmarshal(*v, &tags) 8593 if err != nil { 8594 return err 8595 } 8596 s.Tags = tags 8597 } 8598 } 8599 } 8600 8601 return nil 8602} 8603 8604// SnapshotList the List Snapshots operation response. 8605type SnapshotList struct { 8606 autorest.Response `json:"-"` 8607 // Value - A list of snapshots. 8608 Value *[]Snapshot `json:"value,omitempty"` 8609 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 8610 NextLink *string `json:"nextLink,omitempty"` 8611} 8612 8613// SnapshotListIterator provides access to a complete listing of Snapshot values. 8614type SnapshotListIterator struct { 8615 i int 8616 page SnapshotListPage 8617} 8618 8619// NextWithContext advances to the next value. If there was an error making 8620// the request the iterator does not advance and the error is returned. 8621func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 8622 if tracing.IsEnabled() { 8623 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 8624 defer func() { 8625 sc := -1 8626 if iter.Response().Response.Response != nil { 8627 sc = iter.Response().Response.Response.StatusCode 8628 } 8629 tracing.EndSpan(ctx, sc, err) 8630 }() 8631 } 8632 iter.i++ 8633 if iter.i < len(iter.page.Values()) { 8634 return nil 8635 } 8636 err = iter.page.NextWithContext(ctx) 8637 if err != nil { 8638 iter.i-- 8639 return err 8640 } 8641 iter.i = 0 8642 return nil 8643} 8644 8645// Next advances to the next value. If there was an error making 8646// the request the iterator does not advance and the error is returned. 8647// Deprecated: Use NextWithContext() instead. 8648func (iter *SnapshotListIterator) Next() error { 8649 return iter.NextWithContext(context.Background()) 8650} 8651 8652// NotDone returns true if the enumeration should be started or is not yet complete. 8653func (iter SnapshotListIterator) NotDone() bool { 8654 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8655} 8656 8657// Response returns the raw server response from the last page request. 8658func (iter SnapshotListIterator) Response() SnapshotList { 8659 return iter.page.Response() 8660} 8661 8662// Value returns the current value or a zero-initialized value if the 8663// iterator has advanced beyond the end of the collection. 8664func (iter SnapshotListIterator) Value() Snapshot { 8665 if !iter.page.NotDone() { 8666 return Snapshot{} 8667 } 8668 return iter.page.Values()[iter.i] 8669} 8670 8671// Creates a new instance of the SnapshotListIterator type. 8672func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 8673 return SnapshotListIterator{page: page} 8674} 8675 8676// IsEmpty returns true if the ListResult contains no values. 8677func (sl SnapshotList) IsEmpty() bool { 8678 return sl.Value == nil || len(*sl.Value) == 0 8679} 8680 8681// hasNextLink returns true if the NextLink is not empty. 8682func (sl SnapshotList) hasNextLink() bool { 8683 return sl.NextLink != nil && len(*sl.NextLink) != 0 8684} 8685 8686// snapshotListPreparer prepares a request to retrieve the next set of results. 8687// It returns nil if no more results exist. 8688func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 8689 if !sl.hasNextLink() { 8690 return nil, nil 8691 } 8692 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8693 autorest.AsJSON(), 8694 autorest.AsGet(), 8695 autorest.WithBaseURL(to.String(sl.NextLink))) 8696} 8697 8698// SnapshotListPage contains a page of Snapshot values. 8699type SnapshotListPage struct { 8700 fn func(context.Context, SnapshotList) (SnapshotList, error) 8701 sl SnapshotList 8702} 8703 8704// NextWithContext advances to the next page of values. If there was an error making 8705// the request the page does not advance and the error is returned. 8706func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 8707 if tracing.IsEnabled() { 8708 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 8709 defer func() { 8710 sc := -1 8711 if page.Response().Response.Response != nil { 8712 sc = page.Response().Response.Response.StatusCode 8713 } 8714 tracing.EndSpan(ctx, sc, err) 8715 }() 8716 } 8717 for { 8718 next, err := page.fn(ctx, page.sl) 8719 if err != nil { 8720 return err 8721 } 8722 page.sl = next 8723 if !next.hasNextLink() || !next.IsEmpty() { 8724 break 8725 } 8726 } 8727 return nil 8728} 8729 8730// Next advances to the next page of values. If there was an error making 8731// the request the page does not advance and the error is returned. 8732// Deprecated: Use NextWithContext() instead. 8733func (page *SnapshotListPage) Next() error { 8734 return page.NextWithContext(context.Background()) 8735} 8736 8737// NotDone returns true if the page enumeration should be started or is not yet complete. 8738func (page SnapshotListPage) NotDone() bool { 8739 return !page.sl.IsEmpty() 8740} 8741 8742// Response returns the raw server response from the last page request. 8743func (page SnapshotListPage) Response() SnapshotList { 8744 return page.sl 8745} 8746 8747// Values returns the slice of values for the current page or nil if there are no values. 8748func (page SnapshotListPage) Values() []Snapshot { 8749 if page.sl.IsEmpty() { 8750 return nil 8751 } 8752 return *page.sl.Value 8753} 8754 8755// Creates a new instance of the SnapshotListPage type. 8756func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 8757 return SnapshotListPage{ 8758 fn: getNextPage, 8759 sl: cur, 8760 } 8761} 8762 8763// SnapshotProperties snapshot resource properties. 8764type SnapshotProperties struct { 8765 // TimeCreated - READ-ONLY; The time when the disk was created. 8766 TimeCreated *date.Time `json:"timeCreated,omitempty"` 8767 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 8768 OsType OperatingSystemTypes `json:"osType,omitempty"` 8769 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 8770 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 8771 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 8772 CreationData *CreationData `json:"creationData,omitempty"` 8773 // 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. 8774 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8775 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 8776 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 8777 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 8778 UniqueID *string `json:"uniqueId,omitempty"` 8779 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 8780 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 8781 // ProvisioningState - READ-ONLY; The disk provisioning state. 8782 ProvisioningState *string `json:"provisioningState,omitempty"` 8783 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 8784 Incremental *bool `json:"incremental,omitempty"` 8785 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 8786 Encryption *Encryption `json:"encryption,omitempty"` 8787} 8788 8789// MarshalJSON is the custom marshaler for SnapshotProperties. 8790func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 8791 objectMap := make(map[string]interface{}) 8792 if sp.OsType != "" { 8793 objectMap["osType"] = sp.OsType 8794 } 8795 if sp.HyperVGeneration != "" { 8796 objectMap["hyperVGeneration"] = sp.HyperVGeneration 8797 } 8798 if sp.CreationData != nil { 8799 objectMap["creationData"] = sp.CreationData 8800 } 8801 if sp.DiskSizeGB != nil { 8802 objectMap["diskSizeGB"] = sp.DiskSizeGB 8803 } 8804 if sp.EncryptionSettingsCollection != nil { 8805 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 8806 } 8807 if sp.Incremental != nil { 8808 objectMap["incremental"] = sp.Incremental 8809 } 8810 if sp.Encryption != nil { 8811 objectMap["encryption"] = sp.Encryption 8812 } 8813 return json.Marshal(objectMap) 8814} 8815 8816// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8817// operation. 8818type SnapshotsCreateOrUpdateFuture struct { 8819 azure.FutureAPI 8820 // Result returns the result of the asynchronous operation. 8821 // If the operation has not completed it will return an error. 8822 Result func(SnapshotsClient) (Snapshot, error) 8823} 8824 8825// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8826func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8827 var azFuture azure.Future 8828 if err := json.Unmarshal(body, &azFuture); err != nil { 8829 return err 8830 } 8831 future.FutureAPI = &azFuture 8832 future.Result = future.result 8833 return nil 8834} 8835 8836// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 8837func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 8838 var done bool 8839 done, err = future.DoneWithContext(context.Background(), client) 8840 if err != nil { 8841 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8842 return 8843 } 8844 if !done { 8845 s.Response.Response = future.Response() 8846 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 8847 return 8848 } 8849 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8850 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 8851 s, err = client.CreateOrUpdateResponder(s.Response.Response) 8852 if err != nil { 8853 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 8854 } 8855 } 8856 return 8857} 8858 8859// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8860// operation. 8861type SnapshotsDeleteFuture struct { 8862 azure.FutureAPI 8863 // Result returns the result of the asynchronous operation. 8864 // If the operation has not completed it will return an error. 8865 Result func(SnapshotsClient) (autorest.Response, error) 8866} 8867 8868// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8869func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 8870 var azFuture azure.Future 8871 if err := json.Unmarshal(body, &azFuture); err != nil { 8872 return err 8873 } 8874 future.FutureAPI = &azFuture 8875 future.Result = future.result 8876 return nil 8877} 8878 8879// result is the default implementation for SnapshotsDeleteFuture.Result. 8880func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 8881 var done bool 8882 done, err = future.DoneWithContext(context.Background(), client) 8883 if err != nil { 8884 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 8885 return 8886 } 8887 if !done { 8888 ar.Response = future.Response() 8889 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 8890 return 8891 } 8892 ar.Response = future.Response() 8893 return 8894} 8895 8896// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 8897// operation. 8898type SnapshotsGrantAccessFuture struct { 8899 azure.FutureAPI 8900 // Result returns the result of the asynchronous operation. 8901 // If the operation has not completed it will return an error. 8902 Result func(SnapshotsClient) (AccessURI, error) 8903} 8904 8905// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8906func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 8907 var azFuture azure.Future 8908 if err := json.Unmarshal(body, &azFuture); err != nil { 8909 return err 8910 } 8911 future.FutureAPI = &azFuture 8912 future.Result = future.result 8913 return nil 8914} 8915 8916// result is the default implementation for SnapshotsGrantAccessFuture.Result. 8917func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 8918 var done bool 8919 done, err = future.DoneWithContext(context.Background(), client) 8920 if err != nil { 8921 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 8922 return 8923 } 8924 if !done { 8925 au.Response.Response = future.Response() 8926 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 8927 return 8928 } 8929 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8930 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 8931 au, err = client.GrantAccessResponder(au.Response.Response) 8932 if err != nil { 8933 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 8934 } 8935 } 8936 return 8937} 8938 8939// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 8940type SnapshotSku struct { 8941 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 8942 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 8943 // Tier - READ-ONLY; The sku tier. 8944 Tier *string `json:"tier,omitempty"` 8945} 8946 8947// MarshalJSON is the custom marshaler for SnapshotSku. 8948func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 8949 objectMap := make(map[string]interface{}) 8950 if ss.Name != "" { 8951 objectMap["name"] = ss.Name 8952 } 8953 return json.Marshal(objectMap) 8954} 8955 8956// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 8957// operation. 8958type SnapshotsRevokeAccessFuture struct { 8959 azure.FutureAPI 8960 // Result returns the result of the asynchronous operation. 8961 // If the operation has not completed it will return an error. 8962 Result func(SnapshotsClient) (autorest.Response, error) 8963} 8964 8965// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8966func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 8967 var azFuture azure.Future 8968 if err := json.Unmarshal(body, &azFuture); err != nil { 8969 return err 8970 } 8971 future.FutureAPI = &azFuture 8972 future.Result = future.result 8973 return nil 8974} 8975 8976// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 8977func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 8978 var done bool 8979 done, err = future.DoneWithContext(context.Background(), client) 8980 if err != nil { 8981 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 8982 return 8983 } 8984 if !done { 8985 ar.Response = future.Response() 8986 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 8987 return 8988 } 8989 ar.Response = future.Response() 8990 return 8991} 8992 8993// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8994// operation. 8995type SnapshotsUpdateFuture struct { 8996 azure.FutureAPI 8997 // Result returns the result of the asynchronous operation. 8998 // If the operation has not completed it will return an error. 8999 Result func(SnapshotsClient) (Snapshot, error) 9000} 9001 9002// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9003func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 9004 var azFuture azure.Future 9005 if err := json.Unmarshal(body, &azFuture); err != nil { 9006 return err 9007 } 9008 future.FutureAPI = &azFuture 9009 future.Result = future.result 9010 return nil 9011} 9012 9013// result is the default implementation for SnapshotsUpdateFuture.Result. 9014func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 9015 var done bool 9016 done, err = future.DoneWithContext(context.Background(), client) 9017 if err != nil { 9018 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 9019 return 9020 } 9021 if !done { 9022 s.Response.Response = future.Response() 9023 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 9024 return 9025 } 9026 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9027 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 9028 s, err = client.UpdateResponder(s.Response.Response) 9029 if err != nil { 9030 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 9031 } 9032 } 9033 return 9034} 9035 9036// SnapshotUpdate snapshot update resource. 9037type SnapshotUpdate struct { 9038 *SnapshotUpdateProperties `json:"properties,omitempty"` 9039 // Tags - Resource tags 9040 Tags map[string]*string `json:"tags"` 9041 Sku *SnapshotSku `json:"sku,omitempty"` 9042} 9043 9044// MarshalJSON is the custom marshaler for SnapshotUpdate. 9045func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 9046 objectMap := make(map[string]interface{}) 9047 if su.SnapshotUpdateProperties != nil { 9048 objectMap["properties"] = su.SnapshotUpdateProperties 9049 } 9050 if su.Tags != nil { 9051 objectMap["tags"] = su.Tags 9052 } 9053 if su.Sku != nil { 9054 objectMap["sku"] = su.Sku 9055 } 9056 return json.Marshal(objectMap) 9057} 9058 9059// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 9060func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 9061 var m map[string]*json.RawMessage 9062 err := json.Unmarshal(body, &m) 9063 if err != nil { 9064 return err 9065 } 9066 for k, v := range m { 9067 switch k { 9068 case "properties": 9069 if v != nil { 9070 var snapshotUpdateProperties SnapshotUpdateProperties 9071 err = json.Unmarshal(*v, &snapshotUpdateProperties) 9072 if err != nil { 9073 return err 9074 } 9075 su.SnapshotUpdateProperties = &snapshotUpdateProperties 9076 } 9077 case "tags": 9078 if v != nil { 9079 var tags map[string]*string 9080 err = json.Unmarshal(*v, &tags) 9081 if err != nil { 9082 return err 9083 } 9084 su.Tags = tags 9085 } 9086 case "sku": 9087 if v != nil { 9088 var sku SnapshotSku 9089 err = json.Unmarshal(*v, &sku) 9090 if err != nil { 9091 return err 9092 } 9093 su.Sku = &sku 9094 } 9095 } 9096 } 9097 9098 return nil 9099} 9100 9101// SnapshotUpdateProperties snapshot resource update properties. 9102type SnapshotUpdateProperties struct { 9103 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 9104 OsType OperatingSystemTypes `json:"osType,omitempty"` 9105 // 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. 9106 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9107 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 9108 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 9109 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 9110 Encryption *Encryption `json:"encryption,omitempty"` 9111} 9112 9113// SourceVault the vault id is an Azure Resource Manager Resource id in the form 9114// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 9115type SourceVault struct { 9116 // ID - Resource Id 9117 ID *string `json:"id,omitempty"` 9118} 9119 9120// SSHConfiguration SSH configuration for Linux based VMs running on Azure 9121type SSHConfiguration struct { 9122 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 9123 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 9124} 9125 9126// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 9127// the public key is placed. 9128type SSHPublicKey struct { 9129 // 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 9130 Path *string `json:"path,omitempty"` 9131 // 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). 9132 KeyData *string `json:"keyData,omitempty"` 9133} 9134 9135// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 9136type SSHPublicKeyGenerateKeyPairResult struct { 9137 autorest.Response `json:"-"` 9138 // PrivateKey - Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. 9139 PrivateKey *string `json:"privateKey,omitempty"` 9140 // PublicKey - Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. 9141 PublicKey *string `json:"publicKey,omitempty"` 9142 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 9143 ID *string `json:"id,omitempty"` 9144} 9145 9146// SSHPublicKeyResource specifies information about the SSH public key. 9147type SSHPublicKeyResource struct { 9148 autorest.Response `json:"-"` 9149 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 9150 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 9151 // ID - READ-ONLY; Resource Id 9152 ID *string `json:"id,omitempty"` 9153 // Name - READ-ONLY; Resource name 9154 Name *string `json:"name,omitempty"` 9155 // Type - READ-ONLY; Resource type 9156 Type *string `json:"type,omitempty"` 9157 // Location - Resource location 9158 Location *string `json:"location,omitempty"` 9159 // Tags - Resource tags 9160 Tags map[string]*string `json:"tags"` 9161} 9162 9163// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 9164func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 9165 objectMap := make(map[string]interface{}) 9166 if spkr.SSHPublicKeyResourceProperties != nil { 9167 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 9168 } 9169 if spkr.Location != nil { 9170 objectMap["location"] = spkr.Location 9171 } 9172 if spkr.Tags != nil { 9173 objectMap["tags"] = spkr.Tags 9174 } 9175 return json.Marshal(objectMap) 9176} 9177 9178// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 9179func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 9180 var m map[string]*json.RawMessage 9181 err := json.Unmarshal(body, &m) 9182 if err != nil { 9183 return err 9184 } 9185 for k, v := range m { 9186 switch k { 9187 case "properties": 9188 if v != nil { 9189 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 9190 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 9191 if err != nil { 9192 return err 9193 } 9194 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 9195 } 9196 case "id": 9197 if v != nil { 9198 var ID string 9199 err = json.Unmarshal(*v, &ID) 9200 if err != nil { 9201 return err 9202 } 9203 spkr.ID = &ID 9204 } 9205 case "name": 9206 if v != nil { 9207 var name string 9208 err = json.Unmarshal(*v, &name) 9209 if err != nil { 9210 return err 9211 } 9212 spkr.Name = &name 9213 } 9214 case "type": 9215 if v != nil { 9216 var typeVar string 9217 err = json.Unmarshal(*v, &typeVar) 9218 if err != nil { 9219 return err 9220 } 9221 spkr.Type = &typeVar 9222 } 9223 case "location": 9224 if v != nil { 9225 var location string 9226 err = json.Unmarshal(*v, &location) 9227 if err != nil { 9228 return err 9229 } 9230 spkr.Location = &location 9231 } 9232 case "tags": 9233 if v != nil { 9234 var tags map[string]*string 9235 err = json.Unmarshal(*v, &tags) 9236 if err != nil { 9237 return err 9238 } 9239 spkr.Tags = tags 9240 } 9241 } 9242 } 9243 9244 return nil 9245} 9246 9247// SSHPublicKeyResourceProperties properties of the SSH public key. 9248type SSHPublicKeyResourceProperties struct { 9249 // PublicKey - SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. 9250 PublicKey *string `json:"publicKey,omitempty"` 9251} 9252 9253// SSHPublicKeysGroupListResult the list SSH public keys operation response. 9254type SSHPublicKeysGroupListResult struct { 9255 autorest.Response `json:"-"` 9256 // Value - The list of SSH public keys 9257 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 9258 // NextLink - The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. 9259 NextLink *string `json:"nextLink,omitempty"` 9260} 9261 9262// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 9263// values. 9264type SSHPublicKeysGroupListResultIterator struct { 9265 i int 9266 page SSHPublicKeysGroupListResultPage 9267} 9268 9269// NextWithContext advances to the next value. If there was an error making 9270// the request the iterator does not advance and the error is returned. 9271func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 9272 if tracing.IsEnabled() { 9273 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 9274 defer func() { 9275 sc := -1 9276 if iter.Response().Response.Response != nil { 9277 sc = iter.Response().Response.Response.StatusCode 9278 } 9279 tracing.EndSpan(ctx, sc, err) 9280 }() 9281 } 9282 iter.i++ 9283 if iter.i < len(iter.page.Values()) { 9284 return nil 9285 } 9286 err = iter.page.NextWithContext(ctx) 9287 if err != nil { 9288 iter.i-- 9289 return err 9290 } 9291 iter.i = 0 9292 return nil 9293} 9294 9295// Next advances to the next value. If there was an error making 9296// the request the iterator does not advance and the error is returned. 9297// Deprecated: Use NextWithContext() instead. 9298func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 9299 return iter.NextWithContext(context.Background()) 9300} 9301 9302// NotDone returns true if the enumeration should be started or is not yet complete. 9303func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 9304 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9305} 9306 9307// Response returns the raw server response from the last page request. 9308func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 9309 return iter.page.Response() 9310} 9311 9312// Value returns the current value or a zero-initialized value if the 9313// iterator has advanced beyond the end of the collection. 9314func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 9315 if !iter.page.NotDone() { 9316 return SSHPublicKeyResource{} 9317 } 9318 return iter.page.Values()[iter.i] 9319} 9320 9321// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 9322func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 9323 return SSHPublicKeysGroupListResultIterator{page: page} 9324} 9325 9326// IsEmpty returns true if the ListResult contains no values. 9327func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 9328 return spkglr.Value == nil || len(*spkglr.Value) == 0 9329} 9330 9331// hasNextLink returns true if the NextLink is not empty. 9332func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 9333 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 9334} 9335 9336// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 9337// It returns nil if no more results exist. 9338func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 9339 if !spkglr.hasNextLink() { 9340 return nil, nil 9341 } 9342 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9343 autorest.AsJSON(), 9344 autorest.AsGet(), 9345 autorest.WithBaseURL(to.String(spkglr.NextLink))) 9346} 9347 9348// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 9349type SSHPublicKeysGroupListResultPage struct { 9350 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 9351 spkglr SSHPublicKeysGroupListResult 9352} 9353 9354// NextWithContext advances to the next page of values. If there was an error making 9355// the request the page does not advance and the error is returned. 9356func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 9357 if tracing.IsEnabled() { 9358 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 9359 defer func() { 9360 sc := -1 9361 if page.Response().Response.Response != nil { 9362 sc = page.Response().Response.Response.StatusCode 9363 } 9364 tracing.EndSpan(ctx, sc, err) 9365 }() 9366 } 9367 for { 9368 next, err := page.fn(ctx, page.spkglr) 9369 if err != nil { 9370 return err 9371 } 9372 page.spkglr = next 9373 if !next.hasNextLink() || !next.IsEmpty() { 9374 break 9375 } 9376 } 9377 return nil 9378} 9379 9380// Next advances to the next page of values. If there was an error making 9381// the request the page does not advance and the error is returned. 9382// Deprecated: Use NextWithContext() instead. 9383func (page *SSHPublicKeysGroupListResultPage) Next() error { 9384 return page.NextWithContext(context.Background()) 9385} 9386 9387// NotDone returns true if the page enumeration should be started or is not yet complete. 9388func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 9389 return !page.spkglr.IsEmpty() 9390} 9391 9392// Response returns the raw server response from the last page request. 9393func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 9394 return page.spkglr 9395} 9396 9397// Values returns the slice of values for the current page or nil if there are no values. 9398func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 9399 if page.spkglr.IsEmpty() { 9400 return nil 9401 } 9402 return *page.spkglr.Value 9403} 9404 9405// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 9406func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 9407 return SSHPublicKeysGroupListResultPage{ 9408 fn: getNextPage, 9409 spkglr: cur, 9410 } 9411} 9412 9413// SSHPublicKeyUpdateResource specifies information about the SSH public key. 9414type SSHPublicKeyUpdateResource struct { 9415 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 9416 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 9417 // Tags - Resource tags 9418 Tags map[string]*string `json:"tags"` 9419} 9420 9421// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 9422func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 9423 objectMap := make(map[string]interface{}) 9424 if spkur.SSHPublicKeyResourceProperties != nil { 9425 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 9426 } 9427 if spkur.Tags != nil { 9428 objectMap["tags"] = spkur.Tags 9429 } 9430 return json.Marshal(objectMap) 9431} 9432 9433// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 9434func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 9435 var m map[string]*json.RawMessage 9436 err := json.Unmarshal(body, &m) 9437 if err != nil { 9438 return err 9439 } 9440 for k, v := range m { 9441 switch k { 9442 case "properties": 9443 if v != nil { 9444 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 9445 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 9446 if err != nil { 9447 return err 9448 } 9449 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 9450 } 9451 case "tags": 9452 if v != nil { 9453 var tags map[string]*string 9454 err = json.Unmarshal(*v, &tags) 9455 if err != nil { 9456 return err 9457 } 9458 spkur.Tags = tags 9459 } 9460 } 9461 } 9462 9463 return nil 9464} 9465 9466// StorageProfile specifies the storage settings for the virtual machine disks. 9467type StorageProfile struct { 9468 // 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. 9469 ImageReference *ImageReference `json:"imageReference,omitempty"` 9470 // 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). 9471 OsDisk *OSDisk `json:"osDisk,omitempty"` 9472 // 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). 9473 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 9474} 9475 9476// SubResource ... 9477type SubResource struct { 9478 // ID - Resource Id 9479 ID *string `json:"id,omitempty"` 9480} 9481 9482// SubResourceReadOnly ... 9483type SubResourceReadOnly struct { 9484 // ID - READ-ONLY; Resource Id 9485 ID *string `json:"id,omitempty"` 9486} 9487 9488// MarshalJSON is the custom marshaler for SubResourceReadOnly. 9489func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { 9490 objectMap := make(map[string]interface{}) 9491 return json.Marshal(objectMap) 9492} 9493 9494// SubResourceWithColocationStatus ... 9495type SubResourceWithColocationStatus struct { 9496 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 9497 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 9498 // ID - Resource Id 9499 ID *string `json:"id,omitempty"` 9500} 9501 9502// TargetRegion describes the target region information. 9503type TargetRegion struct { 9504 // Name - The name of the region. 9505 Name *string `json:"name,omitempty"` 9506 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 9507 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 9508 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 9509 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 9510 Encryption *EncryptionImages `json:"encryption,omitempty"` 9511} 9512 9513// TerminateNotificationProfile ... 9514type TerminateNotificationProfile struct { 9515 // 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) 9516 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 9517 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 9518 Enable *bool `json:"enable,omitempty"` 9519} 9520 9521// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 9522type ThrottledRequestsInput struct { 9523 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 9524 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 9525 // FromTime - From time of the query 9526 FromTime *date.Time `json:"fromTime,omitempty"` 9527 // ToTime - To time of the query 9528 ToTime *date.Time `json:"toTime,omitempty"` 9529 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 9530 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 9531 // GroupByOperationName - Group query result by Operation Name. 9532 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 9533 // GroupByResourceName - Group query result by Resource Name. 9534 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 9535} 9536 9537// UpdateResource the Update Resource model definition. 9538type UpdateResource struct { 9539 // Tags - Resource tags 9540 Tags map[string]*string `json:"tags"` 9541} 9542 9543// MarshalJSON is the custom marshaler for UpdateResource. 9544func (ur UpdateResource) MarshalJSON() ([]byte, error) { 9545 objectMap := make(map[string]interface{}) 9546 if ur.Tags != nil { 9547 objectMap["tags"] = ur.Tags 9548 } 9549 return json.Marshal(objectMap) 9550} 9551 9552// UpdateResourceDefinition the Update Resource model definition. 9553type UpdateResourceDefinition struct { 9554 // ID - READ-ONLY; Resource Id 9555 ID *string `json:"id,omitempty"` 9556 // Name - READ-ONLY; Resource name 9557 Name *string `json:"name,omitempty"` 9558 // Type - READ-ONLY; Resource type 9559 Type *string `json:"type,omitempty"` 9560 // Tags - Resource tags 9561 Tags map[string]*string `json:"tags"` 9562} 9563 9564// MarshalJSON is the custom marshaler for UpdateResourceDefinition. 9565func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { 9566 objectMap := make(map[string]interface{}) 9567 if urd.Tags != nil { 9568 objectMap["tags"] = urd.Tags 9569 } 9570 return json.Marshal(objectMap) 9571} 9572 9573// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 9574type UpgradeOperationHistoricalStatusInfo struct { 9575 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 9576 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 9577 // Type - READ-ONLY; Resource type 9578 Type *string `json:"type,omitempty"` 9579 // Location - READ-ONLY; Resource location 9580 Location *string `json:"location,omitempty"` 9581} 9582 9583// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. 9584func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { 9585 objectMap := make(map[string]interface{}) 9586 return json.Marshal(objectMap) 9587} 9588 9589// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 9590// Set. 9591type UpgradeOperationHistoricalStatusInfoProperties struct { 9592 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 9593 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 9594 // Progress - READ-ONLY; Counts of the VMs in each state. 9595 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 9596 // Error - READ-ONLY; Error Details for this upgrade if there are any. 9597 Error *APIError `json:"error,omitempty"` 9598 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 9599 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 9600 // TargetImageReference - READ-ONLY; Image Reference details 9601 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 9602 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 9603 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 9604} 9605 9606// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. 9607func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { 9608 objectMap := make(map[string]interface{}) 9609 return json.Marshal(objectMap) 9610} 9611 9612// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 9613type UpgradeOperationHistoryStatus struct { 9614 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 9615 Code UpgradeState `json:"code,omitempty"` 9616 // StartTime - READ-ONLY; Start time of the upgrade. 9617 StartTime *date.Time `json:"startTime,omitempty"` 9618 // EndTime - READ-ONLY; End time of the upgrade. 9619 EndTime *date.Time `json:"endTime,omitempty"` 9620} 9621 9622// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. 9623func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { 9624 objectMap := make(map[string]interface{}) 9625 return json.Marshal(objectMap) 9626} 9627 9628// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 9629type UpgradePolicy struct { 9630 // 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' 9631 Mode UpgradeMode `json:"mode,omitempty"` 9632 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 9633 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 9634 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 9635 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 9636} 9637 9638// Usage describes Compute Resource Usage. 9639type Usage struct { 9640 // Unit - An enum describing the unit of usage measurement. 9641 Unit *string `json:"unit,omitempty"` 9642 // CurrentValue - The current usage of the resource. 9643 CurrentValue *int32 `json:"currentValue,omitempty"` 9644 // Limit - The maximum permitted usage of the resource. 9645 Limit *int64 `json:"limit,omitempty"` 9646 // Name - The name of the type of usage. 9647 Name *UsageName `json:"name,omitempty"` 9648} 9649 9650// UsageName the Usage Names. 9651type UsageName struct { 9652 // Value - The name of the resource. 9653 Value *string `json:"value,omitempty"` 9654 // LocalizedValue - The localized name of the resource. 9655 LocalizedValue *string `json:"localizedValue,omitempty"` 9656} 9657 9658// UserArtifactSource the source image from which the Image Version is going to be created. 9659type UserArtifactSource struct { 9660 // FileName - Required. The fileName of the artifact. 9661 FileName *string `json:"fileName,omitempty"` 9662 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. 9663 MediaLink *string `json:"mediaLink,omitempty"` 9664} 9665 9666// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 9667// should reside on the VM. 9668type VaultCertificate struct { 9669 // 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>} 9670 CertificateURL *string `json:"certificateUrl,omitempty"` 9671 // 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. 9672 CertificateStore *string `json:"certificateStore,omitempty"` 9673} 9674 9675// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 9676type VaultSecretGroup struct { 9677 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 9678 SourceVault *SubResource `json:"sourceVault,omitempty"` 9679 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 9680 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 9681} 9682 9683// VirtualHardDisk describes the uri of a disk. 9684type VirtualHardDisk struct { 9685 // URI - Specifies the virtual hard disk's uri. 9686 URI *string `json:"uri,omitempty"` 9687} 9688 9689// VirtualMachine describes a Virtual Machine. 9690type VirtualMachine struct { 9691 autorest.Response `json:"-"` 9692 // 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**. 9693 Plan *Plan `json:"plan,omitempty"` 9694 *VirtualMachineProperties `json:"properties,omitempty"` 9695 // Resources - READ-ONLY; The virtual machine child extension resources. 9696 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 9697 // Identity - The identity of the virtual machine, if configured. 9698 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 9699 // Zones - The virtual machine zones. 9700 Zones *[]string `json:"zones,omitempty"` 9701 // ID - READ-ONLY; Resource Id 9702 ID *string `json:"id,omitempty"` 9703 // Name - READ-ONLY; Resource name 9704 Name *string `json:"name,omitempty"` 9705 // Type - READ-ONLY; Resource type 9706 Type *string `json:"type,omitempty"` 9707 // Location - Resource location 9708 Location *string `json:"location,omitempty"` 9709 // Tags - Resource tags 9710 Tags map[string]*string `json:"tags"` 9711} 9712 9713// MarshalJSON is the custom marshaler for VirtualMachine. 9714func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 9715 objectMap := make(map[string]interface{}) 9716 if VM.Plan != nil { 9717 objectMap["plan"] = VM.Plan 9718 } 9719 if VM.VirtualMachineProperties != nil { 9720 objectMap["properties"] = VM.VirtualMachineProperties 9721 } 9722 if VM.Identity != nil { 9723 objectMap["identity"] = VM.Identity 9724 } 9725 if VM.Zones != nil { 9726 objectMap["zones"] = VM.Zones 9727 } 9728 if VM.Location != nil { 9729 objectMap["location"] = VM.Location 9730 } 9731 if VM.Tags != nil { 9732 objectMap["tags"] = VM.Tags 9733 } 9734 return json.Marshal(objectMap) 9735} 9736 9737// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 9738func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 9739 var m map[string]*json.RawMessage 9740 err := json.Unmarshal(body, &m) 9741 if err != nil { 9742 return err 9743 } 9744 for k, v := range m { 9745 switch k { 9746 case "plan": 9747 if v != nil { 9748 var plan Plan 9749 err = json.Unmarshal(*v, &plan) 9750 if err != nil { 9751 return err 9752 } 9753 VM.Plan = &plan 9754 } 9755 case "properties": 9756 if v != nil { 9757 var virtualMachineProperties VirtualMachineProperties 9758 err = json.Unmarshal(*v, &virtualMachineProperties) 9759 if err != nil { 9760 return err 9761 } 9762 VM.VirtualMachineProperties = &virtualMachineProperties 9763 } 9764 case "resources": 9765 if v != nil { 9766 var resources []VirtualMachineExtension 9767 err = json.Unmarshal(*v, &resources) 9768 if err != nil { 9769 return err 9770 } 9771 VM.Resources = &resources 9772 } 9773 case "identity": 9774 if v != nil { 9775 var identity VirtualMachineIdentity 9776 err = json.Unmarshal(*v, &identity) 9777 if err != nil { 9778 return err 9779 } 9780 VM.Identity = &identity 9781 } 9782 case "zones": 9783 if v != nil { 9784 var zones []string 9785 err = json.Unmarshal(*v, &zones) 9786 if err != nil { 9787 return err 9788 } 9789 VM.Zones = &zones 9790 } 9791 case "id": 9792 if v != nil { 9793 var ID string 9794 err = json.Unmarshal(*v, &ID) 9795 if err != nil { 9796 return err 9797 } 9798 VM.ID = &ID 9799 } 9800 case "name": 9801 if v != nil { 9802 var name string 9803 err = json.Unmarshal(*v, &name) 9804 if err != nil { 9805 return err 9806 } 9807 VM.Name = &name 9808 } 9809 case "type": 9810 if v != nil { 9811 var typeVar string 9812 err = json.Unmarshal(*v, &typeVar) 9813 if err != nil { 9814 return err 9815 } 9816 VM.Type = &typeVar 9817 } 9818 case "location": 9819 if v != nil { 9820 var location string 9821 err = json.Unmarshal(*v, &location) 9822 if err != nil { 9823 return err 9824 } 9825 VM.Location = &location 9826 } 9827 case "tags": 9828 if v != nil { 9829 var tags map[string]*string 9830 err = json.Unmarshal(*v, &tags) 9831 if err != nil { 9832 return err 9833 } 9834 VM.Tags = tags 9835 } 9836 } 9837 } 9838 9839 return nil 9840} 9841 9842// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 9843type VirtualMachineAgentInstanceView struct { 9844 // VMAgentVersion - The VM Agent full version. 9845 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 9846 // ExtensionHandlers - The virtual machine extension handler instance view. 9847 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 9848 // Statuses - The resource status information. 9849 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9850} 9851 9852// VirtualMachineCaptureParameters capture Virtual Machine parameters. 9853type VirtualMachineCaptureParameters struct { 9854 // VhdPrefix - The captured virtual hard disk's name prefix. 9855 VhdPrefix *string `json:"vhdPrefix,omitempty"` 9856 // DestinationContainerName - The destination container name. 9857 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 9858 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 9859 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 9860} 9861 9862// VirtualMachineCaptureResult output of virtual machine capture operation. 9863type VirtualMachineCaptureResult struct { 9864 autorest.Response `json:"-"` 9865 // Schema - READ-ONLY; the schema of the captured virtual machine 9866 Schema *string `json:"$schema,omitempty"` 9867 // ContentVersion - READ-ONLY; the version of the content 9868 ContentVersion *string `json:"contentVersion,omitempty"` 9869 // Parameters - READ-ONLY; parameters of the captured virtual machine 9870 Parameters interface{} `json:"parameters,omitempty"` 9871 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 9872 Resources *[]interface{} `json:"resources,omitempty"` 9873 // ID - Resource Id 9874 ID *string `json:"id,omitempty"` 9875} 9876 9877// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 9878func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 9879 objectMap := make(map[string]interface{}) 9880 if vmcr.ID != nil { 9881 objectMap["id"] = vmcr.ID 9882 } 9883 return json.Marshal(objectMap) 9884} 9885 9886// VirtualMachineExtension describes a Virtual Machine Extension. 9887type VirtualMachineExtension struct { 9888 autorest.Response `json:"-"` 9889 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 9890 // ID - READ-ONLY; Resource Id 9891 ID *string `json:"id,omitempty"` 9892 // Name - READ-ONLY; Resource name 9893 Name *string `json:"name,omitempty"` 9894 // Type - READ-ONLY; Resource type 9895 Type *string `json:"type,omitempty"` 9896 // Location - Resource location 9897 Location *string `json:"location,omitempty"` 9898 // Tags - Resource tags 9899 Tags map[string]*string `json:"tags"` 9900} 9901 9902// MarshalJSON is the custom marshaler for VirtualMachineExtension. 9903func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 9904 objectMap := make(map[string]interface{}) 9905 if vme.VirtualMachineExtensionProperties != nil { 9906 objectMap["properties"] = vme.VirtualMachineExtensionProperties 9907 } 9908 if vme.Location != nil { 9909 objectMap["location"] = vme.Location 9910 } 9911 if vme.Tags != nil { 9912 objectMap["tags"] = vme.Tags 9913 } 9914 return json.Marshal(objectMap) 9915} 9916 9917// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 9918func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 9919 var m map[string]*json.RawMessage 9920 err := json.Unmarshal(body, &m) 9921 if err != nil { 9922 return err 9923 } 9924 for k, v := range m { 9925 switch k { 9926 case "properties": 9927 if v != nil { 9928 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 9929 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 9930 if err != nil { 9931 return err 9932 } 9933 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 9934 } 9935 case "id": 9936 if v != nil { 9937 var ID string 9938 err = json.Unmarshal(*v, &ID) 9939 if err != nil { 9940 return err 9941 } 9942 vme.ID = &ID 9943 } 9944 case "name": 9945 if v != nil { 9946 var name string 9947 err = json.Unmarshal(*v, &name) 9948 if err != nil { 9949 return err 9950 } 9951 vme.Name = &name 9952 } 9953 case "type": 9954 if v != nil { 9955 var typeVar string 9956 err = json.Unmarshal(*v, &typeVar) 9957 if err != nil { 9958 return err 9959 } 9960 vme.Type = &typeVar 9961 } 9962 case "location": 9963 if v != nil { 9964 var location string 9965 err = json.Unmarshal(*v, &location) 9966 if err != nil { 9967 return err 9968 } 9969 vme.Location = &location 9970 } 9971 case "tags": 9972 if v != nil { 9973 var tags map[string]*string 9974 err = json.Unmarshal(*v, &tags) 9975 if err != nil { 9976 return err 9977 } 9978 vme.Tags = tags 9979 } 9980 } 9981 } 9982 9983 return nil 9984} 9985 9986// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 9987type VirtualMachineExtensionHandlerInstanceView struct { 9988 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9989 Type *string `json:"type,omitempty"` 9990 // TypeHandlerVersion - Specifies the version of the script handler. 9991 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9992 // Status - The extension handler status. 9993 Status *InstanceViewStatus `json:"status,omitempty"` 9994} 9995 9996// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 9997type VirtualMachineExtensionImage struct { 9998 autorest.Response `json:"-"` 9999 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 10000 // ID - READ-ONLY; Resource Id 10001 ID *string `json:"id,omitempty"` 10002 // Name - READ-ONLY; Resource name 10003 Name *string `json:"name,omitempty"` 10004 // Type - READ-ONLY; Resource type 10005 Type *string `json:"type,omitempty"` 10006 // Location - Resource location 10007 Location *string `json:"location,omitempty"` 10008 // Tags - Resource tags 10009 Tags map[string]*string `json:"tags"` 10010} 10011 10012// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 10013func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 10014 objectMap := make(map[string]interface{}) 10015 if vmei.VirtualMachineExtensionImageProperties != nil { 10016 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 10017 } 10018 if vmei.Location != nil { 10019 objectMap["location"] = vmei.Location 10020 } 10021 if vmei.Tags != nil { 10022 objectMap["tags"] = vmei.Tags 10023 } 10024 return json.Marshal(objectMap) 10025} 10026 10027// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 10028func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 10029 var m map[string]*json.RawMessage 10030 err := json.Unmarshal(body, &m) 10031 if err != nil { 10032 return err 10033 } 10034 for k, v := range m { 10035 switch k { 10036 case "properties": 10037 if v != nil { 10038 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 10039 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 10040 if err != nil { 10041 return err 10042 } 10043 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 10044 } 10045 case "id": 10046 if v != nil { 10047 var ID string 10048 err = json.Unmarshal(*v, &ID) 10049 if err != nil { 10050 return err 10051 } 10052 vmei.ID = &ID 10053 } 10054 case "name": 10055 if v != nil { 10056 var name string 10057 err = json.Unmarshal(*v, &name) 10058 if err != nil { 10059 return err 10060 } 10061 vmei.Name = &name 10062 } 10063 case "type": 10064 if v != nil { 10065 var typeVar string 10066 err = json.Unmarshal(*v, &typeVar) 10067 if err != nil { 10068 return err 10069 } 10070 vmei.Type = &typeVar 10071 } 10072 case "location": 10073 if v != nil { 10074 var location string 10075 err = json.Unmarshal(*v, &location) 10076 if err != nil { 10077 return err 10078 } 10079 vmei.Location = &location 10080 } 10081 case "tags": 10082 if v != nil { 10083 var tags map[string]*string 10084 err = json.Unmarshal(*v, &tags) 10085 if err != nil { 10086 return err 10087 } 10088 vmei.Tags = tags 10089 } 10090 } 10091 } 10092 10093 return nil 10094} 10095 10096// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 10097type VirtualMachineExtensionImageProperties struct { 10098 // OperatingSystem - The operating system this extension supports. 10099 OperatingSystem *string `json:"operatingSystem,omitempty"` 10100 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 10101 ComputeRole *string `json:"computeRole,omitempty"` 10102 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 10103 HandlerSchema *string `json:"handlerSchema,omitempty"` 10104 // 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. 10105 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 10106 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 10107 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 10108} 10109 10110// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 10111type VirtualMachineExtensionInstanceView struct { 10112 // Name - The virtual machine extension name. 10113 Name *string `json:"name,omitempty"` 10114 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 10115 Type *string `json:"type,omitempty"` 10116 // TypeHandlerVersion - Specifies the version of the script handler. 10117 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 10118 // Substatuses - The resource status information. 10119 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 10120 // Statuses - The resource status information. 10121 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 10122} 10123 10124// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 10125type VirtualMachineExtensionProperties struct { 10126 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 10127 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 10128 // Publisher - The name of the extension handler publisher. 10129 Publisher *string `json:"publisher,omitempty"` 10130 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 10131 Type *string `json:"type,omitempty"` 10132 // TypeHandlerVersion - Specifies the version of the script handler. 10133 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 10134 // 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. 10135 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 10136 // Settings - Json formatted public settings for the extension. 10137 Settings interface{} `json:"settings,omitempty"` 10138 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 10139 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 10140 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10141 ProvisioningState *string `json:"provisioningState,omitempty"` 10142 // InstanceView - The virtual machine extension instance view. 10143 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 10144} 10145 10146// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 10147func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 10148 objectMap := make(map[string]interface{}) 10149 if vmep.ForceUpdateTag != nil { 10150 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 10151 } 10152 if vmep.Publisher != nil { 10153 objectMap["publisher"] = vmep.Publisher 10154 } 10155 if vmep.Type != nil { 10156 objectMap["type"] = vmep.Type 10157 } 10158 if vmep.TypeHandlerVersion != nil { 10159 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 10160 } 10161 if vmep.AutoUpgradeMinorVersion != nil { 10162 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 10163 } 10164 if vmep.Settings != nil { 10165 objectMap["settings"] = vmep.Settings 10166 } 10167 if vmep.ProtectedSettings != nil { 10168 objectMap["protectedSettings"] = vmep.ProtectedSettings 10169 } 10170 if vmep.InstanceView != nil { 10171 objectMap["instanceView"] = vmep.InstanceView 10172 } 10173 return json.Marshal(objectMap) 10174} 10175 10176// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 10177// a long-running operation. 10178type VirtualMachineExtensionsCreateOrUpdateFuture struct { 10179 azure.FutureAPI 10180 // Result returns the result of the asynchronous operation. 10181 // If the operation has not completed it will return an error. 10182 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 10183} 10184 10185// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10186func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10187 var azFuture azure.Future 10188 if err := json.Unmarshal(body, &azFuture); err != nil { 10189 return err 10190 } 10191 future.FutureAPI = &azFuture 10192 future.Result = future.result 10193 return nil 10194} 10195 10196// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 10197func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 10198 var done bool 10199 done, err = future.DoneWithContext(context.Background(), client) 10200 if err != nil { 10201 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10202 return 10203 } 10204 if !done { 10205 vme.Response.Response = future.Response() 10206 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 10207 return 10208 } 10209 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10210 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 10211 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 10212 if err != nil { 10213 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 10214 } 10215 } 10216 return 10217} 10218 10219// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 10220// long-running operation. 10221type VirtualMachineExtensionsDeleteFuture struct { 10222 azure.FutureAPI 10223 // Result returns the result of the asynchronous operation. 10224 // If the operation has not completed it will return an error. 10225 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 10226} 10227 10228// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10229func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 10230 var azFuture azure.Future 10231 if err := json.Unmarshal(body, &azFuture); err != nil { 10232 return err 10233 } 10234 future.FutureAPI = &azFuture 10235 future.Result = future.result 10236 return nil 10237} 10238 10239// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 10240func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 10241 var done bool 10242 done, err = future.DoneWithContext(context.Background(), client) 10243 if err != nil { 10244 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 10245 return 10246 } 10247 if !done { 10248 ar.Response = future.Response() 10249 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 10250 return 10251 } 10252 ar.Response = future.Response() 10253 return 10254} 10255 10256// VirtualMachineExtensionsListResult the List Extension operation response 10257type VirtualMachineExtensionsListResult struct { 10258 autorest.Response `json:"-"` 10259 // Value - The list of extensions 10260 Value *[]VirtualMachineExtension `json:"value,omitempty"` 10261} 10262 10263// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 10264// long-running operation. 10265type VirtualMachineExtensionsUpdateFuture struct { 10266 azure.FutureAPI 10267 // Result returns the result of the asynchronous operation. 10268 // If the operation has not completed it will return an error. 10269 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 10270} 10271 10272// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10273func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 10274 var azFuture azure.Future 10275 if err := json.Unmarshal(body, &azFuture); err != nil { 10276 return err 10277 } 10278 future.FutureAPI = &azFuture 10279 future.Result = future.result 10280 return nil 10281} 10282 10283// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 10284func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 10285 var done bool 10286 done, err = future.DoneWithContext(context.Background(), client) 10287 if err != nil { 10288 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 10289 return 10290 } 10291 if !done { 10292 vme.Response.Response = future.Response() 10293 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 10294 return 10295 } 10296 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10297 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 10298 vme, err = client.UpdateResponder(vme.Response.Response) 10299 if err != nil { 10300 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 10301 } 10302 } 10303 return 10304} 10305 10306// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 10307type VirtualMachineExtensionUpdate struct { 10308 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 10309 // Tags - Resource tags 10310 Tags map[string]*string `json:"tags"` 10311} 10312 10313// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 10314func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 10315 objectMap := make(map[string]interface{}) 10316 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 10317 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 10318 } 10319 if vmeu.Tags != nil { 10320 objectMap["tags"] = vmeu.Tags 10321 } 10322 return json.Marshal(objectMap) 10323} 10324 10325// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 10326func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 10327 var m map[string]*json.RawMessage 10328 err := json.Unmarshal(body, &m) 10329 if err != nil { 10330 return err 10331 } 10332 for k, v := range m { 10333 switch k { 10334 case "properties": 10335 if v != nil { 10336 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 10337 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 10338 if err != nil { 10339 return err 10340 } 10341 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 10342 } 10343 case "tags": 10344 if v != nil { 10345 var tags map[string]*string 10346 err = json.Unmarshal(*v, &tags) 10347 if err != nil { 10348 return err 10349 } 10350 vmeu.Tags = tags 10351 } 10352 } 10353 } 10354 10355 return nil 10356} 10357 10358// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 10359type VirtualMachineExtensionUpdateProperties struct { 10360 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 10361 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 10362 // Publisher - The name of the extension handler publisher. 10363 Publisher *string `json:"publisher,omitempty"` 10364 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 10365 Type *string `json:"type,omitempty"` 10366 // TypeHandlerVersion - Specifies the version of the script handler. 10367 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 10368 // 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. 10369 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 10370 // Settings - Json formatted public settings for the extension. 10371 Settings interface{} `json:"settings,omitempty"` 10372 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 10373 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 10374} 10375 10376// VirtualMachineHealthStatus the health status of the VM. 10377type VirtualMachineHealthStatus struct { 10378 // Status - READ-ONLY; The health status information for the VM. 10379 Status *InstanceViewStatus `json:"status,omitempty"` 10380} 10381 10382// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. 10383func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { 10384 objectMap := make(map[string]interface{}) 10385 return json.Marshal(objectMap) 10386} 10387 10388// VirtualMachineIdentity identity for the virtual machine. 10389type VirtualMachineIdentity struct { 10390 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 10391 PrincipalID *string `json:"principalId,omitempty"` 10392 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 10393 TenantID *string `json:"tenantId,omitempty"` 10394 // 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' 10395 Type ResourceIdentityType `json:"type,omitempty"` 10396 // 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}'. 10397 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 10398} 10399 10400// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 10401func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 10402 objectMap := make(map[string]interface{}) 10403 if vmi.Type != "" { 10404 objectMap["type"] = vmi.Type 10405 } 10406 if vmi.UserAssignedIdentities != nil { 10407 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 10408 } 10409 return json.Marshal(objectMap) 10410} 10411 10412// VirtualMachineIdentityUserAssignedIdentitiesValue ... 10413type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 10414 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 10415 PrincipalID *string `json:"principalId,omitempty"` 10416 // ClientID - READ-ONLY; The client id of user assigned identity. 10417 ClientID *string `json:"clientId,omitempty"` 10418} 10419 10420// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. 10421func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 10422 objectMap := make(map[string]interface{}) 10423 return json.Marshal(objectMap) 10424} 10425 10426// VirtualMachineImage describes a Virtual Machine Image. 10427type VirtualMachineImage struct { 10428 autorest.Response `json:"-"` 10429 *VirtualMachineImageProperties `json:"properties,omitempty"` 10430 // Name - The name of the resource. 10431 Name *string `json:"name,omitempty"` 10432 // Location - The supported Azure location of the resource. 10433 Location *string `json:"location,omitempty"` 10434 // 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). 10435 Tags map[string]*string `json:"tags"` 10436 // ID - Resource Id 10437 ID *string `json:"id,omitempty"` 10438} 10439 10440// MarshalJSON is the custom marshaler for VirtualMachineImage. 10441func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 10442 objectMap := make(map[string]interface{}) 10443 if vmi.VirtualMachineImageProperties != nil { 10444 objectMap["properties"] = vmi.VirtualMachineImageProperties 10445 } 10446 if vmi.Name != nil { 10447 objectMap["name"] = vmi.Name 10448 } 10449 if vmi.Location != nil { 10450 objectMap["location"] = vmi.Location 10451 } 10452 if vmi.Tags != nil { 10453 objectMap["tags"] = vmi.Tags 10454 } 10455 if vmi.ID != nil { 10456 objectMap["id"] = vmi.ID 10457 } 10458 return json.Marshal(objectMap) 10459} 10460 10461// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 10462func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 10463 var m map[string]*json.RawMessage 10464 err := json.Unmarshal(body, &m) 10465 if err != nil { 10466 return err 10467 } 10468 for k, v := range m { 10469 switch k { 10470 case "properties": 10471 if v != nil { 10472 var virtualMachineImageProperties VirtualMachineImageProperties 10473 err = json.Unmarshal(*v, &virtualMachineImageProperties) 10474 if err != nil { 10475 return err 10476 } 10477 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 10478 } 10479 case "name": 10480 if v != nil { 10481 var name string 10482 err = json.Unmarshal(*v, &name) 10483 if err != nil { 10484 return err 10485 } 10486 vmi.Name = &name 10487 } 10488 case "location": 10489 if v != nil { 10490 var location string 10491 err = json.Unmarshal(*v, &location) 10492 if err != nil { 10493 return err 10494 } 10495 vmi.Location = &location 10496 } 10497 case "tags": 10498 if v != nil { 10499 var tags map[string]*string 10500 err = json.Unmarshal(*v, &tags) 10501 if err != nil { 10502 return err 10503 } 10504 vmi.Tags = tags 10505 } 10506 case "id": 10507 if v != nil { 10508 var ID string 10509 err = json.Unmarshal(*v, &ID) 10510 if err != nil { 10511 return err 10512 } 10513 vmi.ID = &ID 10514 } 10515 } 10516 } 10517 10518 return nil 10519} 10520 10521// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 10522type VirtualMachineImageProperties struct { 10523 Plan *PurchasePlan `json:"plan,omitempty"` 10524 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 10525 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 10526 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 10527 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 10528 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 10529} 10530 10531// VirtualMachineImageResource virtual machine image resource information. 10532type VirtualMachineImageResource struct { 10533 // Name - The name of the resource. 10534 Name *string `json:"name,omitempty"` 10535 // Location - The supported Azure location of the resource. 10536 Location *string `json:"location,omitempty"` 10537 // 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). 10538 Tags map[string]*string `json:"tags"` 10539 // ID - Resource Id 10540 ID *string `json:"id,omitempty"` 10541} 10542 10543// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 10544func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 10545 objectMap := make(map[string]interface{}) 10546 if vmir.Name != nil { 10547 objectMap["name"] = vmir.Name 10548 } 10549 if vmir.Location != nil { 10550 objectMap["location"] = vmir.Location 10551 } 10552 if vmir.Tags != nil { 10553 objectMap["tags"] = vmir.Tags 10554 } 10555 if vmir.ID != nil { 10556 objectMap["id"] = vmir.ID 10557 } 10558 return json.Marshal(objectMap) 10559} 10560 10561// VirtualMachineInstanceView the instance view of a virtual machine. 10562type VirtualMachineInstanceView struct { 10563 autorest.Response `json:"-"` 10564 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 10565 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 10566 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 10567 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 10568 // ComputerName - The computer name assigned to the virtual machine. 10569 ComputerName *string `json:"computerName,omitempty"` 10570 // OsName - The Operating System running on the virtual machine. 10571 OsName *string `json:"osName,omitempty"` 10572 // OsVersion - The version of Operating System running on the virtual machine. 10573 OsVersion *string `json:"osVersion,omitempty"` 10574 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 10575 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 10576 // RdpThumbPrint - The Remote desktop certificate thumbprint. 10577 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 10578 // VMAgent - The VM Agent running on the virtual machine. 10579 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 10580 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 10581 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 10582 // Disks - The virtual machine disk information. 10583 Disks *[]DiskInstanceView `json:"disks,omitempty"` 10584 // Extensions - The extensions information. 10585 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 10586 // 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. 10587 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 10588 // Statuses - The resource status information. 10589 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 10590} 10591 10592// VirtualMachineListResult the List Virtual Machine operation response. 10593type VirtualMachineListResult struct { 10594 autorest.Response `json:"-"` 10595 // Value - The list of virtual machines. 10596 Value *[]VirtualMachine `json:"value,omitempty"` 10597 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 10598 NextLink *string `json:"nextLink,omitempty"` 10599} 10600 10601// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 10602type VirtualMachineListResultIterator struct { 10603 i int 10604 page VirtualMachineListResultPage 10605} 10606 10607// NextWithContext advances to the next value. If there was an error making 10608// the request the iterator does not advance and the error is returned. 10609func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 10610 if tracing.IsEnabled() { 10611 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 10612 defer func() { 10613 sc := -1 10614 if iter.Response().Response.Response != nil { 10615 sc = iter.Response().Response.Response.StatusCode 10616 } 10617 tracing.EndSpan(ctx, sc, err) 10618 }() 10619 } 10620 iter.i++ 10621 if iter.i < len(iter.page.Values()) { 10622 return nil 10623 } 10624 err = iter.page.NextWithContext(ctx) 10625 if err != nil { 10626 iter.i-- 10627 return err 10628 } 10629 iter.i = 0 10630 return nil 10631} 10632 10633// Next advances to the next value. If there was an error making 10634// the request the iterator does not advance and the error is returned. 10635// Deprecated: Use NextWithContext() instead. 10636func (iter *VirtualMachineListResultIterator) Next() error { 10637 return iter.NextWithContext(context.Background()) 10638} 10639 10640// NotDone returns true if the enumeration should be started or is not yet complete. 10641func (iter VirtualMachineListResultIterator) NotDone() bool { 10642 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10643} 10644 10645// Response returns the raw server response from the last page request. 10646func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 10647 return iter.page.Response() 10648} 10649 10650// Value returns the current value or a zero-initialized value if the 10651// iterator has advanced beyond the end of the collection. 10652func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 10653 if !iter.page.NotDone() { 10654 return VirtualMachine{} 10655 } 10656 return iter.page.Values()[iter.i] 10657} 10658 10659// Creates a new instance of the VirtualMachineListResultIterator type. 10660func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 10661 return VirtualMachineListResultIterator{page: page} 10662} 10663 10664// IsEmpty returns true if the ListResult contains no values. 10665func (vmlr VirtualMachineListResult) IsEmpty() bool { 10666 return vmlr.Value == nil || len(*vmlr.Value) == 0 10667} 10668 10669// hasNextLink returns true if the NextLink is not empty. 10670func (vmlr VirtualMachineListResult) hasNextLink() bool { 10671 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 10672} 10673 10674// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 10675// It returns nil if no more results exist. 10676func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 10677 if !vmlr.hasNextLink() { 10678 return nil, nil 10679 } 10680 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10681 autorest.AsJSON(), 10682 autorest.AsGet(), 10683 autorest.WithBaseURL(to.String(vmlr.NextLink))) 10684} 10685 10686// VirtualMachineListResultPage contains a page of VirtualMachine values. 10687type VirtualMachineListResultPage struct { 10688 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 10689 vmlr VirtualMachineListResult 10690} 10691 10692// NextWithContext advances to the next page of values. If there was an error making 10693// the request the page does not advance and the error is returned. 10694func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 10695 if tracing.IsEnabled() { 10696 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 10697 defer func() { 10698 sc := -1 10699 if page.Response().Response.Response != nil { 10700 sc = page.Response().Response.Response.StatusCode 10701 } 10702 tracing.EndSpan(ctx, sc, err) 10703 }() 10704 } 10705 for { 10706 next, err := page.fn(ctx, page.vmlr) 10707 if err != nil { 10708 return err 10709 } 10710 page.vmlr = next 10711 if !next.hasNextLink() || !next.IsEmpty() { 10712 break 10713 } 10714 } 10715 return nil 10716} 10717 10718// Next advances to the next page of values. If there was an error making 10719// the request the page does not advance and the error is returned. 10720// Deprecated: Use NextWithContext() instead. 10721func (page *VirtualMachineListResultPage) Next() error { 10722 return page.NextWithContext(context.Background()) 10723} 10724 10725// NotDone returns true if the page enumeration should be started or is not yet complete. 10726func (page VirtualMachineListResultPage) NotDone() bool { 10727 return !page.vmlr.IsEmpty() 10728} 10729 10730// Response returns the raw server response from the last page request. 10731func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 10732 return page.vmlr 10733} 10734 10735// Values returns the slice of values for the current page or nil if there are no values. 10736func (page VirtualMachineListResultPage) Values() []VirtualMachine { 10737 if page.vmlr.IsEmpty() { 10738 return nil 10739 } 10740 return *page.vmlr.Value 10741} 10742 10743// Creates a new instance of the VirtualMachineListResultPage type. 10744func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 10745 return VirtualMachineListResultPage{ 10746 fn: getNextPage, 10747 vmlr: cur, 10748 } 10749} 10750 10751// VirtualMachineProperties describes the properties of a Virtual Machine. 10752type VirtualMachineProperties struct { 10753 // HardwareProfile - Specifies the hardware settings for the virtual machine. 10754 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 10755 // StorageProfile - Specifies the storage settings for the virtual machine disks. 10756 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 10757 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 10758 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10759 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 10760 OsProfile *OSProfile `json:"osProfile,omitempty"` 10761 // NetworkProfile - Specifies the network interfaces of the virtual machine. 10762 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 10763 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 10764 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 10765 // 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. 10766 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 10767 // 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 10768 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 10769 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 10770 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 10771 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' 10772 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 10773 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported 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' 10774 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 10775 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 10776 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 10777 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 10778 Host *SubResource `json:"host,omitempty"` 10779 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10780 ProvisioningState *string `json:"provisioningState,omitempty"` 10781 // InstanceView - READ-ONLY; The virtual machine instance view. 10782 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 10783 // 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 10784 LicenseType *string `json:"licenseType,omitempty"` 10785 // 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. 10786 VMID *string `json:"vmId,omitempty"` 10787} 10788 10789// MarshalJSON is the custom marshaler for VirtualMachineProperties. 10790func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 10791 objectMap := make(map[string]interface{}) 10792 if vmp.HardwareProfile != nil { 10793 objectMap["hardwareProfile"] = vmp.HardwareProfile 10794 } 10795 if vmp.StorageProfile != nil { 10796 objectMap["storageProfile"] = vmp.StorageProfile 10797 } 10798 if vmp.AdditionalCapabilities != nil { 10799 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 10800 } 10801 if vmp.OsProfile != nil { 10802 objectMap["osProfile"] = vmp.OsProfile 10803 } 10804 if vmp.NetworkProfile != nil { 10805 objectMap["networkProfile"] = vmp.NetworkProfile 10806 } 10807 if vmp.DiagnosticsProfile != nil { 10808 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 10809 } 10810 if vmp.AvailabilitySet != nil { 10811 objectMap["availabilitySet"] = vmp.AvailabilitySet 10812 } 10813 if vmp.VirtualMachineScaleSet != nil { 10814 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 10815 } 10816 if vmp.ProximityPlacementGroup != nil { 10817 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 10818 } 10819 if vmp.Priority != "" { 10820 objectMap["priority"] = vmp.Priority 10821 } 10822 if vmp.EvictionPolicy != "" { 10823 objectMap["evictionPolicy"] = vmp.EvictionPolicy 10824 } 10825 if vmp.BillingProfile != nil { 10826 objectMap["billingProfile"] = vmp.BillingProfile 10827 } 10828 if vmp.Host != nil { 10829 objectMap["host"] = vmp.Host 10830 } 10831 if vmp.LicenseType != nil { 10832 objectMap["licenseType"] = vmp.LicenseType 10833 } 10834 return json.Marshal(objectMap) 10835} 10836 10837// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 10838// will always be reimaged 10839type VirtualMachineReimageParameters struct { 10840 // 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. 10841 TempDisk *bool `json:"tempDisk,omitempty"` 10842} 10843 10844// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 10845type VirtualMachineScaleSet struct { 10846 autorest.Response `json:"-"` 10847 // Sku - The virtual machine scale set sku. 10848 Sku *Sku `json:"sku,omitempty"` 10849 // 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**. 10850 Plan *Plan `json:"plan,omitempty"` 10851 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 10852 // Identity - The identity of the virtual machine scale set, if configured. 10853 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 10854 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 10855 Zones *[]string `json:"zones,omitempty"` 10856 // ID - READ-ONLY; Resource Id 10857 ID *string `json:"id,omitempty"` 10858 // Name - READ-ONLY; Resource name 10859 Name *string `json:"name,omitempty"` 10860 // Type - READ-ONLY; Resource type 10861 Type *string `json:"type,omitempty"` 10862 // Location - Resource location 10863 Location *string `json:"location,omitempty"` 10864 // Tags - Resource tags 10865 Tags map[string]*string `json:"tags"` 10866} 10867 10868// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 10869func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 10870 objectMap := make(map[string]interface{}) 10871 if vmss.Sku != nil { 10872 objectMap["sku"] = vmss.Sku 10873 } 10874 if vmss.Plan != nil { 10875 objectMap["plan"] = vmss.Plan 10876 } 10877 if vmss.VirtualMachineScaleSetProperties != nil { 10878 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 10879 } 10880 if vmss.Identity != nil { 10881 objectMap["identity"] = vmss.Identity 10882 } 10883 if vmss.Zones != nil { 10884 objectMap["zones"] = vmss.Zones 10885 } 10886 if vmss.Location != nil { 10887 objectMap["location"] = vmss.Location 10888 } 10889 if vmss.Tags != nil { 10890 objectMap["tags"] = vmss.Tags 10891 } 10892 return json.Marshal(objectMap) 10893} 10894 10895// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 10896func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 10897 var m map[string]*json.RawMessage 10898 err := json.Unmarshal(body, &m) 10899 if err != nil { 10900 return err 10901 } 10902 for k, v := range m { 10903 switch k { 10904 case "sku": 10905 if v != nil { 10906 var sku Sku 10907 err = json.Unmarshal(*v, &sku) 10908 if err != nil { 10909 return err 10910 } 10911 vmss.Sku = &sku 10912 } 10913 case "plan": 10914 if v != nil { 10915 var plan Plan 10916 err = json.Unmarshal(*v, &plan) 10917 if err != nil { 10918 return err 10919 } 10920 vmss.Plan = &plan 10921 } 10922 case "properties": 10923 if v != nil { 10924 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 10925 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 10926 if err != nil { 10927 return err 10928 } 10929 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 10930 } 10931 case "identity": 10932 if v != nil { 10933 var identity VirtualMachineScaleSetIdentity 10934 err = json.Unmarshal(*v, &identity) 10935 if err != nil { 10936 return err 10937 } 10938 vmss.Identity = &identity 10939 } 10940 case "zones": 10941 if v != nil { 10942 var zones []string 10943 err = json.Unmarshal(*v, &zones) 10944 if err != nil { 10945 return err 10946 } 10947 vmss.Zones = &zones 10948 } 10949 case "id": 10950 if v != nil { 10951 var ID string 10952 err = json.Unmarshal(*v, &ID) 10953 if err != nil { 10954 return err 10955 } 10956 vmss.ID = &ID 10957 } 10958 case "name": 10959 if v != nil { 10960 var name string 10961 err = json.Unmarshal(*v, &name) 10962 if err != nil { 10963 return err 10964 } 10965 vmss.Name = &name 10966 } 10967 case "type": 10968 if v != nil { 10969 var typeVar string 10970 err = json.Unmarshal(*v, &typeVar) 10971 if err != nil { 10972 return err 10973 } 10974 vmss.Type = &typeVar 10975 } 10976 case "location": 10977 if v != nil { 10978 var location string 10979 err = json.Unmarshal(*v, &location) 10980 if err != nil { 10981 return err 10982 } 10983 vmss.Location = &location 10984 } 10985 case "tags": 10986 if v != nil { 10987 var tags map[string]*string 10988 err = json.Unmarshal(*v, &tags) 10989 if err != nil { 10990 return err 10991 } 10992 vmss.Tags = tags 10993 } 10994 } 10995 } 10996 10997 return nil 10998} 10999 11000// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 11001type VirtualMachineScaleSetDataDisk struct { 11002 // Name - The disk name. 11003 Name *string `json:"name,omitempty"` 11004 // 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. 11005 Lun *int32 `json:"lun,omitempty"` 11006 // 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' 11007 Caching CachingTypes `json:"caching,omitempty"` 11008 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 11009 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 11010 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 11011 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 11012 // 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 11013 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 11014 // ManagedDisk - The managed disk parameters. 11015 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 11016 // 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. 11017 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 11018 // 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. 11019 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 11020} 11021 11022// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 11023type VirtualMachineScaleSetExtension struct { 11024 autorest.Response `json:"-"` 11025 // Name - The name of the extension. 11026 Name *string `json:"name,omitempty"` 11027 // Type - READ-ONLY; Resource type 11028 Type *string `json:"type,omitempty"` 11029 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 11030 // ID - READ-ONLY; Resource Id 11031 ID *string `json:"id,omitempty"` 11032} 11033 11034// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 11035func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 11036 objectMap := make(map[string]interface{}) 11037 if vmsse.Name != nil { 11038 objectMap["name"] = vmsse.Name 11039 } 11040 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 11041 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 11042 } 11043 return json.Marshal(objectMap) 11044} 11045 11046// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 11047func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 11048 var m map[string]*json.RawMessage 11049 err := json.Unmarshal(body, &m) 11050 if err != nil { 11051 return err 11052 } 11053 for k, v := range m { 11054 switch k { 11055 case "name": 11056 if v != nil { 11057 var name string 11058 err = json.Unmarshal(*v, &name) 11059 if err != nil { 11060 return err 11061 } 11062 vmsse.Name = &name 11063 } 11064 case "type": 11065 if v != nil { 11066 var typeVar string 11067 err = json.Unmarshal(*v, &typeVar) 11068 if err != nil { 11069 return err 11070 } 11071 vmsse.Type = &typeVar 11072 } 11073 case "properties": 11074 if v != nil { 11075 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 11076 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 11077 if err != nil { 11078 return err 11079 } 11080 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 11081 } 11082 case "id": 11083 if v != nil { 11084 var ID string 11085 err = json.Unmarshal(*v, &ID) 11086 if err != nil { 11087 return err 11088 } 11089 vmsse.ID = &ID 11090 } 11091 } 11092 } 11093 11094 return nil 11095} 11096 11097// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 11098type VirtualMachineScaleSetExtensionListResult struct { 11099 autorest.Response `json:"-"` 11100 // Value - The list of VM scale set extensions. 11101 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 11102 // 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. 11103 NextLink *string `json:"nextLink,omitempty"` 11104} 11105 11106// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 11107// VirtualMachineScaleSetExtension values. 11108type VirtualMachineScaleSetExtensionListResultIterator struct { 11109 i int 11110 page VirtualMachineScaleSetExtensionListResultPage 11111} 11112 11113// NextWithContext advances to the next value. If there was an error making 11114// the request the iterator does not advance and the error is returned. 11115func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 11116 if tracing.IsEnabled() { 11117 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 11118 defer func() { 11119 sc := -1 11120 if iter.Response().Response.Response != nil { 11121 sc = iter.Response().Response.Response.StatusCode 11122 } 11123 tracing.EndSpan(ctx, sc, err) 11124 }() 11125 } 11126 iter.i++ 11127 if iter.i < len(iter.page.Values()) { 11128 return nil 11129 } 11130 err = iter.page.NextWithContext(ctx) 11131 if err != nil { 11132 iter.i-- 11133 return err 11134 } 11135 iter.i = 0 11136 return nil 11137} 11138 11139// Next advances to the next value. If there was an error making 11140// the request the iterator does not advance and the error is returned. 11141// Deprecated: Use NextWithContext() instead. 11142func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 11143 return iter.NextWithContext(context.Background()) 11144} 11145 11146// NotDone returns true if the enumeration should be started or is not yet complete. 11147func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 11148 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11149} 11150 11151// Response returns the raw server response from the last page request. 11152func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 11153 return iter.page.Response() 11154} 11155 11156// Value returns the current value or a zero-initialized value if the 11157// iterator has advanced beyond the end of the collection. 11158func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 11159 if !iter.page.NotDone() { 11160 return VirtualMachineScaleSetExtension{} 11161 } 11162 return iter.page.Values()[iter.i] 11163} 11164 11165// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 11166func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 11167 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 11168} 11169 11170// IsEmpty returns true if the ListResult contains no values. 11171func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 11172 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 11173} 11174 11175// hasNextLink returns true if the NextLink is not empty. 11176func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 11177 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 11178} 11179 11180// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 11181// It returns nil if no more results exist. 11182func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 11183 if !vmsselr.hasNextLink() { 11184 return nil, nil 11185 } 11186 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11187 autorest.AsJSON(), 11188 autorest.AsGet(), 11189 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 11190} 11191 11192// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 11193type VirtualMachineScaleSetExtensionListResultPage struct { 11194 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 11195 vmsselr VirtualMachineScaleSetExtensionListResult 11196} 11197 11198// NextWithContext advances to the next page of values. If there was an error making 11199// the request the page does not advance and the error is returned. 11200func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 11201 if tracing.IsEnabled() { 11202 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 11203 defer func() { 11204 sc := -1 11205 if page.Response().Response.Response != nil { 11206 sc = page.Response().Response.Response.StatusCode 11207 } 11208 tracing.EndSpan(ctx, sc, err) 11209 }() 11210 } 11211 for { 11212 next, err := page.fn(ctx, page.vmsselr) 11213 if err != nil { 11214 return err 11215 } 11216 page.vmsselr = next 11217 if !next.hasNextLink() || !next.IsEmpty() { 11218 break 11219 } 11220 } 11221 return nil 11222} 11223 11224// Next advances to the next page of values. If there was an error making 11225// the request the page does not advance and the error is returned. 11226// Deprecated: Use NextWithContext() instead. 11227func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 11228 return page.NextWithContext(context.Background()) 11229} 11230 11231// NotDone returns true if the page enumeration should be started or is not yet complete. 11232func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 11233 return !page.vmsselr.IsEmpty() 11234} 11235 11236// Response returns the raw server response from the last page request. 11237func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 11238 return page.vmsselr 11239} 11240 11241// Values returns the slice of values for the current page or nil if there are no values. 11242func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 11243 if page.vmsselr.IsEmpty() { 11244 return nil 11245 } 11246 return *page.vmsselr.Value 11247} 11248 11249// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 11250func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 11251 return VirtualMachineScaleSetExtensionListResultPage{ 11252 fn: getNextPage, 11253 vmsselr: cur, 11254 } 11255} 11256 11257// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 11258type VirtualMachineScaleSetExtensionProfile struct { 11259 // Extensions - The virtual machine scale set child extension resources. 11260 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 11261} 11262 11263// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 11264// Extension. 11265type VirtualMachineScaleSetExtensionProperties struct { 11266 // 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. 11267 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 11268 // Publisher - The name of the extension handler publisher. 11269 Publisher *string `json:"publisher,omitempty"` 11270 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 11271 Type *string `json:"type,omitempty"` 11272 // TypeHandlerVersion - Specifies the version of the script handler. 11273 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 11274 // 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. 11275 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 11276 // Settings - Json formatted public settings for the extension. 11277 Settings interface{} `json:"settings,omitempty"` 11278 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 11279 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 11280 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 11281 ProvisioningState *string `json:"provisioningState,omitempty"` 11282 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 11283 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 11284} 11285 11286// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 11287func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 11288 objectMap := make(map[string]interface{}) 11289 if vmssep.ForceUpdateTag != nil { 11290 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 11291 } 11292 if vmssep.Publisher != nil { 11293 objectMap["publisher"] = vmssep.Publisher 11294 } 11295 if vmssep.Type != nil { 11296 objectMap["type"] = vmssep.Type 11297 } 11298 if vmssep.TypeHandlerVersion != nil { 11299 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 11300 } 11301 if vmssep.AutoUpgradeMinorVersion != nil { 11302 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 11303 } 11304 if vmssep.Settings != nil { 11305 objectMap["settings"] = vmssep.Settings 11306 } 11307 if vmssep.ProtectedSettings != nil { 11308 objectMap["protectedSettings"] = vmssep.ProtectedSettings 11309 } 11310 if vmssep.ProvisionAfterExtensions != nil { 11311 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 11312 } 11313 return json.Marshal(objectMap) 11314} 11315 11316// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 11317// results of a long-running operation. 11318type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 11319 azure.FutureAPI 11320 // Result returns the result of the asynchronous operation. 11321 // If the operation has not completed it will return an error. 11322 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 11323} 11324 11325// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11326func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 11327 var azFuture azure.Future 11328 if err := json.Unmarshal(body, &azFuture); err != nil { 11329 return err 11330 } 11331 future.FutureAPI = &azFuture 11332 future.Result = future.result 11333 return nil 11334} 11335 11336// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 11337func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 11338 var done bool 11339 done, err = future.DoneWithContext(context.Background(), client) 11340 if err != nil { 11341 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 11342 return 11343 } 11344 if !done { 11345 vmsse.Response.Response = future.Response() 11346 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 11347 return 11348 } 11349 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11350 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 11351 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 11352 if err != nil { 11353 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 11354 } 11355 } 11356 return 11357} 11358 11359// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 11360// a long-running operation. 11361type VirtualMachineScaleSetExtensionsDeleteFuture struct { 11362 azure.FutureAPI 11363 // Result returns the result of the asynchronous operation. 11364 // If the operation has not completed it will return an error. 11365 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 11366} 11367 11368// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11369func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 11370 var azFuture azure.Future 11371 if err := json.Unmarshal(body, &azFuture); err != nil { 11372 return err 11373 } 11374 future.FutureAPI = &azFuture 11375 future.Result = future.result 11376 return nil 11377} 11378 11379// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 11380func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 11381 var done bool 11382 done, err = future.DoneWithContext(context.Background(), client) 11383 if err != nil { 11384 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 11385 return 11386 } 11387 if !done { 11388 ar.Response = future.Response() 11389 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 11390 return 11391 } 11392 ar.Response = future.Response() 11393 return 11394} 11395 11396// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 11397// a long-running operation. 11398type VirtualMachineScaleSetExtensionsUpdateFuture struct { 11399 azure.FutureAPI 11400 // Result returns the result of the asynchronous operation. 11401 // If the operation has not completed it will return an error. 11402 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 11403} 11404 11405// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11406func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 11407 var azFuture azure.Future 11408 if err := json.Unmarshal(body, &azFuture); err != nil { 11409 return err 11410 } 11411 future.FutureAPI = &azFuture 11412 future.Result = future.result 11413 return nil 11414} 11415 11416// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. 11417func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 11418 var done bool 11419 done, err = future.DoneWithContext(context.Background(), client) 11420 if err != nil { 11421 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 11422 return 11423 } 11424 if !done { 11425 vmsse.Response.Response = future.Response() 11426 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") 11427 return 11428 } 11429 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11430 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 11431 vmsse, err = client.UpdateResponder(vmsse.Response.Response) 11432 if err != nil { 11433 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 11434 } 11435 } 11436 return 11437} 11438 11439// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 11440type VirtualMachineScaleSetExtensionUpdate struct { 11441 // Name - READ-ONLY; The name of the extension. 11442 Name *string `json:"name,omitempty"` 11443 // Type - READ-ONLY; Resource type 11444 Type *string `json:"type,omitempty"` 11445 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 11446 // ID - READ-ONLY; Resource Id 11447 ID *string `json:"id,omitempty"` 11448} 11449 11450// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 11451func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 11452 objectMap := make(map[string]interface{}) 11453 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 11454 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 11455 } 11456 return json.Marshal(objectMap) 11457} 11458 11459// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 11460func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 11461 var m map[string]*json.RawMessage 11462 err := json.Unmarshal(body, &m) 11463 if err != nil { 11464 return err 11465 } 11466 for k, v := range m { 11467 switch k { 11468 case "name": 11469 if v != nil { 11470 var name string 11471 err = json.Unmarshal(*v, &name) 11472 if err != nil { 11473 return err 11474 } 11475 vmsseu.Name = &name 11476 } 11477 case "type": 11478 if v != nil { 11479 var typeVar string 11480 err = json.Unmarshal(*v, &typeVar) 11481 if err != nil { 11482 return err 11483 } 11484 vmsseu.Type = &typeVar 11485 } 11486 case "properties": 11487 if v != nil { 11488 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 11489 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 11490 if err != nil { 11491 return err 11492 } 11493 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 11494 } 11495 case "id": 11496 if v != nil { 11497 var ID string 11498 err = json.Unmarshal(*v, &ID) 11499 if err != nil { 11500 return err 11501 } 11502 vmsseu.ID = &ID 11503 } 11504 } 11505 } 11506 11507 return nil 11508} 11509 11510// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 11511type VirtualMachineScaleSetIdentity struct { 11512 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 11513 PrincipalID *string `json:"principalId,omitempty"` 11514 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 11515 TenantID *string `json:"tenantId,omitempty"` 11516 // 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' 11517 Type ResourceIdentityType `json:"type,omitempty"` 11518 // 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}'. 11519 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 11520} 11521 11522// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 11523func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 11524 objectMap := make(map[string]interface{}) 11525 if vmssi.Type != "" { 11526 objectMap["type"] = vmssi.Type 11527 } 11528 if vmssi.UserAssignedIdentities != nil { 11529 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 11530 } 11531 return json.Marshal(objectMap) 11532} 11533 11534// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 11535type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 11536 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 11537 PrincipalID *string `json:"principalId,omitempty"` 11538 // ClientID - READ-ONLY; The client id of user assigned identity. 11539 ClientID *string `json:"clientId,omitempty"` 11540} 11541 11542// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. 11543func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 11544 objectMap := make(map[string]interface{}) 11545 return json.Marshal(objectMap) 11546} 11547 11548// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 11549type VirtualMachineScaleSetInstanceView struct { 11550 autorest.Response `json:"-"` 11551 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 11552 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 11553 // Extensions - READ-ONLY; The extensions information. 11554 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 11555 // Statuses - The resource status information. 11556 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 11557 // OrchestrationServices - READ-ONLY; The orchestration services information. 11558 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 11559} 11560 11561// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 11562func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 11563 objectMap := make(map[string]interface{}) 11564 if vmssiv.Statuses != nil { 11565 objectMap["statuses"] = vmssiv.Statuses 11566 } 11567 return json.Marshal(objectMap) 11568} 11569 11570// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 11571// a virtual machine scale set. 11572type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 11573 // StatusesSummary - READ-ONLY; The extensions information. 11574 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 11575} 11576 11577// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. 11578func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 11579 objectMap := make(map[string]interface{}) 11580 return json.Marshal(objectMap) 11581} 11582 11583// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 11584// configuration. 11585type VirtualMachineScaleSetIPConfiguration struct { 11586 // Name - The IP configuration name. 11587 Name *string `json:"name,omitempty"` 11588 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 11589 // ID - Resource Id 11590 ID *string `json:"id,omitempty"` 11591} 11592 11593// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 11594func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 11595 objectMap := make(map[string]interface{}) 11596 if vmssic.Name != nil { 11597 objectMap["name"] = vmssic.Name 11598 } 11599 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 11600 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 11601 } 11602 if vmssic.ID != nil { 11603 objectMap["id"] = vmssic.ID 11604 } 11605 return json.Marshal(objectMap) 11606} 11607 11608// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 11609func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 11610 var m map[string]*json.RawMessage 11611 err := json.Unmarshal(body, &m) 11612 if err != nil { 11613 return err 11614 } 11615 for k, v := range m { 11616 switch k { 11617 case "name": 11618 if v != nil { 11619 var name string 11620 err = json.Unmarshal(*v, &name) 11621 if err != nil { 11622 return err 11623 } 11624 vmssic.Name = &name 11625 } 11626 case "properties": 11627 if v != nil { 11628 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 11629 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 11630 if err != nil { 11631 return err 11632 } 11633 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 11634 } 11635 case "id": 11636 if v != nil { 11637 var ID string 11638 err = json.Unmarshal(*v, &ID) 11639 if err != nil { 11640 return err 11641 } 11642 vmssic.ID = &ID 11643 } 11644 } 11645 } 11646 11647 return nil 11648} 11649 11650// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 11651// IP configuration properties. 11652type VirtualMachineScaleSetIPConfigurationProperties struct { 11653 // Subnet - Specifies the identifier of the subnet. 11654 Subnet *APIEntityReference `json:"subnet,omitempty"` 11655 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 11656 Primary *bool `json:"primary,omitempty"` 11657 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 11658 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 11659 // 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' 11660 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 11661 // 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. 11662 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 11663 // ApplicationSecurityGroups - Specifies an array of references to application security group. 11664 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 11665 // 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 basic sku load balancer. 11666 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 11667 // 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 basic sku load balancer. 11668 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 11669} 11670 11671// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 11672type VirtualMachineScaleSetIPTag struct { 11673 // IPTagType - IP tag type. Example: FirstPartyUsage. 11674 IPTagType *string `json:"ipTagType,omitempty"` 11675 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 11676 Tag *string `json:"tag,omitempty"` 11677} 11678 11679// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 11680// operation response. 11681type VirtualMachineScaleSetListOSUpgradeHistory struct { 11682 autorest.Response `json:"-"` 11683 // Value - The list of OS upgrades performed on the virtual machine scale set. 11684 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 11685 // 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. 11686 NextLink *string `json:"nextLink,omitempty"` 11687} 11688 11689// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 11690// UpgradeOperationHistoricalStatusInfo values. 11691type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 11692 i int 11693 page VirtualMachineScaleSetListOSUpgradeHistoryPage 11694} 11695 11696// NextWithContext advances to the next value. If there was an error making 11697// the request the iterator does not advance and the error is returned. 11698func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 11699 if tracing.IsEnabled() { 11700 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 11701 defer func() { 11702 sc := -1 11703 if iter.Response().Response.Response != nil { 11704 sc = iter.Response().Response.Response.StatusCode 11705 } 11706 tracing.EndSpan(ctx, sc, err) 11707 }() 11708 } 11709 iter.i++ 11710 if iter.i < len(iter.page.Values()) { 11711 return nil 11712 } 11713 err = iter.page.NextWithContext(ctx) 11714 if err != nil { 11715 iter.i-- 11716 return err 11717 } 11718 iter.i = 0 11719 return nil 11720} 11721 11722// Next advances to the next value. If there was an error making 11723// the request the iterator does not advance and the error is returned. 11724// Deprecated: Use NextWithContext() instead. 11725func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 11726 return iter.NextWithContext(context.Background()) 11727} 11728 11729// NotDone returns true if the enumeration should be started or is not yet complete. 11730func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 11731 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11732} 11733 11734// Response returns the raw server response from the last page request. 11735func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 11736 return iter.page.Response() 11737} 11738 11739// Value returns the current value or a zero-initialized value if the 11740// iterator has advanced beyond the end of the collection. 11741func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 11742 if !iter.page.NotDone() { 11743 return UpgradeOperationHistoricalStatusInfo{} 11744 } 11745 return iter.page.Values()[iter.i] 11746} 11747 11748// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 11749func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 11750 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 11751} 11752 11753// IsEmpty returns true if the ListResult contains no values. 11754func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 11755 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 11756} 11757 11758// hasNextLink returns true if the NextLink is not empty. 11759func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 11760 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 11761} 11762 11763// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 11764// It returns nil if no more results exist. 11765func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 11766 if !vmsslouh.hasNextLink() { 11767 return nil, nil 11768 } 11769 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11770 autorest.AsJSON(), 11771 autorest.AsGet(), 11772 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 11773} 11774 11775// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 11776// values. 11777type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 11778 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 11779 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 11780} 11781 11782// NextWithContext advances to the next page of values. If there was an error making 11783// the request the page does not advance and the error is returned. 11784func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 11785 if tracing.IsEnabled() { 11786 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 11787 defer func() { 11788 sc := -1 11789 if page.Response().Response.Response != nil { 11790 sc = page.Response().Response.Response.StatusCode 11791 } 11792 tracing.EndSpan(ctx, sc, err) 11793 }() 11794 } 11795 for { 11796 next, err := page.fn(ctx, page.vmsslouh) 11797 if err != nil { 11798 return err 11799 } 11800 page.vmsslouh = next 11801 if !next.hasNextLink() || !next.IsEmpty() { 11802 break 11803 } 11804 } 11805 return nil 11806} 11807 11808// Next advances to the next page of values. If there was an error making 11809// the request the page does not advance and the error is returned. 11810// Deprecated: Use NextWithContext() instead. 11811func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 11812 return page.NextWithContext(context.Background()) 11813} 11814 11815// NotDone returns true if the page enumeration should be started or is not yet complete. 11816func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 11817 return !page.vmsslouh.IsEmpty() 11818} 11819 11820// Response returns the raw server response from the last page request. 11821func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 11822 return page.vmsslouh 11823} 11824 11825// Values returns the slice of values for the current page or nil if there are no values. 11826func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 11827 if page.vmsslouh.IsEmpty() { 11828 return nil 11829 } 11830 return *page.vmsslouh.Value 11831} 11832 11833// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 11834func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 11835 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 11836 fn: getNextPage, 11837 vmsslouh: cur, 11838 } 11839} 11840 11841// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 11842type VirtualMachineScaleSetListResult struct { 11843 autorest.Response `json:"-"` 11844 // Value - The list of virtual machine scale sets. 11845 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 11846 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 11847 NextLink *string `json:"nextLink,omitempty"` 11848} 11849 11850// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 11851// values. 11852type VirtualMachineScaleSetListResultIterator struct { 11853 i int 11854 page VirtualMachineScaleSetListResultPage 11855} 11856 11857// NextWithContext advances to the next value. If there was an error making 11858// the request the iterator does not advance and the error is returned. 11859func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 11860 if tracing.IsEnabled() { 11861 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 11862 defer func() { 11863 sc := -1 11864 if iter.Response().Response.Response != nil { 11865 sc = iter.Response().Response.Response.StatusCode 11866 } 11867 tracing.EndSpan(ctx, sc, err) 11868 }() 11869 } 11870 iter.i++ 11871 if iter.i < len(iter.page.Values()) { 11872 return nil 11873 } 11874 err = iter.page.NextWithContext(ctx) 11875 if err != nil { 11876 iter.i-- 11877 return err 11878 } 11879 iter.i = 0 11880 return nil 11881} 11882 11883// Next advances to the next value. If there was an error making 11884// the request the iterator does not advance and the error is returned. 11885// Deprecated: Use NextWithContext() instead. 11886func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 11887 return iter.NextWithContext(context.Background()) 11888} 11889 11890// NotDone returns true if the enumeration should be started or is not yet complete. 11891func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 11892 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11893} 11894 11895// Response returns the raw server response from the last page request. 11896func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 11897 return iter.page.Response() 11898} 11899 11900// Value returns the current value or a zero-initialized value if the 11901// iterator has advanced beyond the end of the collection. 11902func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 11903 if !iter.page.NotDone() { 11904 return VirtualMachineScaleSet{} 11905 } 11906 return iter.page.Values()[iter.i] 11907} 11908 11909// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 11910func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 11911 return VirtualMachineScaleSetListResultIterator{page: page} 11912} 11913 11914// IsEmpty returns true if the ListResult contains no values. 11915func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 11916 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 11917} 11918 11919// hasNextLink returns true if the NextLink is not empty. 11920func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 11921 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 11922} 11923 11924// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 11925// It returns nil if no more results exist. 11926func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 11927 if !vmsslr.hasNextLink() { 11928 return nil, nil 11929 } 11930 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11931 autorest.AsJSON(), 11932 autorest.AsGet(), 11933 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 11934} 11935 11936// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 11937type VirtualMachineScaleSetListResultPage struct { 11938 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 11939 vmsslr VirtualMachineScaleSetListResult 11940} 11941 11942// NextWithContext advances to the next page of values. If there was an error making 11943// the request the page does not advance and the error is returned. 11944func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 11945 if tracing.IsEnabled() { 11946 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 11947 defer func() { 11948 sc := -1 11949 if page.Response().Response.Response != nil { 11950 sc = page.Response().Response.Response.StatusCode 11951 } 11952 tracing.EndSpan(ctx, sc, err) 11953 }() 11954 } 11955 for { 11956 next, err := page.fn(ctx, page.vmsslr) 11957 if err != nil { 11958 return err 11959 } 11960 page.vmsslr = next 11961 if !next.hasNextLink() || !next.IsEmpty() { 11962 break 11963 } 11964 } 11965 return nil 11966} 11967 11968// Next advances to the next page of values. If there was an error making 11969// the request the page does not advance and the error is returned. 11970// Deprecated: Use NextWithContext() instead. 11971func (page *VirtualMachineScaleSetListResultPage) Next() error { 11972 return page.NextWithContext(context.Background()) 11973} 11974 11975// NotDone returns true if the page enumeration should be started or is not yet complete. 11976func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 11977 return !page.vmsslr.IsEmpty() 11978} 11979 11980// Response returns the raw server response from the last page request. 11981func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 11982 return page.vmsslr 11983} 11984 11985// Values returns the slice of values for the current page or nil if there are no values. 11986func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 11987 if page.vmsslr.IsEmpty() { 11988 return nil 11989 } 11990 return *page.vmsslr.Value 11991} 11992 11993// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 11994func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 11995 return VirtualMachineScaleSetListResultPage{ 11996 fn: getNextPage, 11997 vmsslr: cur, 11998 } 11999} 12000 12001// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 12002type VirtualMachineScaleSetListSkusResult struct { 12003 autorest.Response `json:"-"` 12004 // Value - The list of skus available for the virtual machine scale set. 12005 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 12006 // 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. 12007 NextLink *string `json:"nextLink,omitempty"` 12008} 12009 12010// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 12011// VirtualMachineScaleSetSku values. 12012type VirtualMachineScaleSetListSkusResultIterator struct { 12013 i int 12014 page VirtualMachineScaleSetListSkusResultPage 12015} 12016 12017// NextWithContext advances to the next value. If there was an error making 12018// the request the iterator does not advance and the error is returned. 12019func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 12020 if tracing.IsEnabled() { 12021 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 12022 defer func() { 12023 sc := -1 12024 if iter.Response().Response.Response != nil { 12025 sc = iter.Response().Response.Response.StatusCode 12026 } 12027 tracing.EndSpan(ctx, sc, err) 12028 }() 12029 } 12030 iter.i++ 12031 if iter.i < len(iter.page.Values()) { 12032 return nil 12033 } 12034 err = iter.page.NextWithContext(ctx) 12035 if err != nil { 12036 iter.i-- 12037 return err 12038 } 12039 iter.i = 0 12040 return nil 12041} 12042 12043// Next advances to the next value. If there was an error making 12044// the request the iterator does not advance and the error is returned. 12045// Deprecated: Use NextWithContext() instead. 12046func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 12047 return iter.NextWithContext(context.Background()) 12048} 12049 12050// NotDone returns true if the enumeration should be started or is not yet complete. 12051func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 12052 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12053} 12054 12055// Response returns the raw server response from the last page request. 12056func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 12057 return iter.page.Response() 12058} 12059 12060// Value returns the current value or a zero-initialized value if the 12061// iterator has advanced beyond the end of the collection. 12062func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 12063 if !iter.page.NotDone() { 12064 return VirtualMachineScaleSetSku{} 12065 } 12066 return iter.page.Values()[iter.i] 12067} 12068 12069// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 12070func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 12071 return VirtualMachineScaleSetListSkusResultIterator{page: page} 12072} 12073 12074// IsEmpty returns true if the ListResult contains no values. 12075func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 12076 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 12077} 12078 12079// hasNextLink returns true if the NextLink is not empty. 12080func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 12081 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 12082} 12083 12084// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 12085// It returns nil if no more results exist. 12086func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 12087 if !vmsslsr.hasNextLink() { 12088 return nil, nil 12089 } 12090 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12091 autorest.AsJSON(), 12092 autorest.AsGet(), 12093 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 12094} 12095 12096// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 12097type VirtualMachineScaleSetListSkusResultPage struct { 12098 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 12099 vmsslsr VirtualMachineScaleSetListSkusResult 12100} 12101 12102// NextWithContext advances to the next page of values. If there was an error making 12103// the request the page does not advance and the error is returned. 12104func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 12105 if tracing.IsEnabled() { 12106 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 12107 defer func() { 12108 sc := -1 12109 if page.Response().Response.Response != nil { 12110 sc = page.Response().Response.Response.StatusCode 12111 } 12112 tracing.EndSpan(ctx, sc, err) 12113 }() 12114 } 12115 for { 12116 next, err := page.fn(ctx, page.vmsslsr) 12117 if err != nil { 12118 return err 12119 } 12120 page.vmsslsr = next 12121 if !next.hasNextLink() || !next.IsEmpty() { 12122 break 12123 } 12124 } 12125 return nil 12126} 12127 12128// Next advances to the next page of values. If there was an error making 12129// the request the page does not advance and the error is returned. 12130// Deprecated: Use NextWithContext() instead. 12131func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 12132 return page.NextWithContext(context.Background()) 12133} 12134 12135// NotDone returns true if the page enumeration should be started or is not yet complete. 12136func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 12137 return !page.vmsslsr.IsEmpty() 12138} 12139 12140// Response returns the raw server response from the last page request. 12141func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 12142 return page.vmsslsr 12143} 12144 12145// Values returns the slice of values for the current page or nil if there are no values. 12146func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 12147 if page.vmsslsr.IsEmpty() { 12148 return nil 12149 } 12150 return *page.vmsslsr.Value 12151} 12152 12153// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 12154func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 12155 return VirtualMachineScaleSetListSkusResultPage{ 12156 fn: getNextPage, 12157 vmsslsr: cur, 12158 } 12159} 12160 12161// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 12162type VirtualMachineScaleSetListWithLinkResult struct { 12163 autorest.Response `json:"-"` 12164 // Value - The list of virtual machine scale sets. 12165 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 12166 // 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. 12167 NextLink *string `json:"nextLink,omitempty"` 12168} 12169 12170// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 12171// VirtualMachineScaleSet values. 12172type VirtualMachineScaleSetListWithLinkResultIterator struct { 12173 i int 12174 page VirtualMachineScaleSetListWithLinkResultPage 12175} 12176 12177// NextWithContext advances to the next value. If there was an error making 12178// the request the iterator does not advance and the error is returned. 12179func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 12180 if tracing.IsEnabled() { 12181 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 12182 defer func() { 12183 sc := -1 12184 if iter.Response().Response.Response != nil { 12185 sc = iter.Response().Response.Response.StatusCode 12186 } 12187 tracing.EndSpan(ctx, sc, err) 12188 }() 12189 } 12190 iter.i++ 12191 if iter.i < len(iter.page.Values()) { 12192 return nil 12193 } 12194 err = iter.page.NextWithContext(ctx) 12195 if err != nil { 12196 iter.i-- 12197 return err 12198 } 12199 iter.i = 0 12200 return nil 12201} 12202 12203// Next advances to the next value. If there was an error making 12204// the request the iterator does not advance and the error is returned. 12205// Deprecated: Use NextWithContext() instead. 12206func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 12207 return iter.NextWithContext(context.Background()) 12208} 12209 12210// NotDone returns true if the enumeration should be started or is not yet complete. 12211func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 12212 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12213} 12214 12215// Response returns the raw server response from the last page request. 12216func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 12217 return iter.page.Response() 12218} 12219 12220// Value returns the current value or a zero-initialized value if the 12221// iterator has advanced beyond the end of the collection. 12222func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 12223 if !iter.page.NotDone() { 12224 return VirtualMachineScaleSet{} 12225 } 12226 return iter.page.Values()[iter.i] 12227} 12228 12229// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 12230func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 12231 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 12232} 12233 12234// IsEmpty returns true if the ListResult contains no values. 12235func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 12236 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 12237} 12238 12239// hasNextLink returns true if the NextLink is not empty. 12240func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 12241 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 12242} 12243 12244// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 12245// It returns nil if no more results exist. 12246func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 12247 if !vmsslwlr.hasNextLink() { 12248 return nil, nil 12249 } 12250 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12251 autorest.AsJSON(), 12252 autorest.AsGet(), 12253 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 12254} 12255 12256// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 12257type VirtualMachineScaleSetListWithLinkResultPage struct { 12258 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 12259 vmsslwlr VirtualMachineScaleSetListWithLinkResult 12260} 12261 12262// NextWithContext advances to the next page of values. If there was an error making 12263// the request the page does not advance and the error is returned. 12264func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 12265 if tracing.IsEnabled() { 12266 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 12267 defer func() { 12268 sc := -1 12269 if page.Response().Response.Response != nil { 12270 sc = page.Response().Response.Response.StatusCode 12271 } 12272 tracing.EndSpan(ctx, sc, err) 12273 }() 12274 } 12275 for { 12276 next, err := page.fn(ctx, page.vmsslwlr) 12277 if err != nil { 12278 return err 12279 } 12280 page.vmsslwlr = next 12281 if !next.hasNextLink() || !next.IsEmpty() { 12282 break 12283 } 12284 } 12285 return nil 12286} 12287 12288// Next advances to the next page of values. If there was an error making 12289// the request the page does not advance and the error is returned. 12290// Deprecated: Use NextWithContext() instead. 12291func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 12292 return page.NextWithContext(context.Background()) 12293} 12294 12295// NotDone returns true if the page enumeration should be started or is not yet complete. 12296func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 12297 return !page.vmsslwlr.IsEmpty() 12298} 12299 12300// Response returns the raw server response from the last page request. 12301func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 12302 return page.vmsslwlr 12303} 12304 12305// Values returns the slice of values for the current page or nil if there are no values. 12306func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 12307 if page.vmsslwlr.IsEmpty() { 12308 return nil 12309 } 12310 return *page.vmsslwlr.Value 12311} 12312 12313// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 12314func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 12315 return VirtualMachineScaleSetListWithLinkResultPage{ 12316 fn: getNextPage, 12317 vmsslwlr: cur, 12318 } 12319} 12320 12321// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 12322type VirtualMachineScaleSetManagedDiskParameters struct { 12323 // 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' 12324 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 12325 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 12326 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 12327} 12328 12329// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 12330// network configurations. 12331type VirtualMachineScaleSetNetworkConfiguration struct { 12332 // Name - The network configuration name. 12333 Name *string `json:"name,omitempty"` 12334 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 12335 // ID - Resource Id 12336 ID *string `json:"id,omitempty"` 12337} 12338 12339// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 12340func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 12341 objectMap := make(map[string]interface{}) 12342 if vmssnc.Name != nil { 12343 objectMap["name"] = vmssnc.Name 12344 } 12345 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 12346 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 12347 } 12348 if vmssnc.ID != nil { 12349 objectMap["id"] = vmssnc.ID 12350 } 12351 return json.Marshal(objectMap) 12352} 12353 12354// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 12355func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 12356 var m map[string]*json.RawMessage 12357 err := json.Unmarshal(body, &m) 12358 if err != nil { 12359 return err 12360 } 12361 for k, v := range m { 12362 switch k { 12363 case "name": 12364 if v != nil { 12365 var name string 12366 err = json.Unmarshal(*v, &name) 12367 if err != nil { 12368 return err 12369 } 12370 vmssnc.Name = &name 12371 } 12372 case "properties": 12373 if v != nil { 12374 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 12375 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 12376 if err != nil { 12377 return err 12378 } 12379 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 12380 } 12381 case "id": 12382 if v != nil { 12383 var ID string 12384 err = json.Unmarshal(*v, &ID) 12385 if err != nil { 12386 return err 12387 } 12388 vmssnc.ID = &ID 12389 } 12390 } 12391 } 12392 12393 return nil 12394} 12395 12396// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 12397// configuration's DNS settings. 12398type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 12399 // DNSServers - List of DNS servers IP addresses 12400 DNSServers *[]string `json:"dnsServers,omitempty"` 12401} 12402 12403// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 12404// profile's IP configuration. 12405type VirtualMachineScaleSetNetworkConfigurationProperties struct { 12406 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 12407 Primary *bool `json:"primary,omitempty"` 12408 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 12409 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 12410 // NetworkSecurityGroup - The network security group. 12411 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 12412 // DNSSettings - The dns settings to be applied on the network interfaces. 12413 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 12414 // IPConfigurations - Specifies the IP configurations of the network interface. 12415 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 12416 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 12417 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 12418} 12419 12420// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 12421type VirtualMachineScaleSetNetworkProfile struct { 12422 // 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}'. 12423 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 12424 // NetworkInterfaceConfigurations - The list of network configurations. 12425 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 12426} 12427 12428// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 12429type VirtualMachineScaleSetOSDisk struct { 12430 // Name - The disk name. 12431 Name *string `json:"name,omitempty"` 12432 // 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' 12433 Caching CachingTypes `json:"caching,omitempty"` 12434 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 12435 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 12436 // 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' 12437 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 12438 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 12439 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 12440 // 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 12441 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12442 // 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' 12443 OsType OperatingSystemTypes `json:"osType,omitempty"` 12444 // Image - Specifies information about the unmanaged user image to base the scale set on. 12445 Image *VirtualHardDisk `json:"image,omitempty"` 12446 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 12447 VhdContainers *[]string `json:"vhdContainers,omitempty"` 12448 // ManagedDisk - The managed disk parameters. 12449 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 12450} 12451 12452// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 12453type VirtualMachineScaleSetOSProfile struct { 12454 // 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. 12455 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 12456 // 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) 12457 AdminUsername *string `json:"adminUsername,omitempty"` 12458 // 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) 12459 AdminPassword *string `json:"adminPassword,omitempty"` 12460 // 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) 12461 CustomData *string `json:"customData,omitempty"` 12462 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 12463 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 12464 // 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). 12465 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 12466 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 12467 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 12468} 12469 12470// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 12471type VirtualMachineScaleSetProperties struct { 12472 // UpgradePolicy - The upgrade policy. 12473 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 12474 // AutomaticRepairsPolicy - Policy for automatic repairs. 12475 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 12476 // VirtualMachineProfile - The virtual machine profile. 12477 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 12478 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 12479 ProvisioningState *string `json:"provisioningState,omitempty"` 12480 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 12481 Overprovision *bool `json:"overprovision,omitempty"` 12482 // 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. 12483 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 12484 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 12485 UniqueID *string `json:"uniqueId,omitempty"` 12486 // 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. 12487 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 12488 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 12489 ZoneBalance *bool `json:"zoneBalance,omitempty"` 12490 // PlatformFaultDomainCount - Fault Domain count for each placement group. 12491 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 12492 // 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. 12493 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 12494 // 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. 12495 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 12496 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 12497 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 12498} 12499 12500// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 12501func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 12502 objectMap := make(map[string]interface{}) 12503 if vmssp.UpgradePolicy != nil { 12504 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 12505 } 12506 if vmssp.AutomaticRepairsPolicy != nil { 12507 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 12508 } 12509 if vmssp.VirtualMachineProfile != nil { 12510 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 12511 } 12512 if vmssp.Overprovision != nil { 12513 objectMap["overprovision"] = vmssp.Overprovision 12514 } 12515 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 12516 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 12517 } 12518 if vmssp.SinglePlacementGroup != nil { 12519 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 12520 } 12521 if vmssp.ZoneBalance != nil { 12522 objectMap["zoneBalance"] = vmssp.ZoneBalance 12523 } 12524 if vmssp.PlatformFaultDomainCount != nil { 12525 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 12526 } 12527 if vmssp.ProximityPlacementGroup != nil { 12528 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 12529 } 12530 if vmssp.AdditionalCapabilities != nil { 12531 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 12532 } 12533 if vmssp.ScaleInPolicy != nil { 12534 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 12535 } 12536 return json.Marshal(objectMap) 12537} 12538 12539// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 12540// Configuration's PublicIPAddress configuration 12541type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 12542 // Name - The publicIP address configuration name. 12543 Name *string `json:"name,omitempty"` 12544 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 12545} 12546 12547// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 12548func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 12549 objectMap := make(map[string]interface{}) 12550 if vmsspiac.Name != nil { 12551 objectMap["name"] = vmsspiac.Name 12552 } 12553 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 12554 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 12555 } 12556 return json.Marshal(objectMap) 12557} 12558 12559// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 12560func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 12561 var m map[string]*json.RawMessage 12562 err := json.Unmarshal(body, &m) 12563 if err != nil { 12564 return err 12565 } 12566 for k, v := range m { 12567 switch k { 12568 case "name": 12569 if v != nil { 12570 var name string 12571 err = json.Unmarshal(*v, &name) 12572 if err != nil { 12573 return err 12574 } 12575 vmsspiac.Name = &name 12576 } 12577 case "properties": 12578 if v != nil { 12579 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 12580 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 12581 if err != nil { 12582 return err 12583 } 12584 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 12585 } 12586 } 12587 } 12588 12589 return nil 12590} 12591 12592// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 12593// network configuration's DNS settings. 12594type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 12595 // 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 12596 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 12597} 12598 12599// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 12600// Configuration's PublicIPAddress configuration 12601type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 12602 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 12603 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 12604 // DNSSettings - The dns settings to be applied on the publicIP addresses . 12605 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 12606 // IPTags - The list of IP tags associated with the public IP address. 12607 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 12608 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 12609 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 12610 // 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' 12611 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 12612} 12613 12614// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 12615type VirtualMachineScaleSetReimageParameters struct { 12616 // 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. 12617 InstanceIds *[]string `json:"instanceIds,omitempty"` 12618 // 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. 12619 TempDisk *bool `json:"tempDisk,omitempty"` 12620} 12621 12622// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 12623// results of a long-running operation. 12624type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 12625 azure.FutureAPI 12626 // Result returns the result of the asynchronous operation. 12627 // If the operation has not completed it will return an error. 12628 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12629} 12630 12631// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12632func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 12633 var azFuture azure.Future 12634 if err := json.Unmarshal(body, &azFuture); err != nil { 12635 return err 12636 } 12637 future.FutureAPI = &azFuture 12638 future.Result = future.result 12639 return nil 12640} 12641 12642// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 12643func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 12644 var done bool 12645 done, err = future.DoneWithContext(context.Background(), client) 12646 if err != nil { 12647 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 12648 return 12649 } 12650 if !done { 12651 ar.Response = future.Response() 12652 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 12653 return 12654 } 12655 ar.Response = future.Response() 12656 return 12657} 12658 12659// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 12660// retrieving the results of a long-running operation. 12661type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 12662 azure.FutureAPI 12663 // Result returns the result of the asynchronous operation. 12664 // If the operation has not completed it will return an error. 12665 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12666} 12667 12668// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12669func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 12670 var azFuture azure.Future 12671 if err := json.Unmarshal(body, &azFuture); err != nil { 12672 return err 12673 } 12674 future.FutureAPI = &azFuture 12675 future.Result = future.result 12676 return nil 12677} 12678 12679// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 12680func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 12681 var done bool 12682 done, err = future.DoneWithContext(context.Background(), client) 12683 if err != nil { 12684 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 12685 return 12686 } 12687 if !done { 12688 ar.Response = future.Response() 12689 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 12690 return 12691 } 12692 ar.Response = future.Response() 12693 return 12694} 12695 12696// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 12697// the results of a long-running operation. 12698type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 12699 azure.FutureAPI 12700 // Result returns the result of the asynchronous operation. 12701 // If the operation has not completed it will return an error. 12702 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12703} 12704 12705// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12706func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 12707 var azFuture azure.Future 12708 if err := json.Unmarshal(body, &azFuture); err != nil { 12709 return err 12710 } 12711 future.FutureAPI = &azFuture 12712 future.Result = future.result 12713 return nil 12714} 12715 12716// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 12717func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 12718 var done bool 12719 done, err = future.DoneWithContext(context.Background(), client) 12720 if err != nil { 12721 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 12722 return 12723 } 12724 if !done { 12725 ar.Response = future.Response() 12726 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 12727 return 12728 } 12729 ar.Response = future.Response() 12730 return 12731} 12732 12733// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 12734// a long-running operation. 12735type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 12736 azure.FutureAPI 12737 // Result returns the result of the asynchronous operation. 12738 // If the operation has not completed it will return an error. 12739 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 12740} 12741 12742// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12743func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 12744 var azFuture azure.Future 12745 if err := json.Unmarshal(body, &azFuture); err != nil { 12746 return err 12747 } 12748 future.FutureAPI = &azFuture 12749 future.Result = future.result 12750 return nil 12751} 12752 12753// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 12754func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 12755 var done bool 12756 done, err = future.DoneWithContext(context.Background(), client) 12757 if err != nil { 12758 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12759 return 12760 } 12761 if !done { 12762 vmss.Response.Response = future.Response() 12763 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 12764 return 12765 } 12766 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12767 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 12768 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 12769 if err != nil { 12770 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 12771 } 12772 } 12773 return 12774} 12775 12776// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 12777// long-running operation. 12778type VirtualMachineScaleSetsDeallocateFuture struct { 12779 azure.FutureAPI 12780 // Result returns the result of the asynchronous operation. 12781 // If the operation has not completed it will return an error. 12782 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12783} 12784 12785// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12786func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 12787 var azFuture azure.Future 12788 if err := json.Unmarshal(body, &azFuture); err != nil { 12789 return err 12790 } 12791 future.FutureAPI = &azFuture 12792 future.Result = future.result 12793 return nil 12794} 12795 12796// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 12797func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12798 var done bool 12799 done, err = future.DoneWithContext(context.Background(), client) 12800 if err != nil { 12801 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 12802 return 12803 } 12804 if !done { 12805 ar.Response = future.Response() 12806 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 12807 return 12808 } 12809 ar.Response = future.Response() 12810 return 12811} 12812 12813// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 12814// long-running operation. 12815type VirtualMachineScaleSetsDeleteFuture struct { 12816 azure.FutureAPI 12817 // Result returns the result of the asynchronous operation. 12818 // If the operation has not completed it will return an error. 12819 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12820} 12821 12822// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12823func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 12824 var azFuture azure.Future 12825 if err := json.Unmarshal(body, &azFuture); err != nil { 12826 return err 12827 } 12828 future.FutureAPI = &azFuture 12829 future.Result = future.result 12830 return nil 12831} 12832 12833// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 12834func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12835 var done bool 12836 done, err = future.DoneWithContext(context.Background(), client) 12837 if err != nil { 12838 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 12839 return 12840 } 12841 if !done { 12842 ar.Response = future.Response() 12843 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 12844 return 12845 } 12846 ar.Response = future.Response() 12847 return 12848} 12849 12850// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 12851// a long-running operation. 12852type VirtualMachineScaleSetsDeleteInstancesFuture struct { 12853 azure.FutureAPI 12854 // Result returns the result of the asynchronous operation. 12855 // If the operation has not completed it will return an error. 12856 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12857} 12858 12859// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12860func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 12861 var azFuture azure.Future 12862 if err := json.Unmarshal(body, &azFuture); err != nil { 12863 return err 12864 } 12865 future.FutureAPI = &azFuture 12866 future.Result = future.result 12867 return nil 12868} 12869 12870// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 12871func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12872 var done bool 12873 done, err = future.DoneWithContext(context.Background(), client) 12874 if err != nil { 12875 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 12876 return 12877 } 12878 if !done { 12879 ar.Response = future.Response() 12880 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 12881 return 12882 } 12883 ar.Response = future.Response() 12884 return 12885} 12886 12887// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 12888type VirtualMachineScaleSetSku struct { 12889 // ResourceType - READ-ONLY; The type of resource the sku applies to. 12890 ResourceType *string `json:"resourceType,omitempty"` 12891 // Sku - READ-ONLY; The Sku. 12892 Sku *Sku `json:"sku,omitempty"` 12893 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 12894 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 12895} 12896 12897// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. 12898func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { 12899 objectMap := make(map[string]interface{}) 12900 return json.Marshal(objectMap) 12901} 12902 12903// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 12904type VirtualMachineScaleSetSkuCapacity struct { 12905 // Minimum - READ-ONLY; The minimum capacity. 12906 Minimum *int64 `json:"minimum,omitempty"` 12907 // Maximum - READ-ONLY; The maximum capacity that can be set. 12908 Maximum *int64 `json:"maximum,omitempty"` 12909 // DefaultCapacity - READ-ONLY; The default capacity. 12910 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 12911 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 12912 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 12913} 12914 12915// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. 12916func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { 12917 objectMap := make(map[string]interface{}) 12918 return json.Marshal(objectMap) 12919} 12920 12921// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 12922// of a long-running operation. 12923type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 12924 azure.FutureAPI 12925 // Result returns the result of the asynchronous operation. 12926 // If the operation has not completed it will return an error. 12927 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12928} 12929 12930// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12931func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 12932 var azFuture azure.Future 12933 if err := json.Unmarshal(body, &azFuture); err != nil { 12934 return err 12935 } 12936 future.FutureAPI = &azFuture 12937 future.Result = future.result 12938 return nil 12939} 12940 12941// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 12942func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12943 var done bool 12944 done, err = future.DoneWithContext(context.Background(), client) 12945 if err != nil { 12946 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 12947 return 12948 } 12949 if !done { 12950 ar.Response = future.Response() 12951 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 12952 return 12953 } 12954 ar.Response = future.Response() 12955 return 12956} 12957 12958// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 12959// long-running operation. 12960type VirtualMachineScaleSetsPowerOffFuture struct { 12961 azure.FutureAPI 12962 // Result returns the result of the asynchronous operation. 12963 // If the operation has not completed it will return an error. 12964 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12965} 12966 12967// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12968func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 12969 var azFuture azure.Future 12970 if err := json.Unmarshal(body, &azFuture); err != nil { 12971 return err 12972 } 12973 future.FutureAPI = &azFuture 12974 future.Result = future.result 12975 return nil 12976} 12977 12978// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 12979func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 12980 var done bool 12981 done, err = future.DoneWithContext(context.Background(), client) 12982 if err != nil { 12983 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 12984 return 12985 } 12986 if !done { 12987 ar.Response = future.Response() 12988 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 12989 return 12990 } 12991 ar.Response = future.Response() 12992 return 12993} 12994 12995// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 12996// long-running operation. 12997type VirtualMachineScaleSetsRedeployFuture struct { 12998 azure.FutureAPI 12999 // Result returns the result of the asynchronous operation. 13000 // If the operation has not completed it will return an error. 13001 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 13002} 13003 13004// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13005func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 13006 var azFuture azure.Future 13007 if err := json.Unmarshal(body, &azFuture); err != nil { 13008 return err 13009 } 13010 future.FutureAPI = &azFuture 13011 future.Result = future.result 13012 return nil 13013} 13014 13015// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 13016func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 13017 var done bool 13018 done, err = future.DoneWithContext(context.Background(), client) 13019 if err != nil { 13020 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 13021 return 13022 } 13023 if !done { 13024 ar.Response = future.Response() 13025 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 13026 return 13027 } 13028 ar.Response = future.Response() 13029 return 13030} 13031 13032// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 13033// long-running operation. 13034type VirtualMachineScaleSetsReimageAllFuture struct { 13035 azure.FutureAPI 13036 // Result returns the result of the asynchronous operation. 13037 // If the operation has not completed it will return an error. 13038 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 13039} 13040 13041// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13042func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 13043 var azFuture azure.Future 13044 if err := json.Unmarshal(body, &azFuture); err != nil { 13045 return err 13046 } 13047 future.FutureAPI = &azFuture 13048 future.Result = future.result 13049 return nil 13050} 13051 13052// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 13053func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 13054 var done bool 13055 done, err = future.DoneWithContext(context.Background(), client) 13056 if err != nil { 13057 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 13058 return 13059 } 13060 if !done { 13061 ar.Response = future.Response() 13062 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 13063 return 13064 } 13065 ar.Response = future.Response() 13066 return 13067} 13068 13069// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 13070// long-running operation. 13071type VirtualMachineScaleSetsReimageFuture struct { 13072 azure.FutureAPI 13073 // Result returns the result of the asynchronous operation. 13074 // If the operation has not completed it will return an error. 13075 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 13076} 13077 13078// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13079func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 13080 var azFuture azure.Future 13081 if err := json.Unmarshal(body, &azFuture); err != nil { 13082 return err 13083 } 13084 future.FutureAPI = &azFuture 13085 future.Result = future.result 13086 return nil 13087} 13088 13089// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 13090func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 13091 var done bool 13092 done, err = future.DoneWithContext(context.Background(), client) 13093 if err != nil { 13094 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 13095 return 13096 } 13097 if !done { 13098 ar.Response = future.Response() 13099 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 13100 return 13101 } 13102 ar.Response = future.Response() 13103 return 13104} 13105 13106// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 13107// long-running operation. 13108type VirtualMachineScaleSetsRestartFuture struct { 13109 azure.FutureAPI 13110 // Result returns the result of the asynchronous operation. 13111 // If the operation has not completed it will return an error. 13112 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 13113} 13114 13115// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13116func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 13117 var azFuture azure.Future 13118 if err := json.Unmarshal(body, &azFuture); err != nil { 13119 return err 13120 } 13121 future.FutureAPI = &azFuture 13122 future.Result = future.result 13123 return nil 13124} 13125 13126// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 13127func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 13128 var done bool 13129 done, err = future.DoneWithContext(context.Background(), client) 13130 if err != nil { 13131 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 13132 return 13133 } 13134 if !done { 13135 ar.Response = future.Response() 13136 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 13137 return 13138 } 13139 ar.Response = future.Response() 13140 return 13141} 13142 13143// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 13144// the results of a long-running operation. 13145type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 13146 azure.FutureAPI 13147 // Result returns the result of the asynchronous operation. 13148 // If the operation has not completed it will return an error. 13149 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 13150} 13151 13152// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13153func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { 13154 var azFuture azure.Future 13155 if err := json.Unmarshal(body, &azFuture); err != nil { 13156 return err 13157 } 13158 future.FutureAPI = &azFuture 13159 future.Result = future.result 13160 return nil 13161} 13162 13163// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. 13164func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 13165 var done bool 13166 done, err = future.DoneWithContext(context.Background(), client) 13167 if err != nil { 13168 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") 13169 return 13170 } 13171 if !done { 13172 ar.Response = future.Response() 13173 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") 13174 return 13175 } 13176 ar.Response = future.Response() 13177 return 13178} 13179 13180// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 13181// long-running operation. 13182type VirtualMachineScaleSetsStartFuture struct { 13183 azure.FutureAPI 13184 // Result returns the result of the asynchronous operation. 13185 // If the operation has not completed it will return an error. 13186 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 13187} 13188 13189// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13190func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 13191 var azFuture azure.Future 13192 if err := json.Unmarshal(body, &azFuture); err != nil { 13193 return err 13194 } 13195 future.FutureAPI = &azFuture 13196 future.Result = future.result 13197 return nil 13198} 13199 13200// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 13201func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 13202 var done bool 13203 done, err = future.DoneWithContext(context.Background(), client) 13204 if err != nil { 13205 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 13206 return 13207 } 13208 if !done { 13209 ar.Response = future.Response() 13210 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 13211 return 13212 } 13213 ar.Response = future.Response() 13214 return 13215} 13216 13217// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 13218type VirtualMachineScaleSetStorageProfile struct { 13219 // 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. 13220 ImageReference *ImageReference `json:"imageReference,omitempty"` 13221 // 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). 13222 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 13223 // 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). 13224 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 13225} 13226 13227// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 13228// long-running operation. 13229type VirtualMachineScaleSetsUpdateFuture struct { 13230 azure.FutureAPI 13231 // Result returns the result of the asynchronous operation. 13232 // If the operation has not completed it will return an error. 13233 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 13234} 13235 13236// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13237func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 13238 var azFuture azure.Future 13239 if err := json.Unmarshal(body, &azFuture); err != nil { 13240 return err 13241 } 13242 future.FutureAPI = &azFuture 13243 future.Result = future.result 13244 return nil 13245} 13246 13247// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 13248func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 13249 var done bool 13250 done, err = future.DoneWithContext(context.Background(), client) 13251 if err != nil { 13252 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 13253 return 13254 } 13255 if !done { 13256 vmss.Response.Response = future.Response() 13257 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 13258 return 13259 } 13260 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13261 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 13262 vmss, err = client.UpdateResponder(vmss.Response.Response) 13263 if err != nil { 13264 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 13265 } 13266 } 13267 return 13268} 13269 13270// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 13271// a long-running operation. 13272type VirtualMachineScaleSetsUpdateInstancesFuture struct { 13273 azure.FutureAPI 13274 // Result returns the result of the asynchronous operation. 13275 // If the operation has not completed it will return an error. 13276 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 13277} 13278 13279// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13280func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 13281 var azFuture azure.Future 13282 if err := json.Unmarshal(body, &azFuture); err != nil { 13283 return err 13284 } 13285 future.FutureAPI = &azFuture 13286 future.Result = future.result 13287 return nil 13288} 13289 13290// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 13291func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 13292 var done bool 13293 done, err = future.DoneWithContext(context.Background(), client) 13294 if err != nil { 13295 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 13296 return 13297 } 13298 if !done { 13299 ar.Response = future.Response() 13300 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 13301 return 13302 } 13303 ar.Response = future.Response() 13304 return 13305} 13306 13307// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 13308type VirtualMachineScaleSetUpdate struct { 13309 // Sku - The virtual machine scale set sku. 13310 Sku *Sku `json:"sku,omitempty"` 13311 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 13312 Plan *Plan `json:"plan,omitempty"` 13313 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 13314 // Identity - The identity of the virtual machine scale set, if configured. 13315 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 13316 // Tags - Resource tags 13317 Tags map[string]*string `json:"tags"` 13318} 13319 13320// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 13321func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 13322 objectMap := make(map[string]interface{}) 13323 if vmssu.Sku != nil { 13324 objectMap["sku"] = vmssu.Sku 13325 } 13326 if vmssu.Plan != nil { 13327 objectMap["plan"] = vmssu.Plan 13328 } 13329 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 13330 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 13331 } 13332 if vmssu.Identity != nil { 13333 objectMap["identity"] = vmssu.Identity 13334 } 13335 if vmssu.Tags != nil { 13336 objectMap["tags"] = vmssu.Tags 13337 } 13338 return json.Marshal(objectMap) 13339} 13340 13341// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 13342func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 13343 var m map[string]*json.RawMessage 13344 err := json.Unmarshal(body, &m) 13345 if err != nil { 13346 return err 13347 } 13348 for k, v := range m { 13349 switch k { 13350 case "sku": 13351 if v != nil { 13352 var sku Sku 13353 err = json.Unmarshal(*v, &sku) 13354 if err != nil { 13355 return err 13356 } 13357 vmssu.Sku = &sku 13358 } 13359 case "plan": 13360 if v != nil { 13361 var plan Plan 13362 err = json.Unmarshal(*v, &plan) 13363 if err != nil { 13364 return err 13365 } 13366 vmssu.Plan = &plan 13367 } 13368 case "properties": 13369 if v != nil { 13370 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 13371 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 13372 if err != nil { 13373 return err 13374 } 13375 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 13376 } 13377 case "identity": 13378 if v != nil { 13379 var identity VirtualMachineScaleSetIdentity 13380 err = json.Unmarshal(*v, &identity) 13381 if err != nil { 13382 return err 13383 } 13384 vmssu.Identity = &identity 13385 } 13386 case "tags": 13387 if v != nil { 13388 var tags map[string]*string 13389 err = json.Unmarshal(*v, &tags) 13390 if err != nil { 13391 return err 13392 } 13393 vmssu.Tags = tags 13394 } 13395 } 13396 } 13397 13398 return nil 13399} 13400 13401// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 13402// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 13403// new subnet are in the same virtual network 13404type VirtualMachineScaleSetUpdateIPConfiguration struct { 13405 // Name - The IP configuration name. 13406 Name *string `json:"name,omitempty"` 13407 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 13408 // ID - Resource Id 13409 ID *string `json:"id,omitempty"` 13410} 13411 13412// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 13413func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 13414 objectMap := make(map[string]interface{}) 13415 if vmssuic.Name != nil { 13416 objectMap["name"] = vmssuic.Name 13417 } 13418 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 13419 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 13420 } 13421 if vmssuic.ID != nil { 13422 objectMap["id"] = vmssuic.ID 13423 } 13424 return json.Marshal(objectMap) 13425} 13426 13427// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 13428func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 13429 var m map[string]*json.RawMessage 13430 err := json.Unmarshal(body, &m) 13431 if err != nil { 13432 return err 13433 } 13434 for k, v := range m { 13435 switch k { 13436 case "name": 13437 if v != nil { 13438 var name string 13439 err = json.Unmarshal(*v, &name) 13440 if err != nil { 13441 return err 13442 } 13443 vmssuic.Name = &name 13444 } 13445 case "properties": 13446 if v != nil { 13447 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 13448 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 13449 if err != nil { 13450 return err 13451 } 13452 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 13453 } 13454 case "id": 13455 if v != nil { 13456 var ID string 13457 err = json.Unmarshal(*v, &ID) 13458 if err != nil { 13459 return err 13460 } 13461 vmssuic.ID = &ID 13462 } 13463 } 13464 } 13465 13466 return nil 13467} 13468 13469// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 13470// profile's IP configuration properties. 13471type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 13472 // Subnet - The subnet. 13473 Subnet *APIEntityReference `json:"subnet,omitempty"` 13474 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 13475 Primary *bool `json:"primary,omitempty"` 13476 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 13477 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 13478 // 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' 13479 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 13480 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 13481 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 13482 // ApplicationSecurityGroups - Specifies an array of references to application security group. 13483 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 13484 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 13485 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 13486 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 13487 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 13488} 13489 13490// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 13491// network configurations. 13492type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 13493 // Name - The network configuration name. 13494 Name *string `json:"name,omitempty"` 13495 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 13496 // ID - Resource Id 13497 ID *string `json:"id,omitempty"` 13498} 13499 13500// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 13501func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 13502 objectMap := make(map[string]interface{}) 13503 if vmssunc.Name != nil { 13504 objectMap["name"] = vmssunc.Name 13505 } 13506 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 13507 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 13508 } 13509 if vmssunc.ID != nil { 13510 objectMap["id"] = vmssunc.ID 13511 } 13512 return json.Marshal(objectMap) 13513} 13514 13515// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 13516func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 13517 var m map[string]*json.RawMessage 13518 err := json.Unmarshal(body, &m) 13519 if err != nil { 13520 return err 13521 } 13522 for k, v := range m { 13523 switch k { 13524 case "name": 13525 if v != nil { 13526 var name string 13527 err = json.Unmarshal(*v, &name) 13528 if err != nil { 13529 return err 13530 } 13531 vmssunc.Name = &name 13532 } 13533 case "properties": 13534 if v != nil { 13535 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 13536 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 13537 if err != nil { 13538 return err 13539 } 13540 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 13541 } 13542 case "id": 13543 if v != nil { 13544 var ID string 13545 err = json.Unmarshal(*v, &ID) 13546 if err != nil { 13547 return err 13548 } 13549 vmssunc.ID = &ID 13550 } 13551 } 13552 } 13553 13554 return nil 13555} 13556 13557// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 13558// updatable network profile's IP configuration.Use this object for updating network profile's IP 13559// Configuration. 13560type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 13561 // Primary - Whether this is a primary NIC on a virtual machine. 13562 Primary *bool `json:"primary,omitempty"` 13563 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 13564 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 13565 // NetworkSecurityGroup - The network security group. 13566 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 13567 // DNSSettings - The dns settings to be applied on the network interfaces. 13568 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 13569 // IPConfigurations - The virtual machine scale set IP Configuration. 13570 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 13571 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 13572 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 13573} 13574 13575// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 13576type VirtualMachineScaleSetUpdateNetworkProfile struct { 13577 // 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}'. 13578 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 13579 // NetworkInterfaceConfigurations - The list of network configurations. 13580 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 13581} 13582 13583// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 13584// Object. This should be used for Updating VMSS OS Disk. 13585type VirtualMachineScaleSetUpdateOSDisk struct { 13586 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 13587 Caching CachingTypes `json:"caching,omitempty"` 13588 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 13589 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 13590 // 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 13591 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 13592 // 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. 13593 Image *VirtualHardDisk `json:"image,omitempty"` 13594 // VhdContainers - The list of virtual hard disk container uris. 13595 VhdContainers *[]string `json:"vhdContainers,omitempty"` 13596 // ManagedDisk - The managed disk parameters. 13597 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 13598} 13599 13600// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 13601type VirtualMachineScaleSetUpdateOSProfile struct { 13602 // CustomData - A base-64 encoded string of custom data. 13603 CustomData *string `json:"customData,omitempty"` 13604 // WindowsConfiguration - The Windows Configuration of the OS profile. 13605 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 13606 // LinuxConfiguration - The Linux Configuration of the OS profile. 13607 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 13608 // Secrets - The List of certificates for addition to the VM. 13609 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 13610} 13611 13612// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 13613type VirtualMachineScaleSetUpdateProperties struct { 13614 // UpgradePolicy - The upgrade policy. 13615 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 13616 // AutomaticRepairsPolicy - Policy for automatic repairs. 13617 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 13618 // VirtualMachineProfile - The virtual machine profile. 13619 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 13620 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 13621 Overprovision *bool `json:"overprovision,omitempty"` 13622 // 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. 13623 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 13624 // 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. 13625 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 13626 // 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. 13627 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 13628 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 13629 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 13630 // 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. 13631 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 13632} 13633 13634// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 13635// Configuration's PublicIPAddress configuration 13636type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 13637 // Name - The publicIP address configuration name. 13638 Name *string `json:"name,omitempty"` 13639 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 13640} 13641 13642// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 13643func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 13644 objectMap := make(map[string]interface{}) 13645 if vmssupiac.Name != nil { 13646 objectMap["name"] = vmssupiac.Name 13647 } 13648 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 13649 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 13650 } 13651 return json.Marshal(objectMap) 13652} 13653 13654// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 13655func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 13656 var m map[string]*json.RawMessage 13657 err := json.Unmarshal(body, &m) 13658 if err != nil { 13659 return err 13660 } 13661 for k, v := range m { 13662 switch k { 13663 case "name": 13664 if v != nil { 13665 var name string 13666 err = json.Unmarshal(*v, &name) 13667 if err != nil { 13668 return err 13669 } 13670 vmssupiac.Name = &name 13671 } 13672 case "properties": 13673 if v != nil { 13674 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 13675 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 13676 if err != nil { 13677 return err 13678 } 13679 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 13680 } 13681 } 13682 } 13683 13684 return nil 13685} 13686 13687// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 13688// set IP Configuration's PublicIPAddress configuration 13689type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 13690 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 13691 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 13692 // DNSSettings - The dns settings to be applied on the publicIP addresses . 13693 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 13694} 13695 13696// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 13697type VirtualMachineScaleSetUpdateStorageProfile struct { 13698 // ImageReference - The image reference. 13699 ImageReference *ImageReference `json:"imageReference,omitempty"` 13700 // OsDisk - The OS disk. 13701 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 13702 // DataDisks - The data disks. 13703 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 13704} 13705 13706// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 13707type VirtualMachineScaleSetUpdateVMProfile struct { 13708 // OsProfile - The virtual machine scale set OS profile. 13709 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 13710 // StorageProfile - The virtual machine scale set storage profile. 13711 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 13712 // NetworkProfile - The virtual machine scale set network profile. 13713 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 13714 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 13715 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 13716 // ExtensionProfile - The virtual machine scale set extension profile. 13717 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 13718 // LicenseType - The license type, which is for bring your own license scenario. 13719 LicenseType *string `json:"licenseType,omitempty"` 13720 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 13721 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 13722 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 13723 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 13724} 13725 13726// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 13727type VirtualMachineScaleSetVM struct { 13728 autorest.Response `json:"-"` 13729 // InstanceID - READ-ONLY; The virtual machine instance ID. 13730 InstanceID *string `json:"instanceId,omitempty"` 13731 // Sku - READ-ONLY; The virtual machine SKU. 13732 Sku *Sku `json:"sku,omitempty"` 13733 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 13734 // 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**. 13735 Plan *Plan `json:"plan,omitempty"` 13736 // Resources - READ-ONLY; The virtual machine child extension resources. 13737 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 13738 // Zones - READ-ONLY; The virtual machine zones. 13739 Zones *[]string `json:"zones,omitempty"` 13740 // ID - READ-ONLY; Resource Id 13741 ID *string `json:"id,omitempty"` 13742 // Name - READ-ONLY; Resource name 13743 Name *string `json:"name,omitempty"` 13744 // Type - READ-ONLY; Resource type 13745 Type *string `json:"type,omitempty"` 13746 // Location - Resource location 13747 Location *string `json:"location,omitempty"` 13748 // Tags - Resource tags 13749 Tags map[string]*string `json:"tags"` 13750} 13751 13752// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 13753func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 13754 objectMap := make(map[string]interface{}) 13755 if vmssv.VirtualMachineScaleSetVMProperties != nil { 13756 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 13757 } 13758 if vmssv.Plan != nil { 13759 objectMap["plan"] = vmssv.Plan 13760 } 13761 if vmssv.Location != nil { 13762 objectMap["location"] = vmssv.Location 13763 } 13764 if vmssv.Tags != nil { 13765 objectMap["tags"] = vmssv.Tags 13766 } 13767 return json.Marshal(objectMap) 13768} 13769 13770// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 13771func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 13772 var m map[string]*json.RawMessage 13773 err := json.Unmarshal(body, &m) 13774 if err != nil { 13775 return err 13776 } 13777 for k, v := range m { 13778 switch k { 13779 case "instanceId": 13780 if v != nil { 13781 var instanceID string 13782 err = json.Unmarshal(*v, &instanceID) 13783 if err != nil { 13784 return err 13785 } 13786 vmssv.InstanceID = &instanceID 13787 } 13788 case "sku": 13789 if v != nil { 13790 var sku Sku 13791 err = json.Unmarshal(*v, &sku) 13792 if err != nil { 13793 return err 13794 } 13795 vmssv.Sku = &sku 13796 } 13797 case "properties": 13798 if v != nil { 13799 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 13800 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 13801 if err != nil { 13802 return err 13803 } 13804 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 13805 } 13806 case "plan": 13807 if v != nil { 13808 var plan Plan 13809 err = json.Unmarshal(*v, &plan) 13810 if err != nil { 13811 return err 13812 } 13813 vmssv.Plan = &plan 13814 } 13815 case "resources": 13816 if v != nil { 13817 var resources []VirtualMachineExtension 13818 err = json.Unmarshal(*v, &resources) 13819 if err != nil { 13820 return err 13821 } 13822 vmssv.Resources = &resources 13823 } 13824 case "zones": 13825 if v != nil { 13826 var zones []string 13827 err = json.Unmarshal(*v, &zones) 13828 if err != nil { 13829 return err 13830 } 13831 vmssv.Zones = &zones 13832 } 13833 case "id": 13834 if v != nil { 13835 var ID string 13836 err = json.Unmarshal(*v, &ID) 13837 if err != nil { 13838 return err 13839 } 13840 vmssv.ID = &ID 13841 } 13842 case "name": 13843 if v != nil { 13844 var name string 13845 err = json.Unmarshal(*v, &name) 13846 if err != nil { 13847 return err 13848 } 13849 vmssv.Name = &name 13850 } 13851 case "type": 13852 if v != nil { 13853 var typeVar string 13854 err = json.Unmarshal(*v, &typeVar) 13855 if err != nil { 13856 return err 13857 } 13858 vmssv.Type = &typeVar 13859 } 13860 case "location": 13861 if v != nil { 13862 var location string 13863 err = json.Unmarshal(*v, &location) 13864 if err != nil { 13865 return err 13866 } 13867 vmssv.Location = &location 13868 } 13869 case "tags": 13870 if v != nil { 13871 var tags map[string]*string 13872 err = json.Unmarshal(*v, &tags) 13873 if err != nil { 13874 return err 13875 } 13876 vmssv.Tags = tags 13877 } 13878 } 13879 } 13880 13881 return nil 13882} 13883 13884// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 13885// results of a long-running operation. 13886type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 13887 azure.FutureAPI 13888 // Result returns the result of the asynchronous operation. 13889 // If the operation has not completed it will return an error. 13890 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 13891} 13892 13893// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13894func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 13895 var azFuture azure.Future 13896 if err := json.Unmarshal(body, &azFuture); err != nil { 13897 return err 13898 } 13899 future.FutureAPI = &azFuture 13900 future.Result = future.result 13901 return nil 13902} 13903 13904// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. 13905func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { 13906 var done bool 13907 done, err = future.DoneWithContext(context.Background(), client) 13908 if err != nil { 13909 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 13910 return 13911 } 13912 if !done { 13913 vme.Response.Response = future.Response() 13914 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") 13915 return 13916 } 13917 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13918 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 13919 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 13920 if err != nil { 13921 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 13922 } 13923 } 13924 return 13925} 13926 13927// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 13928// of a long-running operation. 13929type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 13930 azure.FutureAPI 13931 // Result returns the result of the asynchronous operation. 13932 // If the operation has not completed it will return an error. 13933 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 13934} 13935 13936// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13937func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 13938 var azFuture azure.Future 13939 if err := json.Unmarshal(body, &azFuture); err != nil { 13940 return err 13941 } 13942 future.FutureAPI = &azFuture 13943 future.Result = future.result 13944 return nil 13945} 13946 13947// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. 13948func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { 13949 var done bool 13950 done, err = future.DoneWithContext(context.Background(), client) 13951 if err != nil { 13952 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 13953 return 13954 } 13955 if !done { 13956 ar.Response = future.Response() 13957 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") 13958 return 13959 } 13960 ar.Response = future.Response() 13961 return 13962} 13963 13964// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 13965// scale set. 13966type VirtualMachineScaleSetVMExtensionsSummary struct { 13967 // Name - READ-ONLY; The extension name. 13968 Name *string `json:"name,omitempty"` 13969 // StatusesSummary - READ-ONLY; The extensions information. 13970 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 13971} 13972 13973// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. 13974func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { 13975 objectMap := make(map[string]interface{}) 13976 return json.Marshal(objectMap) 13977} 13978 13979// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 13980// of a long-running operation. 13981type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 13982 azure.FutureAPI 13983 // Result returns the result of the asynchronous operation. 13984 // If the operation has not completed it will return an error. 13985 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 13986} 13987 13988// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13989func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 13990 var azFuture azure.Future 13991 if err := json.Unmarshal(body, &azFuture); err != nil { 13992 return err 13993 } 13994 future.FutureAPI = &azFuture 13995 future.Result = future.result 13996 return nil 13997} 13998 13999// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. 14000func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { 14001 var done bool 14002 done, err = future.DoneWithContext(context.Background(), client) 14003 if err != nil { 14004 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 14005 return 14006 } 14007 if !done { 14008 vme.Response.Response = future.Response() 14009 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") 14010 return 14011 } 14012 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14013 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 14014 vme, err = client.UpdateResponder(vme.Response.Response) 14015 if err != nil { 14016 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 14017 } 14018 } 14019 return 14020} 14021 14022// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 14023// set. 14024type VirtualMachineScaleSetVMInstanceIDs struct { 14025 // 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. 14026 InstanceIds *[]string `json:"instanceIds,omitempty"` 14027} 14028 14029// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 14030// scale set. 14031type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 14032 // InstanceIds - The virtual machine scale set instance ids. 14033 InstanceIds *[]string `json:"instanceIds,omitempty"` 14034} 14035 14036// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 14037type VirtualMachineScaleSetVMInstanceView struct { 14038 autorest.Response `json:"-"` 14039 // PlatformUpdateDomain - The Update Domain count. 14040 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 14041 // PlatformFaultDomain - The Fault Domain count. 14042 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 14043 // RdpThumbPrint - The Remote desktop certificate thumbprint. 14044 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 14045 // VMAgent - The VM Agent running on the virtual machine. 14046 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 14047 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 14048 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 14049 // Disks - The disks information. 14050 Disks *[]DiskInstanceView `json:"disks,omitempty"` 14051 // Extensions - The extensions information. 14052 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 14053 // VMHealth - READ-ONLY; The health status for the VM. 14054 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 14055 // 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. 14056 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 14057 // Statuses - The resource status information. 14058 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 14059 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 14060 PlacementGroupID *string `json:"placementGroupId,omitempty"` 14061} 14062 14063// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 14064func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 14065 objectMap := make(map[string]interface{}) 14066 if vmssviv.PlatformUpdateDomain != nil { 14067 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 14068 } 14069 if vmssviv.PlatformFaultDomain != nil { 14070 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 14071 } 14072 if vmssviv.RdpThumbPrint != nil { 14073 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 14074 } 14075 if vmssviv.VMAgent != nil { 14076 objectMap["vmAgent"] = vmssviv.VMAgent 14077 } 14078 if vmssviv.MaintenanceRedeployStatus != nil { 14079 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 14080 } 14081 if vmssviv.Disks != nil { 14082 objectMap["disks"] = vmssviv.Disks 14083 } 14084 if vmssviv.Extensions != nil { 14085 objectMap["extensions"] = vmssviv.Extensions 14086 } 14087 if vmssviv.BootDiagnostics != nil { 14088 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 14089 } 14090 if vmssviv.Statuses != nil { 14091 objectMap["statuses"] = vmssviv.Statuses 14092 } 14093 if vmssviv.PlacementGroupID != nil { 14094 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 14095 } 14096 return json.Marshal(objectMap) 14097} 14098 14099// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 14100type VirtualMachineScaleSetVMListResult struct { 14101 autorest.Response `json:"-"` 14102 // Value - The list of virtual machine scale sets VMs. 14103 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 14104 // 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 14105 NextLink *string `json:"nextLink,omitempty"` 14106} 14107 14108// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 14109// VirtualMachineScaleSetVM values. 14110type VirtualMachineScaleSetVMListResultIterator struct { 14111 i int 14112 page VirtualMachineScaleSetVMListResultPage 14113} 14114 14115// NextWithContext advances to the next value. If there was an error making 14116// the request the iterator does not advance and the error is returned. 14117func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 14118 if tracing.IsEnabled() { 14119 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 14120 defer func() { 14121 sc := -1 14122 if iter.Response().Response.Response != nil { 14123 sc = iter.Response().Response.Response.StatusCode 14124 } 14125 tracing.EndSpan(ctx, sc, err) 14126 }() 14127 } 14128 iter.i++ 14129 if iter.i < len(iter.page.Values()) { 14130 return nil 14131 } 14132 err = iter.page.NextWithContext(ctx) 14133 if err != nil { 14134 iter.i-- 14135 return err 14136 } 14137 iter.i = 0 14138 return nil 14139} 14140 14141// Next advances to the next value. If there was an error making 14142// the request the iterator does not advance and the error is returned. 14143// Deprecated: Use NextWithContext() instead. 14144func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 14145 return iter.NextWithContext(context.Background()) 14146} 14147 14148// NotDone returns true if the enumeration should be started or is not yet complete. 14149func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 14150 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14151} 14152 14153// Response returns the raw server response from the last page request. 14154func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 14155 return iter.page.Response() 14156} 14157 14158// Value returns the current value or a zero-initialized value if the 14159// iterator has advanced beyond the end of the collection. 14160func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 14161 if !iter.page.NotDone() { 14162 return VirtualMachineScaleSetVM{} 14163 } 14164 return iter.page.Values()[iter.i] 14165} 14166 14167// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 14168func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 14169 return VirtualMachineScaleSetVMListResultIterator{page: page} 14170} 14171 14172// IsEmpty returns true if the ListResult contains no values. 14173func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 14174 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 14175} 14176 14177// hasNextLink returns true if the NextLink is not empty. 14178func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 14179 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 14180} 14181 14182// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 14183// It returns nil if no more results exist. 14184func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 14185 if !vmssvlr.hasNextLink() { 14186 return nil, nil 14187 } 14188 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14189 autorest.AsJSON(), 14190 autorest.AsGet(), 14191 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 14192} 14193 14194// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 14195type VirtualMachineScaleSetVMListResultPage struct { 14196 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 14197 vmssvlr VirtualMachineScaleSetVMListResult 14198} 14199 14200// NextWithContext advances to the next page of values. If there was an error making 14201// the request the page does not advance and the error is returned. 14202func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 14203 if tracing.IsEnabled() { 14204 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 14205 defer func() { 14206 sc := -1 14207 if page.Response().Response.Response != nil { 14208 sc = page.Response().Response.Response.StatusCode 14209 } 14210 tracing.EndSpan(ctx, sc, err) 14211 }() 14212 } 14213 for { 14214 next, err := page.fn(ctx, page.vmssvlr) 14215 if err != nil { 14216 return err 14217 } 14218 page.vmssvlr = next 14219 if !next.hasNextLink() || !next.IsEmpty() { 14220 break 14221 } 14222 } 14223 return nil 14224} 14225 14226// Next advances to the next page of values. If there was an error making 14227// the request the page does not advance and the error is returned. 14228// Deprecated: Use NextWithContext() instead. 14229func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 14230 return page.NextWithContext(context.Background()) 14231} 14232 14233// NotDone returns true if the page enumeration should be started or is not yet complete. 14234func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 14235 return !page.vmssvlr.IsEmpty() 14236} 14237 14238// Response returns the raw server response from the last page request. 14239func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 14240 return page.vmssvlr 14241} 14242 14243// Values returns the slice of values for the current page or nil if there are no values. 14244func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 14245 if page.vmssvlr.IsEmpty() { 14246 return nil 14247 } 14248 return *page.vmssvlr.Value 14249} 14250 14251// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 14252func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 14253 return VirtualMachineScaleSetVMListResultPage{ 14254 fn: getNextPage, 14255 vmssvlr: cur, 14256 } 14257} 14258 14259// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 14260// profile. 14261type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 14262 // NetworkInterfaceConfigurations - The list of network configurations. 14263 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 14264} 14265 14266// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 14267type VirtualMachineScaleSetVMProfile struct { 14268 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 14269 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 14270 // StorageProfile - Specifies the storage settings for the virtual machine disks. 14271 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 14272 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 14273 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 14274 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 14275 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 14276 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 14277 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 14278 // 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 14279 LicenseType *string `json:"licenseType,omitempty"` 14280 // 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' 14281 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 14282 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported 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' 14283 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 14284 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 14285 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 14286 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 14287 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 14288} 14289 14290// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 14291// machine. 14292type VirtualMachineScaleSetVMProperties struct { 14293 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 14294 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 14295 // VMID - READ-ONLY; Azure VM unique ID. 14296 VMID *string `json:"vmId,omitempty"` 14297 // InstanceView - READ-ONLY; The virtual machine instance view. 14298 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 14299 // HardwareProfile - Specifies the hardware settings for the virtual machine. 14300 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 14301 // StorageProfile - Specifies the storage settings for the virtual machine disks. 14302 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 14303 // 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. 14304 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 14305 // OsProfile - Specifies the operating system settings for the virtual machine. 14306 OsProfile *OSProfile `json:"osProfile,omitempty"` 14307 // NetworkProfile - Specifies the network interfaces of the virtual machine. 14308 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 14309 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 14310 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 14311 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 14312 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 14313 // 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. 14314 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 14315 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 14316 ProvisioningState *string `json:"provisioningState,omitempty"` 14317 // 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 14318 LicenseType *string `json:"licenseType,omitempty"` 14319 // 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. 14320 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 14321 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 14322 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 14323} 14324 14325// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 14326func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 14327 objectMap := make(map[string]interface{}) 14328 if vmssvp.HardwareProfile != nil { 14329 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 14330 } 14331 if vmssvp.StorageProfile != nil { 14332 objectMap["storageProfile"] = vmssvp.StorageProfile 14333 } 14334 if vmssvp.AdditionalCapabilities != nil { 14335 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 14336 } 14337 if vmssvp.OsProfile != nil { 14338 objectMap["osProfile"] = vmssvp.OsProfile 14339 } 14340 if vmssvp.NetworkProfile != nil { 14341 objectMap["networkProfile"] = vmssvp.NetworkProfile 14342 } 14343 if vmssvp.NetworkProfileConfiguration != nil { 14344 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 14345 } 14346 if vmssvp.DiagnosticsProfile != nil { 14347 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 14348 } 14349 if vmssvp.AvailabilitySet != nil { 14350 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 14351 } 14352 if vmssvp.LicenseType != nil { 14353 objectMap["licenseType"] = vmssvp.LicenseType 14354 } 14355 if vmssvp.ProtectionPolicy != nil { 14356 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 14357 } 14358 return json.Marshal(objectMap) 14359} 14360 14361// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 14362type VirtualMachineScaleSetVMProtectionPolicy struct { 14363 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 14364 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 14365 // 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. 14366 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 14367} 14368 14369// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 14370type VirtualMachineScaleSetVMReimageParameters struct { 14371 // 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. 14372 TempDisk *bool `json:"tempDisk,omitempty"` 14373} 14374 14375// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 14376// long-running operation. 14377type VirtualMachineScaleSetVMsDeallocateFuture struct { 14378 azure.FutureAPI 14379 // Result returns the result of the asynchronous operation. 14380 // If the operation has not completed it will return an error. 14381 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14382} 14383 14384// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14385func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 14386 var azFuture azure.Future 14387 if err := json.Unmarshal(body, &azFuture); err != nil { 14388 return err 14389 } 14390 future.FutureAPI = &azFuture 14391 future.Result = future.result 14392 return nil 14393} 14394 14395// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 14396func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14397 var done bool 14398 done, err = future.DoneWithContext(context.Background(), client) 14399 if err != nil { 14400 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 14401 return 14402 } 14403 if !done { 14404 ar.Response = future.Response() 14405 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 14406 return 14407 } 14408 ar.Response = future.Response() 14409 return 14410} 14411 14412// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 14413// long-running operation. 14414type VirtualMachineScaleSetVMsDeleteFuture struct { 14415 azure.FutureAPI 14416 // Result returns the result of the asynchronous operation. 14417 // If the operation has not completed it will return an error. 14418 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14419} 14420 14421// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14422func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 14423 var azFuture azure.Future 14424 if err := json.Unmarshal(body, &azFuture); err != nil { 14425 return err 14426 } 14427 future.FutureAPI = &azFuture 14428 future.Result = future.result 14429 return nil 14430} 14431 14432// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 14433func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14434 var done bool 14435 done, err = future.DoneWithContext(context.Background(), client) 14436 if err != nil { 14437 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 14438 return 14439 } 14440 if !done { 14441 ar.Response = future.Response() 14442 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 14443 return 14444 } 14445 ar.Response = future.Response() 14446 return 14447} 14448 14449// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 14450// results of a long-running operation. 14451type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 14452 azure.FutureAPI 14453 // Result returns the result of the asynchronous operation. 14454 // If the operation has not completed it will return an error. 14455 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14456} 14457 14458// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14459func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 14460 var azFuture azure.Future 14461 if err := json.Unmarshal(body, &azFuture); err != nil { 14462 return err 14463 } 14464 future.FutureAPI = &azFuture 14465 future.Result = future.result 14466 return nil 14467} 14468 14469// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 14470func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14471 var done bool 14472 done, err = future.DoneWithContext(context.Background(), client) 14473 if err != nil { 14474 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 14475 return 14476 } 14477 if !done { 14478 ar.Response = future.Response() 14479 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 14480 return 14481 } 14482 ar.Response = future.Response() 14483 return 14484} 14485 14486// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 14487// long-running operation. 14488type VirtualMachineScaleSetVMsPowerOffFuture struct { 14489 azure.FutureAPI 14490 // Result returns the result of the asynchronous operation. 14491 // If the operation has not completed it will return an error. 14492 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14493} 14494 14495// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14496func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 14497 var azFuture azure.Future 14498 if err := json.Unmarshal(body, &azFuture); err != nil { 14499 return err 14500 } 14501 future.FutureAPI = &azFuture 14502 future.Result = future.result 14503 return nil 14504} 14505 14506// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 14507func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14508 var done bool 14509 done, err = future.DoneWithContext(context.Background(), client) 14510 if err != nil { 14511 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 14512 return 14513 } 14514 if !done { 14515 ar.Response = future.Response() 14516 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 14517 return 14518 } 14519 ar.Response = future.Response() 14520 return 14521} 14522 14523// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 14524// long-running operation. 14525type VirtualMachineScaleSetVMsRedeployFuture struct { 14526 azure.FutureAPI 14527 // Result returns the result of the asynchronous operation. 14528 // If the operation has not completed it will return an error. 14529 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14530} 14531 14532// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14533func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 14534 var azFuture azure.Future 14535 if err := json.Unmarshal(body, &azFuture); err != nil { 14536 return err 14537 } 14538 future.FutureAPI = &azFuture 14539 future.Result = future.result 14540 return nil 14541} 14542 14543// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 14544func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14545 var done bool 14546 done, err = future.DoneWithContext(context.Background(), client) 14547 if err != nil { 14548 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 14549 return 14550 } 14551 if !done { 14552 ar.Response = future.Response() 14553 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 14554 return 14555 } 14556 ar.Response = future.Response() 14557 return 14558} 14559 14560// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 14561// long-running operation. 14562type VirtualMachineScaleSetVMsReimageAllFuture struct { 14563 azure.FutureAPI 14564 // Result returns the result of the asynchronous operation. 14565 // If the operation has not completed it will return an error. 14566 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14567} 14568 14569// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14570func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 14571 var azFuture azure.Future 14572 if err := json.Unmarshal(body, &azFuture); err != nil { 14573 return err 14574 } 14575 future.FutureAPI = &azFuture 14576 future.Result = future.result 14577 return nil 14578} 14579 14580// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 14581func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14582 var done bool 14583 done, err = future.DoneWithContext(context.Background(), client) 14584 if err != nil { 14585 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 14586 return 14587 } 14588 if !done { 14589 ar.Response = future.Response() 14590 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 14591 return 14592 } 14593 ar.Response = future.Response() 14594 return 14595} 14596 14597// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 14598// long-running operation. 14599type VirtualMachineScaleSetVMsReimageFuture struct { 14600 azure.FutureAPI 14601 // Result returns the result of the asynchronous operation. 14602 // If the operation has not completed it will return an error. 14603 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14604} 14605 14606// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14607func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 14608 var azFuture azure.Future 14609 if err := json.Unmarshal(body, &azFuture); err != nil { 14610 return err 14611 } 14612 future.FutureAPI = &azFuture 14613 future.Result = future.result 14614 return nil 14615} 14616 14617// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 14618func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14619 var done bool 14620 done, err = future.DoneWithContext(context.Background(), client) 14621 if err != nil { 14622 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 14623 return 14624 } 14625 if !done { 14626 ar.Response = future.Response() 14627 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 14628 return 14629 } 14630 ar.Response = future.Response() 14631 return 14632} 14633 14634// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 14635// long-running operation. 14636type VirtualMachineScaleSetVMsRestartFuture struct { 14637 azure.FutureAPI 14638 // Result returns the result of the asynchronous operation. 14639 // If the operation has not completed it will return an error. 14640 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14641} 14642 14643// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14644func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 14645 var azFuture azure.Future 14646 if err := json.Unmarshal(body, &azFuture); err != nil { 14647 return err 14648 } 14649 future.FutureAPI = &azFuture 14650 future.Result = future.result 14651 return nil 14652} 14653 14654// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 14655func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14656 var done bool 14657 done, err = future.DoneWithContext(context.Background(), client) 14658 if err != nil { 14659 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 14660 return 14661 } 14662 if !done { 14663 ar.Response = future.Response() 14664 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 14665 return 14666 } 14667 ar.Response = future.Response() 14668 return 14669} 14670 14671// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 14672// long-running operation. 14673type VirtualMachineScaleSetVMsRunCommandFuture 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(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 14678} 14679 14680// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14681func (future *VirtualMachineScaleSetVMsRunCommandFuture) 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 VirtualMachineScaleSetVMsRunCommandFuture.Result. 14692func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { 14693 var done bool 14694 done, err = future.DoneWithContext(context.Background(), client) 14695 if err != nil { 14696 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") 14697 return 14698 } 14699 if !done { 14700 rcr.Response.Response = future.Response() 14701 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") 14702 return 14703 } 14704 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14705 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 14706 rcr, err = client.RunCommandResponder(rcr.Response.Response) 14707 if err != nil { 14708 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 14709 } 14710 } 14711 return 14712} 14713 14714// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 14715// long-running operation. 14716type VirtualMachineScaleSetVMsStartFuture struct { 14717 azure.FutureAPI 14718 // Result returns the result of the asynchronous operation. 14719 // If the operation has not completed it will return an error. 14720 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 14721} 14722 14723// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14724func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 14725 var azFuture azure.Future 14726 if err := json.Unmarshal(body, &azFuture); err != nil { 14727 return err 14728 } 14729 future.FutureAPI = &azFuture 14730 future.Result = future.result 14731 return nil 14732} 14733 14734// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 14735func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 14736 var done bool 14737 done, err = future.DoneWithContext(context.Background(), client) 14738 if err != nil { 14739 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 14740 return 14741 } 14742 if !done { 14743 ar.Response = future.Response() 14744 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 14745 return 14746 } 14747 ar.Response = future.Response() 14748 return 14749} 14750 14751// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 14752// long-running operation. 14753type VirtualMachineScaleSetVMsUpdateFuture struct { 14754 azure.FutureAPI 14755 // Result returns the result of the asynchronous operation. 14756 // If the operation has not completed it will return an error. 14757 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 14758} 14759 14760// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14761func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 14762 var azFuture azure.Future 14763 if err := json.Unmarshal(body, &azFuture); err != nil { 14764 return err 14765 } 14766 future.FutureAPI = &azFuture 14767 future.Result = future.result 14768 return nil 14769} 14770 14771// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 14772func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 14773 var done bool 14774 done, err = future.DoneWithContext(context.Background(), client) 14775 if err != nil { 14776 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 14777 return 14778 } 14779 if !done { 14780 vmssv.Response.Response = future.Response() 14781 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 14782 return 14783 } 14784 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14785 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 14786 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 14787 if err != nil { 14788 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 14789 } 14790 } 14791 return 14792} 14793 14794// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 14795// operation. 14796type VirtualMachinesCaptureFuture struct { 14797 azure.FutureAPI 14798 // Result returns the result of the asynchronous operation. 14799 // If the operation has not completed it will return an error. 14800 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 14801} 14802 14803// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14804func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 14805 var azFuture azure.Future 14806 if err := json.Unmarshal(body, &azFuture); err != nil { 14807 return err 14808 } 14809 future.FutureAPI = &azFuture 14810 future.Result = future.result 14811 return nil 14812} 14813 14814// result is the default implementation for VirtualMachinesCaptureFuture.Result. 14815func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 14816 var done bool 14817 done, err = future.DoneWithContext(context.Background(), client) 14818 if err != nil { 14819 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 14820 return 14821 } 14822 if !done { 14823 vmcr.Response.Response = future.Response() 14824 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 14825 return 14826 } 14827 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14828 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 14829 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 14830 if err != nil { 14831 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 14832 } 14833 } 14834 return 14835} 14836 14837// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 14838// long-running operation. 14839type VirtualMachinesConvertToManagedDisksFuture struct { 14840 azure.FutureAPI 14841 // Result returns the result of the asynchronous operation. 14842 // If the operation has not completed it will return an error. 14843 Result func(VirtualMachinesClient) (autorest.Response, error) 14844} 14845 14846// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14847func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 14848 var azFuture azure.Future 14849 if err := json.Unmarshal(body, &azFuture); err != nil { 14850 return err 14851 } 14852 future.FutureAPI = &azFuture 14853 future.Result = future.result 14854 return nil 14855} 14856 14857// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 14858func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14859 var done bool 14860 done, err = future.DoneWithContext(context.Background(), client) 14861 if err != nil { 14862 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 14863 return 14864 } 14865 if !done { 14866 ar.Response = future.Response() 14867 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 14868 return 14869 } 14870 ar.Response = future.Response() 14871 return 14872} 14873 14874// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 14875// long-running operation. 14876type VirtualMachinesCreateOrUpdateFuture struct { 14877 azure.FutureAPI 14878 // Result returns the result of the asynchronous operation. 14879 // If the operation has not completed it will return an error. 14880 Result func(VirtualMachinesClient) (VirtualMachine, error) 14881} 14882 14883// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14884func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 14885 var azFuture azure.Future 14886 if err := json.Unmarshal(body, &azFuture); err != nil { 14887 return err 14888 } 14889 future.FutureAPI = &azFuture 14890 future.Result = future.result 14891 return nil 14892} 14893 14894// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 14895func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 14896 var done bool 14897 done, err = future.DoneWithContext(context.Background(), client) 14898 if err != nil { 14899 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 14900 return 14901 } 14902 if !done { 14903 VM.Response.Response = future.Response() 14904 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 14905 return 14906 } 14907 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14908 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 14909 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 14910 if err != nil { 14911 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 14912 } 14913 } 14914 return 14915} 14916 14917// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 14918// long-running operation. 14919type VirtualMachinesDeallocateFuture struct { 14920 azure.FutureAPI 14921 // Result returns the result of the asynchronous operation. 14922 // If the operation has not completed it will return an error. 14923 Result func(VirtualMachinesClient) (autorest.Response, error) 14924} 14925 14926// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14927func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 14928 var azFuture azure.Future 14929 if err := json.Unmarshal(body, &azFuture); err != nil { 14930 return err 14931 } 14932 future.FutureAPI = &azFuture 14933 future.Result = future.result 14934 return nil 14935} 14936 14937// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 14938func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14939 var done bool 14940 done, err = future.DoneWithContext(context.Background(), client) 14941 if err != nil { 14942 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 14943 return 14944 } 14945 if !done { 14946 ar.Response = future.Response() 14947 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 14948 return 14949 } 14950 ar.Response = future.Response() 14951 return 14952} 14953 14954// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 14955// operation. 14956type VirtualMachinesDeleteFuture struct { 14957 azure.FutureAPI 14958 // Result returns the result of the asynchronous operation. 14959 // If the operation has not completed it will return an error. 14960 Result func(VirtualMachinesClient) (autorest.Response, error) 14961} 14962 14963// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14964func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 14965 var azFuture azure.Future 14966 if err := json.Unmarshal(body, &azFuture); err != nil { 14967 return err 14968 } 14969 future.FutureAPI = &azFuture 14970 future.Result = future.result 14971 return nil 14972} 14973 14974// result is the default implementation for VirtualMachinesDeleteFuture.Result. 14975func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 14976 var done bool 14977 done, err = future.DoneWithContext(context.Background(), client) 14978 if err != nil { 14979 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 14980 return 14981 } 14982 if !done { 14983 ar.Response = future.Response() 14984 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 14985 return 14986 } 14987 ar.Response = future.Response() 14988 return 14989} 14990 14991// VirtualMachineSize describes the properties of a VM size. 14992type VirtualMachineSize struct { 14993 // Name - The name of the virtual machine size. 14994 Name *string `json:"name,omitempty"` 14995 // NumberOfCores - The number of cores supported by the virtual machine size. 14996 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 14997 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 14998 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 14999 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 15000 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 15001 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 15002 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 15003 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 15004 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 15005} 15006 15007// VirtualMachineSizeListResult the List Virtual Machine operation response. 15008type VirtualMachineSizeListResult struct { 15009 autorest.Response `json:"-"` 15010 // Value - The list of virtual machine sizes. 15011 Value *[]VirtualMachineSize `json:"value,omitempty"` 15012} 15013 15014// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 15015// long-running operation. 15016type VirtualMachinesPerformMaintenanceFuture struct { 15017 azure.FutureAPI 15018 // Result returns the result of the asynchronous operation. 15019 // If the operation has not completed it will return an error. 15020 Result func(VirtualMachinesClient) (autorest.Response, error) 15021} 15022 15023// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15024func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 15025 var azFuture azure.Future 15026 if err := json.Unmarshal(body, &azFuture); err != nil { 15027 return err 15028 } 15029 future.FutureAPI = &azFuture 15030 future.Result = future.result 15031 return nil 15032} 15033 15034// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 15035func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 15036 var done bool 15037 done, err = future.DoneWithContext(context.Background(), client) 15038 if err != nil { 15039 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 15040 return 15041 } 15042 if !done { 15043 ar.Response = future.Response() 15044 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 15045 return 15046 } 15047 ar.Response = future.Response() 15048 return 15049} 15050 15051// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 15052// operation. 15053type VirtualMachinesPowerOffFuture struct { 15054 azure.FutureAPI 15055 // Result returns the result of the asynchronous operation. 15056 // If the operation has not completed it will return an error. 15057 Result func(VirtualMachinesClient) (autorest.Response, error) 15058} 15059 15060// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15061func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 15062 var azFuture azure.Future 15063 if err := json.Unmarshal(body, &azFuture); err != nil { 15064 return err 15065 } 15066 future.FutureAPI = &azFuture 15067 future.Result = future.result 15068 return nil 15069} 15070 15071// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 15072func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 15073 var done bool 15074 done, err = future.DoneWithContext(context.Background(), client) 15075 if err != nil { 15076 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 15077 return 15078 } 15079 if !done { 15080 ar.Response = future.Response() 15081 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 15082 return 15083 } 15084 ar.Response = future.Response() 15085 return 15086} 15087 15088// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 15089// operation. 15090type VirtualMachinesReapplyFuture struct { 15091 azure.FutureAPI 15092 // Result returns the result of the asynchronous operation. 15093 // If the operation has not completed it will return an error. 15094 Result func(VirtualMachinesClient) (autorest.Response, error) 15095} 15096 15097// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15098func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { 15099 var azFuture azure.Future 15100 if err := json.Unmarshal(body, &azFuture); err != nil { 15101 return err 15102 } 15103 future.FutureAPI = &azFuture 15104 future.Result = future.result 15105 return nil 15106} 15107 15108// result is the default implementation for VirtualMachinesReapplyFuture.Result. 15109func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 15110 var done bool 15111 done, err = future.DoneWithContext(context.Background(), client) 15112 if err != nil { 15113 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") 15114 return 15115 } 15116 if !done { 15117 ar.Response = future.Response() 15118 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") 15119 return 15120 } 15121 ar.Response = future.Response() 15122 return 15123} 15124 15125// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 15126// operation. 15127type VirtualMachinesRedeployFuture struct { 15128 azure.FutureAPI 15129 // Result returns the result of the asynchronous operation. 15130 // If the operation has not completed it will return an error. 15131 Result func(VirtualMachinesClient) (autorest.Response, error) 15132} 15133 15134// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15135func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 15136 var azFuture azure.Future 15137 if err := json.Unmarshal(body, &azFuture); err != nil { 15138 return err 15139 } 15140 future.FutureAPI = &azFuture 15141 future.Result = future.result 15142 return nil 15143} 15144 15145// result is the default implementation for VirtualMachinesRedeployFuture.Result. 15146func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 15147 var done bool 15148 done, err = future.DoneWithContext(context.Background(), client) 15149 if err != nil { 15150 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 15151 return 15152 } 15153 if !done { 15154 ar.Response = future.Response() 15155 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 15156 return 15157 } 15158 ar.Response = future.Response() 15159 return 15160} 15161 15162// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 15163// operation. 15164type VirtualMachinesReimageFuture struct { 15165 azure.FutureAPI 15166 // Result returns the result of the asynchronous operation. 15167 // If the operation has not completed it will return an error. 15168 Result func(VirtualMachinesClient) (autorest.Response, error) 15169} 15170 15171// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15172func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 15173 var azFuture azure.Future 15174 if err := json.Unmarshal(body, &azFuture); err != nil { 15175 return err 15176 } 15177 future.FutureAPI = &azFuture 15178 future.Result = future.result 15179 return nil 15180} 15181 15182// result is the default implementation for VirtualMachinesReimageFuture.Result. 15183func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 15184 var done bool 15185 done, err = future.DoneWithContext(context.Background(), client) 15186 if err != nil { 15187 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 15188 return 15189 } 15190 if !done { 15191 ar.Response = future.Response() 15192 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 15193 return 15194 } 15195 ar.Response = future.Response() 15196 return 15197} 15198 15199// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 15200// operation. 15201type VirtualMachinesRestartFuture struct { 15202 azure.FutureAPI 15203 // Result returns the result of the asynchronous operation. 15204 // If the operation has not completed it will return an error. 15205 Result func(VirtualMachinesClient) (autorest.Response, error) 15206} 15207 15208// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15209func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 15210 var azFuture azure.Future 15211 if err := json.Unmarshal(body, &azFuture); err != nil { 15212 return err 15213 } 15214 future.FutureAPI = &azFuture 15215 future.Result = future.result 15216 return nil 15217} 15218 15219// result is the default implementation for VirtualMachinesRestartFuture.Result. 15220func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 15221 var done bool 15222 done, err = future.DoneWithContext(context.Background(), client) 15223 if err != nil { 15224 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 15225 return 15226 } 15227 if !done { 15228 ar.Response = future.Response() 15229 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 15230 return 15231 } 15232 ar.Response = future.Response() 15233 return 15234} 15235 15236// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 15237// long-running operation. 15238type VirtualMachinesRunCommandFuture struct { 15239 azure.FutureAPI 15240 // Result returns the result of the asynchronous operation. 15241 // If the operation has not completed it will return an error. 15242 Result func(VirtualMachinesClient) (RunCommandResult, error) 15243} 15244 15245// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15246func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { 15247 var azFuture azure.Future 15248 if err := json.Unmarshal(body, &azFuture); err != nil { 15249 return err 15250 } 15251 future.FutureAPI = &azFuture 15252 future.Result = future.result 15253 return nil 15254} 15255 15256// result is the default implementation for VirtualMachinesRunCommandFuture.Result. 15257func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { 15258 var done bool 15259 done, err = future.DoneWithContext(context.Background(), client) 15260 if err != nil { 15261 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") 15262 return 15263 } 15264 if !done { 15265 rcr.Response.Response = future.Response() 15266 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") 15267 return 15268 } 15269 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15270 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 15271 rcr, err = client.RunCommandResponder(rcr.Response.Response) 15272 if err != nil { 15273 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 15274 } 15275 } 15276 return 15277} 15278 15279// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 15280// operation. 15281type VirtualMachinesStartFuture struct { 15282 azure.FutureAPI 15283 // Result returns the result of the asynchronous operation. 15284 // If the operation has not completed it will return an error. 15285 Result func(VirtualMachinesClient) (autorest.Response, error) 15286} 15287 15288// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15289func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 15290 var azFuture azure.Future 15291 if err := json.Unmarshal(body, &azFuture); err != nil { 15292 return err 15293 } 15294 future.FutureAPI = &azFuture 15295 future.Result = future.result 15296 return nil 15297} 15298 15299// result is the default implementation for VirtualMachinesStartFuture.Result. 15300func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 15301 var done bool 15302 done, err = future.DoneWithContext(context.Background(), client) 15303 if err != nil { 15304 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 15305 return 15306 } 15307 if !done { 15308 ar.Response = future.Response() 15309 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 15310 return 15311 } 15312 ar.Response = future.Response() 15313 return 15314} 15315 15316// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 15317// status summary. 15318type VirtualMachineStatusCodeCount struct { 15319 // Code - READ-ONLY; The instance view status code. 15320 Code *string `json:"code,omitempty"` 15321 // Count - READ-ONLY; The number of instances having a particular status code. 15322 Count *int32 `json:"count,omitempty"` 15323} 15324 15325// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. 15326func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { 15327 objectMap := make(map[string]interface{}) 15328 return json.Marshal(objectMap) 15329} 15330 15331// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 15332// operation. 15333type VirtualMachinesUpdateFuture struct { 15334 azure.FutureAPI 15335 // Result returns the result of the asynchronous operation. 15336 // If the operation has not completed it will return an error. 15337 Result func(VirtualMachinesClient) (VirtualMachine, error) 15338} 15339 15340// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15341func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 15342 var azFuture azure.Future 15343 if err := json.Unmarshal(body, &azFuture); err != nil { 15344 return err 15345 } 15346 future.FutureAPI = &azFuture 15347 future.Result = future.result 15348 return nil 15349} 15350 15351// result is the default implementation for VirtualMachinesUpdateFuture.Result. 15352func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 15353 var done bool 15354 done, err = future.DoneWithContext(context.Background(), client) 15355 if err != nil { 15356 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 15357 return 15358 } 15359 if !done { 15360 VM.Response.Response = future.Response() 15361 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 15362 return 15363 } 15364 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15365 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 15366 VM, err = client.UpdateResponder(VM.Response.Response) 15367 if err != nil { 15368 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 15369 } 15370 } 15371 return 15372} 15373 15374// VirtualMachineUpdate describes a Virtual Machine Update. 15375type VirtualMachineUpdate struct { 15376 // 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**. 15377 Plan *Plan `json:"plan,omitempty"` 15378 *VirtualMachineProperties `json:"properties,omitempty"` 15379 // Identity - The identity of the virtual machine, if configured. 15380 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 15381 // Zones - The virtual machine zones. 15382 Zones *[]string `json:"zones,omitempty"` 15383 // Tags - Resource tags 15384 Tags map[string]*string `json:"tags"` 15385} 15386 15387// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 15388func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 15389 objectMap := make(map[string]interface{}) 15390 if vmu.Plan != nil { 15391 objectMap["plan"] = vmu.Plan 15392 } 15393 if vmu.VirtualMachineProperties != nil { 15394 objectMap["properties"] = vmu.VirtualMachineProperties 15395 } 15396 if vmu.Identity != nil { 15397 objectMap["identity"] = vmu.Identity 15398 } 15399 if vmu.Zones != nil { 15400 objectMap["zones"] = vmu.Zones 15401 } 15402 if vmu.Tags != nil { 15403 objectMap["tags"] = vmu.Tags 15404 } 15405 return json.Marshal(objectMap) 15406} 15407 15408// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 15409func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 15410 var m map[string]*json.RawMessage 15411 err := json.Unmarshal(body, &m) 15412 if err != nil { 15413 return err 15414 } 15415 for k, v := range m { 15416 switch k { 15417 case "plan": 15418 if v != nil { 15419 var plan Plan 15420 err = json.Unmarshal(*v, &plan) 15421 if err != nil { 15422 return err 15423 } 15424 vmu.Plan = &plan 15425 } 15426 case "properties": 15427 if v != nil { 15428 var virtualMachineProperties VirtualMachineProperties 15429 err = json.Unmarshal(*v, &virtualMachineProperties) 15430 if err != nil { 15431 return err 15432 } 15433 vmu.VirtualMachineProperties = &virtualMachineProperties 15434 } 15435 case "identity": 15436 if v != nil { 15437 var identity VirtualMachineIdentity 15438 err = json.Unmarshal(*v, &identity) 15439 if err != nil { 15440 return err 15441 } 15442 vmu.Identity = &identity 15443 } 15444 case "zones": 15445 if v != nil { 15446 var zones []string 15447 err = json.Unmarshal(*v, &zones) 15448 if err != nil { 15449 return err 15450 } 15451 vmu.Zones = &zones 15452 } 15453 case "tags": 15454 if v != nil { 15455 var tags map[string]*string 15456 err = json.Unmarshal(*v, &tags) 15457 if err != nil { 15458 return err 15459 } 15460 vmu.Tags = tags 15461 } 15462 } 15463 } 15464 15465 return nil 15466} 15467 15468// VMScaleSetConvertToSinglePlacementGroupInput ... 15469type VMScaleSetConvertToSinglePlacementGroupInput struct { 15470 // 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. 15471 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 15472} 15473 15474// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 15475type WindowsConfiguration struct { 15476 // 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. 15477 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 15478 // 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. 15479 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 15480 // 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). 15481 TimeZone *string `json:"timeZone,omitempty"` 15482 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 15483 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 15484 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 15485 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 15486} 15487 15488// WinRMConfiguration describes Windows Remote Management configuration of the VM 15489type WinRMConfiguration struct { 15490 // Listeners - The list of Windows Remote Management listeners 15491 Listeners *[]WinRMListener `json:"listeners,omitempty"` 15492} 15493 15494// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 15495type WinRMListener struct { 15496 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 15497 Protocol ProtocolTypes `json:"protocol,omitempty"` 15498 // 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>} 15499 CertificateURL *string `json:"certificateUrl,omitempty"` 15500} 15501