1package compute 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/compute/mgmt/2016-04-30-preview/compute" 33 34// AccessURI a disk access SAS uri. 35type AccessURI struct { 36 autorest.Response `json:"-"` 37 // AccessURIOutput - Operation output data (raw JSON) 38 *AccessURIOutput `json:"properties,omitempty"` 39} 40 41// MarshalJSON is the custom marshaler for AccessURI. 42func (au AccessURI) MarshalJSON() ([]byte, error) { 43 objectMap := make(map[string]interface{}) 44 if au.AccessURIOutput != nil { 45 objectMap["properties"] = au.AccessURIOutput 46 } 47 return json.Marshal(objectMap) 48} 49 50// UnmarshalJSON is the custom unmarshaler for AccessURI struct. 51func (au *AccessURI) UnmarshalJSON(body []byte) error { 52 var m map[string]*json.RawMessage 53 err := json.Unmarshal(body, &m) 54 if err != nil { 55 return err 56 } 57 for k, v := range m { 58 switch k { 59 case "properties": 60 if v != nil { 61 var accessURIOutput AccessURIOutput 62 err = json.Unmarshal(*v, &accessURIOutput) 63 if err != nil { 64 return err 65 } 66 au.AccessURIOutput = &accessURIOutput 67 } 68 } 69 } 70 71 return nil 72} 73 74// AccessURIOutput azure properties, including output. 75type AccessURIOutput struct { 76 // AccessURIRaw - Operation output data (raw JSON) 77 *AccessURIRaw `json:"output,omitempty"` 78} 79 80// MarshalJSON is the custom marshaler for AccessURIOutput. 81func (auo AccessURIOutput) MarshalJSON() ([]byte, error) { 82 objectMap := make(map[string]interface{}) 83 if auo.AccessURIRaw != nil { 84 objectMap["output"] = auo.AccessURIRaw 85 } 86 return json.Marshal(objectMap) 87} 88 89// UnmarshalJSON is the custom unmarshaler for AccessURIOutput struct. 90func (auo *AccessURIOutput) UnmarshalJSON(body []byte) error { 91 var m map[string]*json.RawMessage 92 err := json.Unmarshal(body, &m) 93 if err != nil { 94 return err 95 } 96 for k, v := range m { 97 switch k { 98 case "output": 99 if v != nil { 100 var accessURIRaw AccessURIRaw 101 err = json.Unmarshal(*v, &accessURIRaw) 102 if err != nil { 103 return err 104 } 105 auo.AccessURIRaw = &accessURIRaw 106 } 107 } 108 } 109 110 return nil 111} 112 113// AccessURIRaw this object gets 'bubbled up' through flattening. 114type AccessURIRaw struct { 115 // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. 116 AccessSAS *string `json:"accessSAS,omitempty"` 117} 118 119// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 120// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 121// and the pass in which the content is applied. 122type AdditionalUnattendContent struct { 123 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' 124 PassName PassNames `json:"passName,omitempty"` 125 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' 126 ComponentName ComponentNames `json:"componentName,omitempty"` 127 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' 128 SettingName SettingNames `json:"settingName,omitempty"` 129 // 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. 130 Content *string `json:"content,omitempty"` 131} 132 133// APIEntityReference the API entity reference. 134type APIEntityReference struct { 135 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 136 ID *string `json:"id,omitempty"` 137} 138 139// APIError api error. 140type APIError struct { 141 // Details - The Api error details 142 Details *[]APIErrorBase `json:"details,omitempty"` 143 // Innererror - The Api inner error 144 Innererror *InnerError `json:"innererror,omitempty"` 145 // Code - The error code. 146 Code *string `json:"code,omitempty"` 147 // Target - The target of the particular error. 148 Target *string `json:"target,omitempty"` 149 // Message - The error message. 150 Message *string `json:"message,omitempty"` 151} 152 153// APIErrorBase api error base. 154type APIErrorBase struct { 155 // Code - The error code. 156 Code *string `json:"code,omitempty"` 157 // Target - The target of the particular error. 158 Target *string `json:"target,omitempty"` 159 // Message - The error message. 160 Message *string `json:"message,omitempty"` 161} 162 163// AvailabilitySet specifies information about the availability set that the virtual machine should be 164// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 165// maximize availability. For more information about availability sets, see [Manage the availability of 166// virtual 167// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 168// <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual 169// machines in 170// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) 171// <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot 172// be added to an availability set. 173type AvailabilitySet struct { 174 autorest.Response `json:"-"` 175 *AvailabilitySetProperties `json:"properties,omitempty"` 176 // Sku - Sku of the availability set 177 Sku *Sku `json:"sku,omitempty"` 178 // ID - READ-ONLY; Resource Id 179 ID *string `json:"id,omitempty"` 180 // Name - READ-ONLY; Resource name 181 Name *string `json:"name,omitempty"` 182 // Type - READ-ONLY; Resource type 183 Type *string `json:"type,omitempty"` 184 // Location - Resource location 185 Location *string `json:"location,omitempty"` 186 // Tags - Resource tags 187 Tags map[string]*string `json:"tags"` 188} 189 190// MarshalJSON is the custom marshaler for AvailabilitySet. 191func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 192 objectMap := make(map[string]interface{}) 193 if as.AvailabilitySetProperties != nil { 194 objectMap["properties"] = as.AvailabilitySetProperties 195 } 196 if as.Sku != nil { 197 objectMap["sku"] = as.Sku 198 } 199 if as.Location != nil { 200 objectMap["location"] = as.Location 201 } 202 if as.Tags != nil { 203 objectMap["tags"] = as.Tags 204 } 205 return json.Marshal(objectMap) 206} 207 208// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 209func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 210 var m map[string]*json.RawMessage 211 err := json.Unmarshal(body, &m) 212 if err != nil { 213 return err 214 } 215 for k, v := range m { 216 switch k { 217 case "properties": 218 if v != nil { 219 var availabilitySetProperties AvailabilitySetProperties 220 err = json.Unmarshal(*v, &availabilitySetProperties) 221 if err != nil { 222 return err 223 } 224 as.AvailabilitySetProperties = &availabilitySetProperties 225 } 226 case "sku": 227 if v != nil { 228 var sku Sku 229 err = json.Unmarshal(*v, &sku) 230 if err != nil { 231 return err 232 } 233 as.Sku = &sku 234 } 235 case "id": 236 if v != nil { 237 var ID string 238 err = json.Unmarshal(*v, &ID) 239 if err != nil { 240 return err 241 } 242 as.ID = &ID 243 } 244 case "name": 245 if v != nil { 246 var name string 247 err = json.Unmarshal(*v, &name) 248 if err != nil { 249 return err 250 } 251 as.Name = &name 252 } 253 case "type": 254 if v != nil { 255 var typeVar string 256 err = json.Unmarshal(*v, &typeVar) 257 if err != nil { 258 return err 259 } 260 as.Type = &typeVar 261 } 262 case "location": 263 if v != nil { 264 var location string 265 err = json.Unmarshal(*v, &location) 266 if err != nil { 267 return err 268 } 269 as.Location = &location 270 } 271 case "tags": 272 if v != nil { 273 var tags map[string]*string 274 err = json.Unmarshal(*v, &tags) 275 if err != nil { 276 return err 277 } 278 as.Tags = tags 279 } 280 } 281 } 282 283 return nil 284} 285 286// AvailabilitySetListResult the List Availability Set operation response. 287type AvailabilitySetListResult struct { 288 autorest.Response `json:"-"` 289 // Value - The list of availability sets 290 Value *[]AvailabilitySet `json:"value,omitempty"` 291 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 292 NextLink *string `json:"nextLink,omitempty"` 293} 294 295// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 296type AvailabilitySetListResultIterator struct { 297 i int 298 page AvailabilitySetListResultPage 299} 300 301// NextWithContext advances to the next value. If there was an error making 302// the request the iterator does not advance and the error is returned. 303func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 304 if tracing.IsEnabled() { 305 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 306 defer func() { 307 sc := -1 308 if iter.Response().Response.Response != nil { 309 sc = iter.Response().Response.Response.StatusCode 310 } 311 tracing.EndSpan(ctx, sc, err) 312 }() 313 } 314 iter.i++ 315 if iter.i < len(iter.page.Values()) { 316 return nil 317 } 318 err = iter.page.NextWithContext(ctx) 319 if err != nil { 320 iter.i-- 321 return err 322 } 323 iter.i = 0 324 return nil 325} 326 327// Next advances to the next value. If there was an error making 328// the request the iterator does not advance and the error is returned. 329// Deprecated: Use NextWithContext() instead. 330func (iter *AvailabilitySetListResultIterator) Next() error { 331 return iter.NextWithContext(context.Background()) 332} 333 334// NotDone returns true if the enumeration should be started or is not yet complete. 335func (iter AvailabilitySetListResultIterator) NotDone() bool { 336 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 337} 338 339// Response returns the raw server response from the last page request. 340func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 341 return iter.page.Response() 342} 343 344// Value returns the current value or a zero-initialized value if the 345// iterator has advanced beyond the end of the collection. 346func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 347 if !iter.page.NotDone() { 348 return AvailabilitySet{} 349 } 350 return iter.page.Values()[iter.i] 351} 352 353// Creates a new instance of the AvailabilitySetListResultIterator type. 354func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 355 return AvailabilitySetListResultIterator{page: page} 356} 357 358// IsEmpty returns true if the ListResult contains no values. 359func (aslr AvailabilitySetListResult) IsEmpty() bool { 360 return aslr.Value == nil || len(*aslr.Value) == 0 361} 362 363// hasNextLink returns true if the NextLink is not empty. 364func (aslr AvailabilitySetListResult) hasNextLink() bool { 365 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 366} 367 368// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 369// It returns nil if no more results exist. 370func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 371 if !aslr.hasNextLink() { 372 return nil, nil 373 } 374 return autorest.Prepare((&http.Request{}).WithContext(ctx), 375 autorest.AsJSON(), 376 autorest.AsGet(), 377 autorest.WithBaseURL(to.String(aslr.NextLink))) 378} 379 380// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 381type AvailabilitySetListResultPage struct { 382 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 383 aslr AvailabilitySetListResult 384} 385 386// NextWithContext advances to the next page of values. If there was an error making 387// the request the page does not advance and the error is returned. 388func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 389 if tracing.IsEnabled() { 390 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 391 defer func() { 392 sc := -1 393 if page.Response().Response.Response != nil { 394 sc = page.Response().Response.Response.StatusCode 395 } 396 tracing.EndSpan(ctx, sc, err) 397 }() 398 } 399 for { 400 next, err := page.fn(ctx, page.aslr) 401 if err != nil { 402 return err 403 } 404 page.aslr = next 405 if !next.hasNextLink() || !next.IsEmpty() { 406 break 407 } 408 } 409 return nil 410} 411 412// Next advances to the next page of values. If there was an error making 413// the request the page does not advance and the error is returned. 414// Deprecated: Use NextWithContext() instead. 415func (page *AvailabilitySetListResultPage) Next() error { 416 return page.NextWithContext(context.Background()) 417} 418 419// NotDone returns true if the page enumeration should be started or is not yet complete. 420func (page AvailabilitySetListResultPage) NotDone() bool { 421 return !page.aslr.IsEmpty() 422} 423 424// Response returns the raw server response from the last page request. 425func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 426 return page.aslr 427} 428 429// Values returns the slice of values for the current page or nil if there are no values. 430func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 431 if page.aslr.IsEmpty() { 432 return nil 433 } 434 return *page.aslr.Value 435} 436 437// Creates a new instance of the AvailabilitySetListResultPage type. 438func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 439 return AvailabilitySetListResultPage{ 440 fn: getNextPage, 441 aslr: cur, 442 } 443} 444 445// AvailabilitySetProperties the instance view of a resource. 446type AvailabilitySetProperties struct { 447 // PlatformUpdateDomainCount - Update Domain count. 448 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 449 // PlatformFaultDomainCount - Fault Domain count. 450 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 451 // VirtualMachines - A list of references to all virtual machines in the availability set. 452 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 453 // Statuses - READ-ONLY; The resource status information. 454 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 455 // Managed - If the availability set supports managed disks. 456 Managed *bool `json:"managed,omitempty"` 457} 458 459// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 460func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 461 objectMap := make(map[string]interface{}) 462 if asp.PlatformUpdateDomainCount != nil { 463 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 464 } 465 if asp.PlatformFaultDomainCount != nil { 466 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 467 } 468 if asp.VirtualMachines != nil { 469 objectMap["virtualMachines"] = asp.VirtualMachines 470 } 471 if asp.Managed != nil { 472 objectMap["managed"] = asp.Managed 473 } 474 return json.Marshal(objectMap) 475} 476 477// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 478// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 479// Azure also enables you to see a screenshot of the VM from the hypervisor. 480type BootDiagnostics struct { 481 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 482 Enabled *bool `json:"enabled,omitempty"` 483 // StorageURI - Uri of the storage account to use for placing the console output and screenshot. 484 StorageURI *string `json:"storageUri,omitempty"` 485} 486 487// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 488type BootDiagnosticsInstanceView struct { 489 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. 490 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 491 // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri. 492 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 493} 494 495// CreationData data used when creating a disk. 496type CreationData struct { 497 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' 498 CreateOption DiskCreateOption `json:"createOption,omitempty"` 499 // StorageAccountID - If createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription 500 StorageAccountID *string `json:"storageAccountId,omitempty"` 501 // ImageReference - Disk source information. 502 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 503 // SourceURI - If createOption is Import, this is a SAS URI to a blob to be imported into a managed disk. If createOption is Copy, this is a relative Uri containing the id of the source snapshot to be copied into a managed disk. 504 SourceURI *string `json:"sourceUri,omitempty"` 505 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. If createOption is Restore, this is the ARM-like id of the source disk restore point. 506 SourceResourceID *string `json:"sourceResourceId,omitempty"` 507} 508 509// DataDisk describes a data disk. 510type DataDisk struct { 511 // 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. 512 Lun *int32 `json:"lun,omitempty"` 513 // Name - The disk name. 514 Name *string `json:"name,omitempty"` 515 // Vhd - The virtual hard disk. 516 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 517 // 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. 518 Image *VirtualHardDisk `json:"image,omitempty"` 519 // 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' 520 Caching CachingTypes `json:"caching,omitempty"` 521 // 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' 522 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 523 // 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 524 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 525 // ManagedDisk - The managed disk parameters. 526 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 527} 528 529// DataDiskImage contains the data disk images information. 530type DataDiskImage struct { 531 // 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. 532 Lun *int32 `json:"lun,omitempty"` 533} 534 535// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 536// 2015-06-15. 537type DiagnosticsProfile struct { 538 // 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. 539 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 540} 541 542// Disk disk resource. 543type Disk struct { 544 autorest.Response `json:"-"` 545 *DiskProperties `json:"properties,omitempty"` 546 // ID - READ-ONLY; Resource Id 547 ID *string `json:"id,omitempty"` 548 // Name - READ-ONLY; Resource name 549 Name *string `json:"name,omitempty"` 550 // Type - READ-ONLY; Resource type 551 Type *string `json:"type,omitempty"` 552 // Location - Resource location 553 Location *string `json:"location,omitempty"` 554 // Tags - Resource tags 555 Tags map[string]*string `json:"tags"` 556} 557 558// MarshalJSON is the custom marshaler for Disk. 559func (d Disk) MarshalJSON() ([]byte, error) { 560 objectMap := make(map[string]interface{}) 561 if d.DiskProperties != nil { 562 objectMap["properties"] = d.DiskProperties 563 } 564 if d.Location != nil { 565 objectMap["location"] = d.Location 566 } 567 if d.Tags != nil { 568 objectMap["tags"] = d.Tags 569 } 570 return json.Marshal(objectMap) 571} 572 573// UnmarshalJSON is the custom unmarshaler for Disk struct. 574func (d *Disk) UnmarshalJSON(body []byte) error { 575 var m map[string]*json.RawMessage 576 err := json.Unmarshal(body, &m) 577 if err != nil { 578 return err 579 } 580 for k, v := range m { 581 switch k { 582 case "properties": 583 if v != nil { 584 var diskProperties DiskProperties 585 err = json.Unmarshal(*v, &diskProperties) 586 if err != nil { 587 return err 588 } 589 d.DiskProperties = &diskProperties 590 } 591 case "id": 592 if v != nil { 593 var ID string 594 err = json.Unmarshal(*v, &ID) 595 if err != nil { 596 return err 597 } 598 d.ID = &ID 599 } 600 case "name": 601 if v != nil { 602 var name string 603 err = json.Unmarshal(*v, &name) 604 if err != nil { 605 return err 606 } 607 d.Name = &name 608 } 609 case "type": 610 if v != nil { 611 var typeVar string 612 err = json.Unmarshal(*v, &typeVar) 613 if err != nil { 614 return err 615 } 616 d.Type = &typeVar 617 } 618 case "location": 619 if v != nil { 620 var location string 621 err = json.Unmarshal(*v, &location) 622 if err != nil { 623 return err 624 } 625 d.Location = &location 626 } 627 case "tags": 628 if v != nil { 629 var tags map[string]*string 630 err = json.Unmarshal(*v, &tags) 631 if err != nil { 632 return err 633 } 634 d.Tags = tags 635 } 636 } 637 } 638 639 return nil 640} 641 642// DiskEncryptionSettings describes a Encryption Settings for a Disk 643type DiskEncryptionSettings struct { 644 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 645 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 646 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 647 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 648 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 649 Enabled *bool `json:"enabled,omitempty"` 650} 651 652// DiskInstanceView the instance view of the disk. 653type DiskInstanceView struct { 654 // Name - The disk name. 655 Name *string `json:"name,omitempty"` 656 // Statuses - The resource status information. 657 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 658} 659 660// DiskList the List Disks operation response. 661type DiskList struct { 662 autorest.Response `json:"-"` 663 // Value - A list of disks. 664 Value *[]Disk `json:"value,omitempty"` 665 // NextLink - the uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 666 NextLink *string `json:"nextLink,omitempty"` 667} 668 669// DiskListIterator provides access to a complete listing of Disk values. 670type DiskListIterator struct { 671 i int 672 page DiskListPage 673} 674 675// NextWithContext advances to the next value. If there was an error making 676// the request the iterator does not advance and the error is returned. 677func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 678 if tracing.IsEnabled() { 679 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 680 defer func() { 681 sc := -1 682 if iter.Response().Response.Response != nil { 683 sc = iter.Response().Response.Response.StatusCode 684 } 685 tracing.EndSpan(ctx, sc, err) 686 }() 687 } 688 iter.i++ 689 if iter.i < len(iter.page.Values()) { 690 return nil 691 } 692 err = iter.page.NextWithContext(ctx) 693 if err != nil { 694 iter.i-- 695 return err 696 } 697 iter.i = 0 698 return nil 699} 700 701// Next advances to the next value. If there was an error making 702// the request the iterator does not advance and the error is returned. 703// Deprecated: Use NextWithContext() instead. 704func (iter *DiskListIterator) Next() error { 705 return iter.NextWithContext(context.Background()) 706} 707 708// NotDone returns true if the enumeration should be started or is not yet complete. 709func (iter DiskListIterator) NotDone() bool { 710 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 711} 712 713// Response returns the raw server response from the last page request. 714func (iter DiskListIterator) Response() DiskList { 715 return iter.page.Response() 716} 717 718// Value returns the current value or a zero-initialized value if the 719// iterator has advanced beyond the end of the collection. 720func (iter DiskListIterator) Value() Disk { 721 if !iter.page.NotDone() { 722 return Disk{} 723 } 724 return iter.page.Values()[iter.i] 725} 726 727// Creates a new instance of the DiskListIterator type. 728func NewDiskListIterator(page DiskListPage) DiskListIterator { 729 return DiskListIterator{page: page} 730} 731 732// IsEmpty returns true if the ListResult contains no values. 733func (dl DiskList) IsEmpty() bool { 734 return dl.Value == nil || len(*dl.Value) == 0 735} 736 737// hasNextLink returns true if the NextLink is not empty. 738func (dl DiskList) hasNextLink() bool { 739 return dl.NextLink != nil && len(*dl.NextLink) != 0 740} 741 742// diskListPreparer prepares a request to retrieve the next set of results. 743// It returns nil if no more results exist. 744func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 745 if !dl.hasNextLink() { 746 return nil, nil 747 } 748 return autorest.Prepare((&http.Request{}).WithContext(ctx), 749 autorest.AsJSON(), 750 autorest.AsGet(), 751 autorest.WithBaseURL(to.String(dl.NextLink))) 752} 753 754// DiskListPage contains a page of Disk values. 755type DiskListPage struct { 756 fn func(context.Context, DiskList) (DiskList, error) 757 dl DiskList 758} 759 760// NextWithContext advances to the next page of values. If there was an error making 761// the request the page does not advance and the error is returned. 762func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 763 if tracing.IsEnabled() { 764 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 765 defer func() { 766 sc := -1 767 if page.Response().Response.Response != nil { 768 sc = page.Response().Response.Response.StatusCode 769 } 770 tracing.EndSpan(ctx, sc, err) 771 }() 772 } 773 for { 774 next, err := page.fn(ctx, page.dl) 775 if err != nil { 776 return err 777 } 778 page.dl = next 779 if !next.hasNextLink() || !next.IsEmpty() { 780 break 781 } 782 } 783 return nil 784} 785 786// Next advances to the next page of values. If there was an error making 787// the request the page does not advance and the error is returned. 788// Deprecated: Use NextWithContext() instead. 789func (page *DiskListPage) Next() error { 790 return page.NextWithContext(context.Background()) 791} 792 793// NotDone returns true if the page enumeration should be started or is not yet complete. 794func (page DiskListPage) NotDone() bool { 795 return !page.dl.IsEmpty() 796} 797 798// Response returns the raw server response from the last page request. 799func (page DiskListPage) Response() DiskList { 800 return page.dl 801} 802 803// Values returns the slice of values for the current page or nil if there are no values. 804func (page DiskListPage) Values() []Disk { 805 if page.dl.IsEmpty() { 806 return nil 807 } 808 return *page.dl.Value 809} 810 811// Creates a new instance of the DiskListPage type. 812func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 813 return DiskListPage{ 814 fn: getNextPage, 815 dl: cur, 816 } 817} 818 819// DiskProperties disk resource properties. 820type DiskProperties struct { 821 // AccountType - the storage account type of the disk. Possible values include: 'StandardLRS', 'PremiumLRS' 822 AccountType StorageAccountTypes `json:"accountType,omitempty"` 823 // TimeCreated - READ-ONLY; The time when the disk was created. 824 TimeCreated *date.Time `json:"timeCreated,omitempty"` 825 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 826 OsType OperatingSystemTypes `json:"osType,omitempty"` 827 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 828 CreationData *CreationData `json:"creationData,omitempty"` 829 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 830 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 831 // EncryptionSettings - Encryption settings for disk or snapshot 832 EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` 833 // OwnerID - READ-ONLY; A relative URI containing the VM id that has the disk attached. 834 OwnerID *string `json:"ownerId,omitempty"` 835 // ProvisioningState - READ-ONLY; The disk provisioning state. 836 ProvisioningState *string `json:"provisioningState,omitempty"` 837} 838 839// MarshalJSON is the custom marshaler for DiskProperties. 840func (dp DiskProperties) MarshalJSON() ([]byte, error) { 841 objectMap := make(map[string]interface{}) 842 if dp.AccountType != "" { 843 objectMap["accountType"] = dp.AccountType 844 } 845 if dp.OsType != "" { 846 objectMap["osType"] = dp.OsType 847 } 848 if dp.CreationData != nil { 849 objectMap["creationData"] = dp.CreationData 850 } 851 if dp.DiskSizeGB != nil { 852 objectMap["diskSizeGB"] = dp.DiskSizeGB 853 } 854 if dp.EncryptionSettings != nil { 855 objectMap["encryptionSettings"] = dp.EncryptionSettings 856 } 857 return json.Marshal(objectMap) 858} 859 860// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 861// operation. 862type DisksCreateOrUpdateFuture struct { 863 azure.FutureAPI 864 // Result returns the result of the asynchronous operation. 865 // If the operation has not completed it will return an error. 866 Result func(DisksClient) (Disk, error) 867} 868 869// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 870type DisksDeleteFuture struct { 871 azure.FutureAPI 872 // Result returns the result of the asynchronous operation. 873 // If the operation has not completed it will return an error. 874 Result func(DisksClient) (OperationStatusResponse, error) 875} 876 877// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 878// operation. 879type DisksGrantAccessFuture struct { 880 azure.FutureAPI 881 // Result returns the result of the asynchronous operation. 882 // If the operation has not completed it will return an error. 883 Result func(DisksClient) (AccessURI, error) 884} 885 886// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 887// operation. 888type DisksRevokeAccessFuture struct { 889 azure.FutureAPI 890 // Result returns the result of the asynchronous operation. 891 // If the operation has not completed it will return an error. 892 Result func(DisksClient) (OperationStatusResponse, error) 893} 894 895// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 896type DisksUpdateFuture struct { 897 azure.FutureAPI 898 // Result returns the result of the asynchronous operation. 899 // If the operation has not completed it will return an error. 900 Result func(DisksClient) (Disk, error) 901} 902 903// DiskUpdate disk update resource. 904type DiskUpdate struct { 905 *DiskUpdateProperties `json:"properties,omitempty"` 906 // Tags - Resource tags 907 Tags map[string]*string `json:"tags"` 908} 909 910// MarshalJSON is the custom marshaler for DiskUpdate. 911func (du DiskUpdate) MarshalJSON() ([]byte, error) { 912 objectMap := make(map[string]interface{}) 913 if du.DiskUpdateProperties != nil { 914 objectMap["properties"] = du.DiskUpdateProperties 915 } 916 if du.Tags != nil { 917 objectMap["tags"] = du.Tags 918 } 919 return json.Marshal(objectMap) 920} 921 922// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 923func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 924 var m map[string]*json.RawMessage 925 err := json.Unmarshal(body, &m) 926 if err != nil { 927 return err 928 } 929 for k, v := range m { 930 switch k { 931 case "properties": 932 if v != nil { 933 var diskUpdateProperties DiskUpdateProperties 934 err = json.Unmarshal(*v, &diskUpdateProperties) 935 if err != nil { 936 return err 937 } 938 du.DiskUpdateProperties = &diskUpdateProperties 939 } 940 case "tags": 941 if v != nil { 942 var tags map[string]*string 943 err = json.Unmarshal(*v, &tags) 944 if err != nil { 945 return err 946 } 947 du.Tags = tags 948 } 949 } 950 } 951 952 return nil 953} 954 955// DiskUpdateProperties disk resource update properties. 956type DiskUpdateProperties struct { 957 // AccountType - the storage account type of the disk. Possible values include: 'StandardLRS', 'PremiumLRS' 958 AccountType StorageAccountTypes `json:"accountType,omitempty"` 959 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 960 OsType OperatingSystemTypes `json:"osType,omitempty"` 961 // CreationData - disk source information. CreationData information cannot be changed after the disk has been created. 962 CreationData *CreationData `json:"creationData,omitempty"` 963 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 964 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 965 // EncryptionSettings - Encryption settings for disk or snapshot 966 EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` 967} 968 969// EncryptionSettings encryption settings for disk or snapshot 970type EncryptionSettings struct { 971 // 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. 972 Enabled *bool `json:"enabled,omitempty"` 973 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 974 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 975 // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key 976 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 977} 978 979// GrantAccessData data used for requesting a SAS. 980type GrantAccessData struct { 981 // Access - Possible values include: 'None', 'Read' 982 Access AccessLevel `json:"access,omitempty"` 983 // DurationInSeconds - Time duration in seconds until the SAS access expires. 984 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 985} 986 987// HardwareProfile specifies the hardware settings for the virtual machine. 988type HardwareProfile struct { 989 // 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](virtualmachines-list-sizes-availability-set.md) <br><br> [List all available virtual machine sizes in a region](virtualmachines-list-sizes-region.md) <br><br> [List all available virtual machine sizes for resizing](virtualmachines-list-sizes-for-resizing.md). Possible values include: 'BasicA0', 'BasicA1', 'BasicA2', 'BasicA3', 'BasicA4', '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', 'StandardD15V2', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardDS1V2', 'StandardDS2V2', 'StandardDS3V2', 'StandardDS4V2', 'StandardDS5V2', 'StandardDS11V2', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5' 990 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 991} 992 993// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 994// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 995// exist. 996type Image struct { 997 autorest.Response `json:"-"` 998 *ImageProperties `json:"properties,omitempty"` 999 // ID - READ-ONLY; Resource Id 1000 ID *string `json:"id,omitempty"` 1001 // Name - READ-ONLY; Resource name 1002 Name *string `json:"name,omitempty"` 1003 // Type - READ-ONLY; Resource type 1004 Type *string `json:"type,omitempty"` 1005 // Location - Resource location 1006 Location *string `json:"location,omitempty"` 1007 // Tags - Resource tags 1008 Tags map[string]*string `json:"tags"` 1009} 1010 1011// MarshalJSON is the custom marshaler for Image. 1012func (i Image) MarshalJSON() ([]byte, error) { 1013 objectMap := make(map[string]interface{}) 1014 if i.ImageProperties != nil { 1015 objectMap["properties"] = i.ImageProperties 1016 } 1017 if i.Location != nil { 1018 objectMap["location"] = i.Location 1019 } 1020 if i.Tags != nil { 1021 objectMap["tags"] = i.Tags 1022 } 1023 return json.Marshal(objectMap) 1024} 1025 1026// UnmarshalJSON is the custom unmarshaler for Image struct. 1027func (i *Image) UnmarshalJSON(body []byte) error { 1028 var m map[string]*json.RawMessage 1029 err := json.Unmarshal(body, &m) 1030 if err != nil { 1031 return err 1032 } 1033 for k, v := range m { 1034 switch k { 1035 case "properties": 1036 if v != nil { 1037 var imageProperties ImageProperties 1038 err = json.Unmarshal(*v, &imageProperties) 1039 if err != nil { 1040 return err 1041 } 1042 i.ImageProperties = &imageProperties 1043 } 1044 case "id": 1045 if v != nil { 1046 var ID string 1047 err = json.Unmarshal(*v, &ID) 1048 if err != nil { 1049 return err 1050 } 1051 i.ID = &ID 1052 } 1053 case "name": 1054 if v != nil { 1055 var name string 1056 err = json.Unmarshal(*v, &name) 1057 if err != nil { 1058 return err 1059 } 1060 i.Name = &name 1061 } 1062 case "type": 1063 if v != nil { 1064 var typeVar string 1065 err = json.Unmarshal(*v, &typeVar) 1066 if err != nil { 1067 return err 1068 } 1069 i.Type = &typeVar 1070 } 1071 case "location": 1072 if v != nil { 1073 var location string 1074 err = json.Unmarshal(*v, &location) 1075 if err != nil { 1076 return err 1077 } 1078 i.Location = &location 1079 } 1080 case "tags": 1081 if v != nil { 1082 var tags map[string]*string 1083 err = json.Unmarshal(*v, &tags) 1084 if err != nil { 1085 return err 1086 } 1087 i.Tags = tags 1088 } 1089 } 1090 } 1091 1092 return nil 1093} 1094 1095// ImageDataDisk describes a data disk. 1096type ImageDataDisk struct { 1097 // 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. 1098 Lun *int32 `json:"lun,omitempty"` 1099 // Snapshot - The snapshot. 1100 Snapshot *SubResource `json:"snapshot,omitempty"` 1101 // ManagedDisk - The managedDisk. 1102 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 1103 // BlobURI - The Virtual Hard Disk. 1104 BlobURI *string `json:"blobUri,omitempty"` 1105 // 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' 1106 Caching CachingTypes `json:"caching,omitempty"` 1107 // 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 1108 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1109} 1110 1111// ImageDiskReference the source image used for creating the disk. 1112type ImageDiskReference struct { 1113 // ID - A relative uri containing either a Platform Image Repository or user image reference. 1114 ID *string `json:"id,omitempty"` 1115 // 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. 1116 Lun *int32 `json:"lun,omitempty"` 1117} 1118 1119// ImageListResult the List Image operation response. 1120type ImageListResult struct { 1121 autorest.Response `json:"-"` 1122 // Value - The list of Images. 1123 Value *[]Image `json:"value,omitempty"` 1124 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 1125 NextLink *string `json:"nextLink,omitempty"` 1126} 1127 1128// ImageListResultIterator provides access to a complete listing of Image values. 1129type ImageListResultIterator struct { 1130 i int 1131 page ImageListResultPage 1132} 1133 1134// NextWithContext advances to the next value. If there was an error making 1135// the request the iterator does not advance and the error is returned. 1136func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 1137 if tracing.IsEnabled() { 1138 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 1139 defer func() { 1140 sc := -1 1141 if iter.Response().Response.Response != nil { 1142 sc = iter.Response().Response.Response.StatusCode 1143 } 1144 tracing.EndSpan(ctx, sc, err) 1145 }() 1146 } 1147 iter.i++ 1148 if iter.i < len(iter.page.Values()) { 1149 return nil 1150 } 1151 err = iter.page.NextWithContext(ctx) 1152 if err != nil { 1153 iter.i-- 1154 return err 1155 } 1156 iter.i = 0 1157 return nil 1158} 1159 1160// Next advances to the next value. If there was an error making 1161// the request the iterator does not advance and the error is returned. 1162// Deprecated: Use NextWithContext() instead. 1163func (iter *ImageListResultIterator) Next() error { 1164 return iter.NextWithContext(context.Background()) 1165} 1166 1167// NotDone returns true if the enumeration should be started or is not yet complete. 1168func (iter ImageListResultIterator) NotDone() bool { 1169 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1170} 1171 1172// Response returns the raw server response from the last page request. 1173func (iter ImageListResultIterator) Response() ImageListResult { 1174 return iter.page.Response() 1175} 1176 1177// Value returns the current value or a zero-initialized value if the 1178// iterator has advanced beyond the end of the collection. 1179func (iter ImageListResultIterator) Value() Image { 1180 if !iter.page.NotDone() { 1181 return Image{} 1182 } 1183 return iter.page.Values()[iter.i] 1184} 1185 1186// Creates a new instance of the ImageListResultIterator type. 1187func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 1188 return ImageListResultIterator{page: page} 1189} 1190 1191// IsEmpty returns true if the ListResult contains no values. 1192func (ilr ImageListResult) IsEmpty() bool { 1193 return ilr.Value == nil || len(*ilr.Value) == 0 1194} 1195 1196// hasNextLink returns true if the NextLink is not empty. 1197func (ilr ImageListResult) hasNextLink() bool { 1198 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 1199} 1200 1201// imageListResultPreparer prepares a request to retrieve the next set of results. 1202// It returns nil if no more results exist. 1203func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 1204 if !ilr.hasNextLink() { 1205 return nil, nil 1206 } 1207 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1208 autorest.AsJSON(), 1209 autorest.AsGet(), 1210 autorest.WithBaseURL(to.String(ilr.NextLink))) 1211} 1212 1213// ImageListResultPage contains a page of Image values. 1214type ImageListResultPage struct { 1215 fn func(context.Context, ImageListResult) (ImageListResult, error) 1216 ilr ImageListResult 1217} 1218 1219// NextWithContext advances to the next page of values. If there was an error making 1220// the request the page does not advance and the error is returned. 1221func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 1222 if tracing.IsEnabled() { 1223 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 1224 defer func() { 1225 sc := -1 1226 if page.Response().Response.Response != nil { 1227 sc = page.Response().Response.Response.StatusCode 1228 } 1229 tracing.EndSpan(ctx, sc, err) 1230 }() 1231 } 1232 for { 1233 next, err := page.fn(ctx, page.ilr) 1234 if err != nil { 1235 return err 1236 } 1237 page.ilr = next 1238 if !next.hasNextLink() || !next.IsEmpty() { 1239 break 1240 } 1241 } 1242 return nil 1243} 1244 1245// Next advances to the next page of values. If there was an error making 1246// the request the page does not advance and the error is returned. 1247// Deprecated: Use NextWithContext() instead. 1248func (page *ImageListResultPage) Next() error { 1249 return page.NextWithContext(context.Background()) 1250} 1251 1252// NotDone returns true if the page enumeration should be started or is not yet complete. 1253func (page ImageListResultPage) NotDone() bool { 1254 return !page.ilr.IsEmpty() 1255} 1256 1257// Response returns the raw server response from the last page request. 1258func (page ImageListResultPage) Response() ImageListResult { 1259 return page.ilr 1260} 1261 1262// Values returns the slice of values for the current page or nil if there are no values. 1263func (page ImageListResultPage) Values() []Image { 1264 if page.ilr.IsEmpty() { 1265 return nil 1266 } 1267 return *page.ilr.Value 1268} 1269 1270// Creates a new instance of the ImageListResultPage type. 1271func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 1272 return ImageListResultPage{ 1273 fn: getNextPage, 1274 ilr: cur, 1275 } 1276} 1277 1278// ImageOSDisk describes an Operating System disk. 1279type ImageOSDisk struct { 1280 // 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' 1281 OsType OperatingSystemTypes `json:"osType,omitempty"` 1282 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 1283 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 1284 // Snapshot - The snapshot. 1285 Snapshot *SubResource `json:"snapshot,omitempty"` 1286 // ManagedDisk - The managedDisk. 1287 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 1288 // BlobURI - The Virtual Hard Disk. 1289 BlobURI *string `json:"blobUri,omitempty"` 1290 // 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' 1291 Caching CachingTypes `json:"caching,omitempty"` 1292 // 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 1293 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1294} 1295 1296// ImageProperties describes the properties of an Image. 1297type ImageProperties struct { 1298 // SourceVirtualMachine - The source virtual machine from which Image is created. 1299 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 1300 // StorageProfile - Specifies the storage settings for the virtual machine disks. 1301 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 1302 // ProvisioningState - READ-ONLY; The provisioning state. 1303 ProvisioningState *string `json:"provisioningState,omitempty"` 1304} 1305 1306// MarshalJSON is the custom marshaler for ImageProperties. 1307func (IP ImageProperties) MarshalJSON() ([]byte, error) { 1308 objectMap := make(map[string]interface{}) 1309 if IP.SourceVirtualMachine != nil { 1310 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 1311 } 1312 if IP.StorageProfile != nil { 1313 objectMap["storageProfile"] = IP.StorageProfile 1314 } 1315 return json.Marshal(objectMap) 1316} 1317 1318// ImageReference specifies information about the image to use. You can specify information about platform 1319// images, marketplace images, or virtual machine images. This element is required when you want to use a 1320// platform image, marketplace image, or virtual machine image, but is not used in other creation 1321// operations. 1322type ImageReference struct { 1323 // Publisher - The image publisher. 1324 Publisher *string `json:"publisher,omitempty"` 1325 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 1326 Offer *string `json:"offer,omitempty"` 1327 // Sku - The image SKU. 1328 Sku *string `json:"sku,omitempty"` 1329 // 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. 1330 Version *string `json:"version,omitempty"` 1331 // ID - Resource Id 1332 ID *string `json:"id,omitempty"` 1333} 1334 1335// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1336// operation. 1337type ImagesCreateOrUpdateFuture struct { 1338 azure.FutureAPI 1339 // Result returns the result of the asynchronous operation. 1340 // If the operation has not completed it will return an error. 1341 Result func(ImagesClient) (Image, error) 1342} 1343 1344// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1345type ImagesDeleteFuture struct { 1346 azure.FutureAPI 1347 // Result returns the result of the asynchronous operation. 1348 // If the operation has not completed it will return an error. 1349 Result func(ImagesClient) (OperationStatusResponse, error) 1350} 1351 1352// ImageStorageProfile describes a storage profile. 1353type ImageStorageProfile struct { 1354 // 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). 1355 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 1356 // 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). 1357 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 1358} 1359 1360// InnerError inner error details. 1361type InnerError struct { 1362 // Exceptiontype - The exception type. 1363 Exceptiontype *string `json:"exceptiontype,omitempty"` 1364 // Errordetail - The internal error message or exception dump. 1365 Errordetail *string `json:"errordetail,omitempty"` 1366} 1367 1368// InstanceViewStatus instance view status. 1369type InstanceViewStatus struct { 1370 // Code - The status code. 1371 Code *string `json:"code,omitempty"` 1372 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 1373 Level StatusLevelTypes `json:"level,omitempty"` 1374 // DisplayStatus - The short localizable label for the status. 1375 DisplayStatus *string `json:"displayStatus,omitempty"` 1376 // Message - The detailed status message, including for alerts and error messages. 1377 Message *string `json:"message,omitempty"` 1378 // Time - The time of the status. 1379 Time *date.Time `json:"time,omitempty"` 1380} 1381 1382// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 1383// to unwrap the encryptionKey 1384type KeyVaultAndKeyReference struct { 1385 // SourceVault - Resource id of the KeyVault containing the key or secret 1386 SourceVault *SourceVault `json:"sourceVault,omitempty"` 1387 // KeyURL - Url pointing to a key or secret in KeyVault 1388 KeyURL *string `json:"keyUrl,omitempty"` 1389} 1390 1391// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 1392type KeyVaultAndSecretReference struct { 1393 // SourceVault - Resource id of the KeyVault containing the key or secret 1394 SourceVault *SourceVault `json:"sourceVault,omitempty"` 1395 // SecretURL - Url pointing to a key or secret in KeyVault 1396 SecretURL *string `json:"secretUrl,omitempty"` 1397} 1398 1399// KeyVaultKeyReference describes a reference to Key Vault Key 1400type KeyVaultKeyReference struct { 1401 // KeyURL - The URL referencing a key encryption key in Key Vault. 1402 KeyURL *string `json:"keyUrl,omitempty"` 1403 // SourceVault - The relative URL of the Key Vault containing the key. 1404 SourceVault *SubResource `json:"sourceVault,omitempty"` 1405} 1406 1407// KeyVaultSecretReference describes a reference to Key Vault Secret 1408type KeyVaultSecretReference struct { 1409 // SecretURL - The URL referencing a secret in a Key Vault. 1410 SecretURL *string `json:"secretUrl,omitempty"` 1411 // SourceVault - The relative URL of the Key Vault containing the secret. 1412 SourceVault *SubResource `json:"sourceVault,omitempty"` 1413} 1414 1415// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 1416// list of supported Linux distributions, see [Linux on Azure-Endorsed 1417// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 1418// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 1419// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 1420type LinuxConfiguration struct { 1421 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 1422 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 1423 // SSH - Specifies the ssh key configuration for a Linux OS. 1424 SSH *SSHConfiguration `json:"ssh,omitempty"` 1425} 1426 1427// ListUsagesResult the List Usages operation response. 1428type ListUsagesResult struct { 1429 autorest.Response `json:"-"` 1430 // Value - The list of compute resource usages. 1431 Value *[]Usage `json:"value,omitempty"` 1432 // 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. 1433 NextLink *string `json:"nextLink,omitempty"` 1434} 1435 1436// ListUsagesResultIterator provides access to a complete listing of Usage values. 1437type ListUsagesResultIterator struct { 1438 i int 1439 page ListUsagesResultPage 1440} 1441 1442// NextWithContext advances to the next value. If there was an error making 1443// the request the iterator does not advance and the error is returned. 1444func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 1445 if tracing.IsEnabled() { 1446 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 1447 defer func() { 1448 sc := -1 1449 if iter.Response().Response.Response != nil { 1450 sc = iter.Response().Response.Response.StatusCode 1451 } 1452 tracing.EndSpan(ctx, sc, err) 1453 }() 1454 } 1455 iter.i++ 1456 if iter.i < len(iter.page.Values()) { 1457 return nil 1458 } 1459 err = iter.page.NextWithContext(ctx) 1460 if err != nil { 1461 iter.i-- 1462 return err 1463 } 1464 iter.i = 0 1465 return nil 1466} 1467 1468// Next advances to the next value. If there was an error making 1469// the request the iterator does not advance and the error is returned. 1470// Deprecated: Use NextWithContext() instead. 1471func (iter *ListUsagesResultIterator) Next() error { 1472 return iter.NextWithContext(context.Background()) 1473} 1474 1475// NotDone returns true if the enumeration should be started or is not yet complete. 1476func (iter ListUsagesResultIterator) NotDone() bool { 1477 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1478} 1479 1480// Response returns the raw server response from the last page request. 1481func (iter ListUsagesResultIterator) Response() ListUsagesResult { 1482 return iter.page.Response() 1483} 1484 1485// Value returns the current value or a zero-initialized value if the 1486// iterator has advanced beyond the end of the collection. 1487func (iter ListUsagesResultIterator) Value() Usage { 1488 if !iter.page.NotDone() { 1489 return Usage{} 1490 } 1491 return iter.page.Values()[iter.i] 1492} 1493 1494// Creates a new instance of the ListUsagesResultIterator type. 1495func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 1496 return ListUsagesResultIterator{page: page} 1497} 1498 1499// IsEmpty returns true if the ListResult contains no values. 1500func (lur ListUsagesResult) IsEmpty() bool { 1501 return lur.Value == nil || len(*lur.Value) == 0 1502} 1503 1504// hasNextLink returns true if the NextLink is not empty. 1505func (lur ListUsagesResult) hasNextLink() bool { 1506 return lur.NextLink != nil && len(*lur.NextLink) != 0 1507} 1508 1509// listUsagesResultPreparer prepares a request to retrieve the next set of results. 1510// It returns nil if no more results exist. 1511func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 1512 if !lur.hasNextLink() { 1513 return nil, nil 1514 } 1515 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1516 autorest.AsJSON(), 1517 autorest.AsGet(), 1518 autorest.WithBaseURL(to.String(lur.NextLink))) 1519} 1520 1521// ListUsagesResultPage contains a page of Usage values. 1522type ListUsagesResultPage struct { 1523 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 1524 lur ListUsagesResult 1525} 1526 1527// NextWithContext advances to the next page of values. If there was an error making 1528// the request the page does not advance and the error is returned. 1529func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 1530 if tracing.IsEnabled() { 1531 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 1532 defer func() { 1533 sc := -1 1534 if page.Response().Response.Response != nil { 1535 sc = page.Response().Response.Response.StatusCode 1536 } 1537 tracing.EndSpan(ctx, sc, err) 1538 }() 1539 } 1540 for { 1541 next, err := page.fn(ctx, page.lur) 1542 if err != nil { 1543 return err 1544 } 1545 page.lur = next 1546 if !next.hasNextLink() || !next.IsEmpty() { 1547 break 1548 } 1549 } 1550 return nil 1551} 1552 1553// Next advances to the next page of values. If there was an error making 1554// the request the page does not advance and the error is returned. 1555// Deprecated: Use NextWithContext() instead. 1556func (page *ListUsagesResultPage) Next() error { 1557 return page.NextWithContext(context.Background()) 1558} 1559 1560// NotDone returns true if the page enumeration should be started or is not yet complete. 1561func (page ListUsagesResultPage) NotDone() bool { 1562 return !page.lur.IsEmpty() 1563} 1564 1565// Response returns the raw server response from the last page request. 1566func (page ListUsagesResultPage) Response() ListUsagesResult { 1567 return page.lur 1568} 1569 1570// Values returns the slice of values for the current page or nil if there are no values. 1571func (page ListUsagesResultPage) Values() []Usage { 1572 if page.lur.IsEmpty() { 1573 return nil 1574 } 1575 return *page.lur.Value 1576} 1577 1578// Creates a new instance of the ListUsagesResultPage type. 1579func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 1580 return ListUsagesResultPage{ 1581 fn: getNextPage, 1582 lur: cur, 1583 } 1584} 1585 1586// ListVirtualMachineExtensionImage ... 1587type ListVirtualMachineExtensionImage struct { 1588 autorest.Response `json:"-"` 1589 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 1590} 1591 1592// ListVirtualMachineImageResource ... 1593type ListVirtualMachineImageResource struct { 1594 autorest.Response `json:"-"` 1595 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 1596} 1597 1598// LongRunningOperationProperties compute-specific operation properties, including output 1599type LongRunningOperationProperties struct { 1600 // Output - Operation output data (raw JSON) 1601 Output interface{} `json:"output,omitempty"` 1602} 1603 1604// ManagedDiskParameters the parameters of a managed disk. 1605type ManagedDiskParameters struct { 1606 // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS' 1607 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 1608 // ID - Resource Id 1609 ID *string `json:"id,omitempty"` 1610} 1611 1612// NetworkInterfaceReference describes a network interface reference. 1613type NetworkInterfaceReference struct { 1614 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 1615 // ID - Resource Id 1616 ID *string `json:"id,omitempty"` 1617} 1618 1619// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 1620func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 1621 objectMap := make(map[string]interface{}) 1622 if nir.NetworkInterfaceReferenceProperties != nil { 1623 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 1624 } 1625 if nir.ID != nil { 1626 objectMap["id"] = nir.ID 1627 } 1628 return json.Marshal(objectMap) 1629} 1630 1631// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 1632func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 1633 var m map[string]*json.RawMessage 1634 err := json.Unmarshal(body, &m) 1635 if err != nil { 1636 return err 1637 } 1638 for k, v := range m { 1639 switch k { 1640 case "properties": 1641 if v != nil { 1642 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 1643 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 1644 if err != nil { 1645 return err 1646 } 1647 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 1648 } 1649 case "id": 1650 if v != nil { 1651 var ID string 1652 err = json.Unmarshal(*v, &ID) 1653 if err != nil { 1654 return err 1655 } 1656 nir.ID = &ID 1657 } 1658 } 1659 } 1660 1661 return nil 1662} 1663 1664// NetworkInterfaceReferenceProperties describes a network interface reference properties. 1665type NetworkInterfaceReferenceProperties struct { 1666 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 1667 Primary *bool `json:"primary,omitempty"` 1668} 1669 1670// NetworkProfile specifies the network interfaces of the virtual machine. 1671type NetworkProfile struct { 1672 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 1673 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 1674} 1675 1676// OperationStatusResponse operation status response 1677type OperationStatusResponse struct { 1678 autorest.Response `json:"-"` 1679 // Name - READ-ONLY; Operation ID 1680 Name *string `json:"name,omitempty"` 1681 // Status - READ-ONLY; Operation status 1682 Status *string `json:"status,omitempty"` 1683 // StartTime - READ-ONLY; Start time of the operation 1684 StartTime *date.Time `json:"startTime,omitempty"` 1685 // EndTime - READ-ONLY; End time of the operation 1686 EndTime *date.Time `json:"endTime,omitempty"` 1687 // Error - READ-ONLY; Api error 1688 Error *APIError `json:"error,omitempty"` 1689} 1690 1691// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 1692// more information about disks, see [About disks and VHDs for Azure virtual 1693// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 1694type OSDisk struct { 1695 // 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' 1696 OsType OperatingSystemTypes `json:"osType,omitempty"` 1697 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 1698 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 1699 // Name - The disk name. 1700 Name *string `json:"name,omitempty"` 1701 // Vhd - The virtual hard disk. 1702 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1703 // 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. 1704 Image *VirtualHardDisk `json:"image,omitempty"` 1705 // 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' 1706 Caching CachingTypes `json:"caching,omitempty"` 1707 // 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' 1708 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1709 // 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 1710 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1711 // ManagedDisk - The managed disk parameters. 1712 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1713} 1714 1715// OSDiskImage contains the os disk image information. 1716type OSDiskImage struct { 1717 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 1718 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 1719} 1720 1721// OSProfile specifies the operating system settings for the virtual machine. 1722type OSProfile struct { 1723 // 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). 1724 ComputerName *string `json:"computerName,omitempty"` 1725 // 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) 1726 AdminUsername *string `json:"adminUsername,omitempty"` 1727 // 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) 1728 AdminPassword *string `json:"adminPassword,omitempty"` 1729 // 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) 1730 CustomData *string `json:"customData,omitempty"` 1731 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 1732 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 1733 // 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). 1734 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 1735 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 1736 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 1737} 1738 1739// Plan specifies information about the marketplace image used to create the virtual machine. This element 1740// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 1741// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 1742// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 1743// then click **Save**. 1744type Plan struct { 1745 // Name - The plan ID. 1746 Name *string `json:"name,omitempty"` 1747 // Publisher - The publisher ID. 1748 Publisher *string `json:"publisher,omitempty"` 1749 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 1750 Product *string `json:"product,omitempty"` 1751 // PromotionCode - The promotion code. 1752 PromotionCode *string `json:"promotionCode,omitempty"` 1753} 1754 1755// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 1756type PurchasePlan struct { 1757 // Publisher - The publisher ID. 1758 Publisher *string `json:"publisher,omitempty"` 1759 // Name - The plan ID. 1760 Name *string `json:"name,omitempty"` 1761 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 1762 Product *string `json:"product,omitempty"` 1763} 1764 1765// Resource the Resource model definition. 1766type Resource struct { 1767 // ID - READ-ONLY; Resource Id 1768 ID *string `json:"id,omitempty"` 1769 // Name - READ-ONLY; Resource name 1770 Name *string `json:"name,omitempty"` 1771 // Type - READ-ONLY; Resource type 1772 Type *string `json:"type,omitempty"` 1773 // Location - Resource location 1774 Location *string `json:"location,omitempty"` 1775 // Tags - Resource tags 1776 Tags map[string]*string `json:"tags"` 1777} 1778 1779// MarshalJSON is the custom marshaler for Resource. 1780func (r Resource) MarshalJSON() ([]byte, error) { 1781 objectMap := make(map[string]interface{}) 1782 if r.Location != nil { 1783 objectMap["location"] = r.Location 1784 } 1785 if r.Tags != nil { 1786 objectMap["tags"] = r.Tags 1787 } 1788 return json.Marshal(objectMap) 1789} 1790 1791// ResourceUpdate the Resource model definition. 1792type ResourceUpdate struct { 1793 // Tags - Resource tags 1794 Tags map[string]*string `json:"tags"` 1795} 1796 1797// MarshalJSON is the custom marshaler for ResourceUpdate. 1798func (ru ResourceUpdate) MarshalJSON() ([]byte, error) { 1799 objectMap := make(map[string]interface{}) 1800 if ru.Tags != nil { 1801 objectMap["tags"] = ru.Tags 1802 } 1803 return json.Marshal(objectMap) 1804} 1805 1806// Sku describes a virtual machine scale set sku. 1807type Sku struct { 1808 // Name - The sku name. 1809 Name *string `json:"name,omitempty"` 1810 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 1811 Tier *string `json:"tier,omitempty"` 1812 // Capacity - Specifies the number of virtual machines in the scale set. 1813 Capacity *int64 `json:"capacity,omitempty"` 1814} 1815 1816// Snapshot snapshot resource. 1817type Snapshot struct { 1818 autorest.Response `json:"-"` 1819 *DiskProperties `json:"properties,omitempty"` 1820 // ID - READ-ONLY; Resource Id 1821 ID *string `json:"id,omitempty"` 1822 // Name - READ-ONLY; Resource name 1823 Name *string `json:"name,omitempty"` 1824 // Type - READ-ONLY; Resource type 1825 Type *string `json:"type,omitempty"` 1826 // Location - Resource location 1827 Location *string `json:"location,omitempty"` 1828 // Tags - Resource tags 1829 Tags map[string]*string `json:"tags"` 1830} 1831 1832// MarshalJSON is the custom marshaler for Snapshot. 1833func (s Snapshot) MarshalJSON() ([]byte, error) { 1834 objectMap := make(map[string]interface{}) 1835 if s.DiskProperties != nil { 1836 objectMap["properties"] = s.DiskProperties 1837 } 1838 if s.Location != nil { 1839 objectMap["location"] = s.Location 1840 } 1841 if s.Tags != nil { 1842 objectMap["tags"] = s.Tags 1843 } 1844 return json.Marshal(objectMap) 1845} 1846 1847// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 1848func (s *Snapshot) UnmarshalJSON(body []byte) error { 1849 var m map[string]*json.RawMessage 1850 err := json.Unmarshal(body, &m) 1851 if err != nil { 1852 return err 1853 } 1854 for k, v := range m { 1855 switch k { 1856 case "properties": 1857 if v != nil { 1858 var diskProperties DiskProperties 1859 err = json.Unmarshal(*v, &diskProperties) 1860 if err != nil { 1861 return err 1862 } 1863 s.DiskProperties = &diskProperties 1864 } 1865 case "id": 1866 if v != nil { 1867 var ID string 1868 err = json.Unmarshal(*v, &ID) 1869 if err != nil { 1870 return err 1871 } 1872 s.ID = &ID 1873 } 1874 case "name": 1875 if v != nil { 1876 var name string 1877 err = json.Unmarshal(*v, &name) 1878 if err != nil { 1879 return err 1880 } 1881 s.Name = &name 1882 } 1883 case "type": 1884 if v != nil { 1885 var typeVar string 1886 err = json.Unmarshal(*v, &typeVar) 1887 if err != nil { 1888 return err 1889 } 1890 s.Type = &typeVar 1891 } 1892 case "location": 1893 if v != nil { 1894 var location string 1895 err = json.Unmarshal(*v, &location) 1896 if err != nil { 1897 return err 1898 } 1899 s.Location = &location 1900 } 1901 case "tags": 1902 if v != nil { 1903 var tags map[string]*string 1904 err = json.Unmarshal(*v, &tags) 1905 if err != nil { 1906 return err 1907 } 1908 s.Tags = tags 1909 } 1910 } 1911 } 1912 1913 return nil 1914} 1915 1916// SnapshotList the List Snapshots operation response. 1917type SnapshotList struct { 1918 autorest.Response `json:"-"` 1919 // Value - A list of snapshots. 1920 Value *[]Snapshot `json:"value,omitempty"` 1921 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 1922 NextLink *string `json:"nextLink,omitempty"` 1923} 1924 1925// SnapshotListIterator provides access to a complete listing of Snapshot values. 1926type SnapshotListIterator struct { 1927 i int 1928 page SnapshotListPage 1929} 1930 1931// NextWithContext advances to the next value. If there was an error making 1932// the request the iterator does not advance and the error is returned. 1933func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 1934 if tracing.IsEnabled() { 1935 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 1936 defer func() { 1937 sc := -1 1938 if iter.Response().Response.Response != nil { 1939 sc = iter.Response().Response.Response.StatusCode 1940 } 1941 tracing.EndSpan(ctx, sc, err) 1942 }() 1943 } 1944 iter.i++ 1945 if iter.i < len(iter.page.Values()) { 1946 return nil 1947 } 1948 err = iter.page.NextWithContext(ctx) 1949 if err != nil { 1950 iter.i-- 1951 return err 1952 } 1953 iter.i = 0 1954 return nil 1955} 1956 1957// Next advances to the next value. If there was an error making 1958// the request the iterator does not advance and the error is returned. 1959// Deprecated: Use NextWithContext() instead. 1960func (iter *SnapshotListIterator) Next() error { 1961 return iter.NextWithContext(context.Background()) 1962} 1963 1964// NotDone returns true if the enumeration should be started or is not yet complete. 1965func (iter SnapshotListIterator) NotDone() bool { 1966 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1967} 1968 1969// Response returns the raw server response from the last page request. 1970func (iter SnapshotListIterator) Response() SnapshotList { 1971 return iter.page.Response() 1972} 1973 1974// Value returns the current value or a zero-initialized value if the 1975// iterator has advanced beyond the end of the collection. 1976func (iter SnapshotListIterator) Value() Snapshot { 1977 if !iter.page.NotDone() { 1978 return Snapshot{} 1979 } 1980 return iter.page.Values()[iter.i] 1981} 1982 1983// Creates a new instance of the SnapshotListIterator type. 1984func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 1985 return SnapshotListIterator{page: page} 1986} 1987 1988// IsEmpty returns true if the ListResult contains no values. 1989func (sl SnapshotList) IsEmpty() bool { 1990 return sl.Value == nil || len(*sl.Value) == 0 1991} 1992 1993// hasNextLink returns true if the NextLink is not empty. 1994func (sl SnapshotList) hasNextLink() bool { 1995 return sl.NextLink != nil && len(*sl.NextLink) != 0 1996} 1997 1998// snapshotListPreparer prepares a request to retrieve the next set of results. 1999// It returns nil if no more results exist. 2000func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 2001 if !sl.hasNextLink() { 2002 return nil, nil 2003 } 2004 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2005 autorest.AsJSON(), 2006 autorest.AsGet(), 2007 autorest.WithBaseURL(to.String(sl.NextLink))) 2008} 2009 2010// SnapshotListPage contains a page of Snapshot values. 2011type SnapshotListPage struct { 2012 fn func(context.Context, SnapshotList) (SnapshotList, error) 2013 sl SnapshotList 2014} 2015 2016// NextWithContext advances to the next page of values. If there was an error making 2017// the request the page does not advance and the error is returned. 2018func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 2019 if tracing.IsEnabled() { 2020 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 2021 defer func() { 2022 sc := -1 2023 if page.Response().Response.Response != nil { 2024 sc = page.Response().Response.Response.StatusCode 2025 } 2026 tracing.EndSpan(ctx, sc, err) 2027 }() 2028 } 2029 for { 2030 next, err := page.fn(ctx, page.sl) 2031 if err != nil { 2032 return err 2033 } 2034 page.sl = next 2035 if !next.hasNextLink() || !next.IsEmpty() { 2036 break 2037 } 2038 } 2039 return nil 2040} 2041 2042// Next advances to the next page of values. If there was an error making 2043// the request the page does not advance and the error is returned. 2044// Deprecated: Use NextWithContext() instead. 2045func (page *SnapshotListPage) Next() error { 2046 return page.NextWithContext(context.Background()) 2047} 2048 2049// NotDone returns true if the page enumeration should be started or is not yet complete. 2050func (page SnapshotListPage) NotDone() bool { 2051 return !page.sl.IsEmpty() 2052} 2053 2054// Response returns the raw server response from the last page request. 2055func (page SnapshotListPage) Response() SnapshotList { 2056 return page.sl 2057} 2058 2059// Values returns the slice of values for the current page or nil if there are no values. 2060func (page SnapshotListPage) Values() []Snapshot { 2061 if page.sl.IsEmpty() { 2062 return nil 2063 } 2064 return *page.sl.Value 2065} 2066 2067// Creates a new instance of the SnapshotListPage type. 2068func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 2069 return SnapshotListPage{ 2070 fn: getNextPage, 2071 sl: cur, 2072 } 2073} 2074 2075// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2076// operation. 2077type SnapshotsCreateOrUpdateFuture struct { 2078 azure.FutureAPI 2079 // Result returns the result of the asynchronous operation. 2080 // If the operation has not completed it will return an error. 2081 Result func(SnapshotsClient) (Snapshot, error) 2082} 2083 2084// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2085// operation. 2086type SnapshotsDeleteFuture struct { 2087 azure.FutureAPI 2088 // Result returns the result of the asynchronous operation. 2089 // If the operation has not completed it will return an error. 2090 Result func(SnapshotsClient) (OperationStatusResponse, error) 2091} 2092 2093// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2094// operation. 2095type SnapshotsGrantAccessFuture struct { 2096 azure.FutureAPI 2097 // Result returns the result of the asynchronous operation. 2098 // If the operation has not completed it will return an error. 2099 Result func(SnapshotsClient) (AccessURI, error) 2100} 2101 2102// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2103// operation. 2104type SnapshotsRevokeAccessFuture struct { 2105 azure.FutureAPI 2106 // Result returns the result of the asynchronous operation. 2107 // If the operation has not completed it will return an error. 2108 Result func(SnapshotsClient) (OperationStatusResponse, error) 2109} 2110 2111// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2112// operation. 2113type SnapshotsUpdateFuture struct { 2114 azure.FutureAPI 2115 // Result returns the result of the asynchronous operation. 2116 // If the operation has not completed it will return an error. 2117 Result func(SnapshotsClient) (Snapshot, error) 2118} 2119 2120// SnapshotUpdate snapshot update resource. 2121type SnapshotUpdate struct { 2122 *DiskUpdateProperties `json:"properties,omitempty"` 2123 // Tags - Resource tags 2124 Tags map[string]*string `json:"tags"` 2125} 2126 2127// MarshalJSON is the custom marshaler for SnapshotUpdate. 2128func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 2129 objectMap := make(map[string]interface{}) 2130 if su.DiskUpdateProperties != nil { 2131 objectMap["properties"] = su.DiskUpdateProperties 2132 } 2133 if su.Tags != nil { 2134 objectMap["tags"] = su.Tags 2135 } 2136 return json.Marshal(objectMap) 2137} 2138 2139// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 2140func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 2141 var m map[string]*json.RawMessage 2142 err := json.Unmarshal(body, &m) 2143 if err != nil { 2144 return err 2145 } 2146 for k, v := range m { 2147 switch k { 2148 case "properties": 2149 if v != nil { 2150 var diskUpdateProperties DiskUpdateProperties 2151 err = json.Unmarshal(*v, &diskUpdateProperties) 2152 if err != nil { 2153 return err 2154 } 2155 su.DiskUpdateProperties = &diskUpdateProperties 2156 } 2157 case "tags": 2158 if v != nil { 2159 var tags map[string]*string 2160 err = json.Unmarshal(*v, &tags) 2161 if err != nil { 2162 return err 2163 } 2164 su.Tags = tags 2165 } 2166 } 2167 } 2168 2169 return nil 2170} 2171 2172// SourceVault the vault id is an Azure Resource Manager Resource id in the form 2173// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 2174type SourceVault struct { 2175 // ID - Resource Id 2176 ID *string `json:"id,omitempty"` 2177} 2178 2179// SSHConfiguration SSH configuration for Linux based VMs running on Azure 2180type SSHConfiguration struct { 2181 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 2182 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 2183} 2184 2185// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 2186// the public key is placed. 2187type SSHPublicKey struct { 2188 // 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 2189 Path *string `json:"path,omitempty"` 2190 // 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). 2191 KeyData *string `json:"keyData,omitempty"` 2192} 2193 2194// StorageProfile specifies the storage settings for the virtual machine disks. 2195type StorageProfile struct { 2196 // 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. 2197 ImageReference *ImageReference `json:"imageReference,omitempty"` 2198 // 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). 2199 OsDisk *OSDisk `json:"osDisk,omitempty"` 2200 // 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). 2201 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 2202} 2203 2204// SubResource ... 2205type SubResource struct { 2206 // ID - Resource Id 2207 ID *string `json:"id,omitempty"` 2208} 2209 2210// SubResourceReadOnly ... 2211type SubResourceReadOnly struct { 2212 // ID - READ-ONLY; Resource Id 2213 ID *string `json:"id,omitempty"` 2214} 2215 2216// UpdateResource the Update Resource model definition. 2217type UpdateResource struct { 2218 // Tags - Resource tags 2219 Tags map[string]*string `json:"tags"` 2220} 2221 2222// MarshalJSON is the custom marshaler for UpdateResource. 2223func (ur UpdateResource) MarshalJSON() ([]byte, error) { 2224 objectMap := make(map[string]interface{}) 2225 if ur.Tags != nil { 2226 objectMap["tags"] = ur.Tags 2227 } 2228 return json.Marshal(objectMap) 2229} 2230 2231// UpgradePolicy describes an upgrade policy - automatic or manual. 2232type UpgradePolicy struct { 2233 // 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' 2234 Mode UpgradeMode `json:"mode,omitempty"` 2235} 2236 2237// Usage describes Compute Resource Usage. 2238type Usage struct { 2239 // Unit - An enum describing the unit of usage measurement. 2240 Unit *string `json:"unit,omitempty"` 2241 // CurrentValue - The current usage of the resource. 2242 CurrentValue *int32 `json:"currentValue,omitempty"` 2243 // Limit - The maximum permitted usage of the resource. 2244 Limit *int64 `json:"limit,omitempty"` 2245 // Name - The name of the type of usage. 2246 Name *UsageName `json:"name,omitempty"` 2247} 2248 2249// UsageName the Usage Names. 2250type UsageName struct { 2251 // Value - The name of the resource. 2252 Value *string `json:"value,omitempty"` 2253 // LocalizedValue - The localized name of the resource. 2254 LocalizedValue *string `json:"localizedValue,omitempty"` 2255} 2256 2257// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 2258// should reside on the VM. 2259type VaultCertificate struct { 2260 // 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>} 2261 CertificateURL *string `json:"certificateUrl,omitempty"` 2262 // 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. 2263 CertificateStore *string `json:"certificateStore,omitempty"` 2264} 2265 2266// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 2267type VaultSecretGroup struct { 2268 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 2269 SourceVault *SubResource `json:"sourceVault,omitempty"` 2270 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 2271 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 2272} 2273 2274// VirtualHardDisk describes the uri of a disk. 2275type VirtualHardDisk struct { 2276 // URI - Specifies the virtual hard disk's uri. 2277 URI *string `json:"uri,omitempty"` 2278} 2279 2280// VirtualMachine describes a Virtual Machine. 2281type VirtualMachine struct { 2282 autorest.Response `json:"-"` 2283 // 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**. 2284 Plan *Plan `json:"plan,omitempty"` 2285 *VirtualMachineProperties `json:"properties,omitempty"` 2286 // Resources - READ-ONLY; The virtual machine child extension resources. 2287 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 2288 // Identity - The identity of the virtual machine, if configured. 2289 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 2290 // ID - READ-ONLY; Resource Id 2291 ID *string `json:"id,omitempty"` 2292 // Name - READ-ONLY; Resource name 2293 Name *string `json:"name,omitempty"` 2294 // Type - READ-ONLY; Resource type 2295 Type *string `json:"type,omitempty"` 2296 // Location - Resource location 2297 Location *string `json:"location,omitempty"` 2298 // Tags - Resource tags 2299 Tags map[string]*string `json:"tags"` 2300} 2301 2302// MarshalJSON is the custom marshaler for VirtualMachine. 2303func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 2304 objectMap := make(map[string]interface{}) 2305 if VM.Plan != nil { 2306 objectMap["plan"] = VM.Plan 2307 } 2308 if VM.VirtualMachineProperties != nil { 2309 objectMap["properties"] = VM.VirtualMachineProperties 2310 } 2311 if VM.Identity != nil { 2312 objectMap["identity"] = VM.Identity 2313 } 2314 if VM.Location != nil { 2315 objectMap["location"] = VM.Location 2316 } 2317 if VM.Tags != nil { 2318 objectMap["tags"] = VM.Tags 2319 } 2320 return json.Marshal(objectMap) 2321} 2322 2323// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 2324func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 2325 var m map[string]*json.RawMessage 2326 err := json.Unmarshal(body, &m) 2327 if err != nil { 2328 return err 2329 } 2330 for k, v := range m { 2331 switch k { 2332 case "plan": 2333 if v != nil { 2334 var plan Plan 2335 err = json.Unmarshal(*v, &plan) 2336 if err != nil { 2337 return err 2338 } 2339 VM.Plan = &plan 2340 } 2341 case "properties": 2342 if v != nil { 2343 var virtualMachineProperties VirtualMachineProperties 2344 err = json.Unmarshal(*v, &virtualMachineProperties) 2345 if err != nil { 2346 return err 2347 } 2348 VM.VirtualMachineProperties = &virtualMachineProperties 2349 } 2350 case "resources": 2351 if v != nil { 2352 var resources []VirtualMachineExtension 2353 err = json.Unmarshal(*v, &resources) 2354 if err != nil { 2355 return err 2356 } 2357 VM.Resources = &resources 2358 } 2359 case "identity": 2360 if v != nil { 2361 var identity VirtualMachineIdentity 2362 err = json.Unmarshal(*v, &identity) 2363 if err != nil { 2364 return err 2365 } 2366 VM.Identity = &identity 2367 } 2368 case "id": 2369 if v != nil { 2370 var ID string 2371 err = json.Unmarshal(*v, &ID) 2372 if err != nil { 2373 return err 2374 } 2375 VM.ID = &ID 2376 } 2377 case "name": 2378 if v != nil { 2379 var name string 2380 err = json.Unmarshal(*v, &name) 2381 if err != nil { 2382 return err 2383 } 2384 VM.Name = &name 2385 } 2386 case "type": 2387 if v != nil { 2388 var typeVar string 2389 err = json.Unmarshal(*v, &typeVar) 2390 if err != nil { 2391 return err 2392 } 2393 VM.Type = &typeVar 2394 } 2395 case "location": 2396 if v != nil { 2397 var location string 2398 err = json.Unmarshal(*v, &location) 2399 if err != nil { 2400 return err 2401 } 2402 VM.Location = &location 2403 } 2404 case "tags": 2405 if v != nil { 2406 var tags map[string]*string 2407 err = json.Unmarshal(*v, &tags) 2408 if err != nil { 2409 return err 2410 } 2411 VM.Tags = tags 2412 } 2413 } 2414 } 2415 2416 return nil 2417} 2418 2419// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 2420type VirtualMachineAgentInstanceView struct { 2421 // VMAgentVersion - The VM Agent full version. 2422 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 2423 // ExtensionHandlers - The virtual machine extension handler instance view. 2424 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 2425 // Statuses - The resource status information. 2426 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2427} 2428 2429// VirtualMachineCaptureParameters capture Virtual Machine parameters. 2430type VirtualMachineCaptureParameters struct { 2431 // VhdPrefix - The captured virtual hard disk's name prefix. 2432 VhdPrefix *string `json:"vhdPrefix,omitempty"` 2433 // DestinationContainerName - The destination container name. 2434 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 2435 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 2436 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 2437} 2438 2439// VirtualMachineCaptureResult resource Id. 2440type VirtualMachineCaptureResult struct { 2441 autorest.Response `json:"-"` 2442 *VirtualMachineCaptureResultProperties `json:"properties,omitempty"` 2443 // ID - Resource Id 2444 ID *string `json:"id,omitempty"` 2445} 2446 2447// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 2448func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 2449 objectMap := make(map[string]interface{}) 2450 if vmcr.VirtualMachineCaptureResultProperties != nil { 2451 objectMap["properties"] = vmcr.VirtualMachineCaptureResultProperties 2452 } 2453 if vmcr.ID != nil { 2454 objectMap["id"] = vmcr.ID 2455 } 2456 return json.Marshal(objectMap) 2457} 2458 2459// UnmarshalJSON is the custom unmarshaler for VirtualMachineCaptureResult struct. 2460func (vmcr *VirtualMachineCaptureResult) UnmarshalJSON(body []byte) error { 2461 var m map[string]*json.RawMessage 2462 err := json.Unmarshal(body, &m) 2463 if err != nil { 2464 return err 2465 } 2466 for k, v := range m { 2467 switch k { 2468 case "properties": 2469 if v != nil { 2470 var virtualMachineCaptureResultProperties VirtualMachineCaptureResultProperties 2471 err = json.Unmarshal(*v, &virtualMachineCaptureResultProperties) 2472 if err != nil { 2473 return err 2474 } 2475 vmcr.VirtualMachineCaptureResultProperties = &virtualMachineCaptureResultProperties 2476 } 2477 case "id": 2478 if v != nil { 2479 var ID string 2480 err = json.Unmarshal(*v, &ID) 2481 if err != nil { 2482 return err 2483 } 2484 vmcr.ID = &ID 2485 } 2486 } 2487 } 2488 2489 return nil 2490} 2491 2492// VirtualMachineCaptureResultProperties compute-specific operation properties, including output 2493type VirtualMachineCaptureResultProperties struct { 2494 // Output - Operation output data (raw JSON) 2495 Output interface{} `json:"output,omitempty"` 2496} 2497 2498// VirtualMachineExtension describes a Virtual Machine Extension. 2499type VirtualMachineExtension struct { 2500 autorest.Response `json:"-"` 2501 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 2502 // ID - READ-ONLY; Resource Id 2503 ID *string `json:"id,omitempty"` 2504 // Name - READ-ONLY; Resource name 2505 Name *string `json:"name,omitempty"` 2506 // Type - READ-ONLY; Resource type 2507 Type *string `json:"type,omitempty"` 2508 // Location - Resource location 2509 Location *string `json:"location,omitempty"` 2510 // Tags - Resource tags 2511 Tags map[string]*string `json:"tags"` 2512} 2513 2514// MarshalJSON is the custom marshaler for VirtualMachineExtension. 2515func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 2516 objectMap := make(map[string]interface{}) 2517 if vme.VirtualMachineExtensionProperties != nil { 2518 objectMap["properties"] = vme.VirtualMachineExtensionProperties 2519 } 2520 if vme.Location != nil { 2521 objectMap["location"] = vme.Location 2522 } 2523 if vme.Tags != nil { 2524 objectMap["tags"] = vme.Tags 2525 } 2526 return json.Marshal(objectMap) 2527} 2528 2529// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 2530func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 2531 var m map[string]*json.RawMessage 2532 err := json.Unmarshal(body, &m) 2533 if err != nil { 2534 return err 2535 } 2536 for k, v := range m { 2537 switch k { 2538 case "properties": 2539 if v != nil { 2540 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 2541 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 2542 if err != nil { 2543 return err 2544 } 2545 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 2546 } 2547 case "id": 2548 if v != nil { 2549 var ID string 2550 err = json.Unmarshal(*v, &ID) 2551 if err != nil { 2552 return err 2553 } 2554 vme.ID = &ID 2555 } 2556 case "name": 2557 if v != nil { 2558 var name string 2559 err = json.Unmarshal(*v, &name) 2560 if err != nil { 2561 return err 2562 } 2563 vme.Name = &name 2564 } 2565 case "type": 2566 if v != nil { 2567 var typeVar string 2568 err = json.Unmarshal(*v, &typeVar) 2569 if err != nil { 2570 return err 2571 } 2572 vme.Type = &typeVar 2573 } 2574 case "location": 2575 if v != nil { 2576 var location string 2577 err = json.Unmarshal(*v, &location) 2578 if err != nil { 2579 return err 2580 } 2581 vme.Location = &location 2582 } 2583 case "tags": 2584 if v != nil { 2585 var tags map[string]*string 2586 err = json.Unmarshal(*v, &tags) 2587 if err != nil { 2588 return err 2589 } 2590 vme.Tags = tags 2591 } 2592 } 2593 } 2594 2595 return nil 2596} 2597 2598// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 2599type VirtualMachineExtensionHandlerInstanceView struct { 2600 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 2601 Type *string `json:"type,omitempty"` 2602 // TypeHandlerVersion - Specifies the version of the script handler. 2603 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 2604 // Status - The extension handler status. 2605 Status *InstanceViewStatus `json:"status,omitempty"` 2606} 2607 2608// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 2609type VirtualMachineExtensionImage struct { 2610 autorest.Response `json:"-"` 2611 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 2612 // ID - READ-ONLY; Resource Id 2613 ID *string `json:"id,omitempty"` 2614 // Name - READ-ONLY; Resource name 2615 Name *string `json:"name,omitempty"` 2616 // Type - READ-ONLY; Resource type 2617 Type *string `json:"type,omitempty"` 2618 // Location - Resource location 2619 Location *string `json:"location,omitempty"` 2620 // Tags - Resource tags 2621 Tags map[string]*string `json:"tags"` 2622} 2623 2624// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 2625func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 2626 objectMap := make(map[string]interface{}) 2627 if vmei.VirtualMachineExtensionImageProperties != nil { 2628 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 2629 } 2630 if vmei.Location != nil { 2631 objectMap["location"] = vmei.Location 2632 } 2633 if vmei.Tags != nil { 2634 objectMap["tags"] = vmei.Tags 2635 } 2636 return json.Marshal(objectMap) 2637} 2638 2639// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 2640func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 2641 var m map[string]*json.RawMessage 2642 err := json.Unmarshal(body, &m) 2643 if err != nil { 2644 return err 2645 } 2646 for k, v := range m { 2647 switch k { 2648 case "properties": 2649 if v != nil { 2650 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 2651 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 2652 if err != nil { 2653 return err 2654 } 2655 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 2656 } 2657 case "id": 2658 if v != nil { 2659 var ID string 2660 err = json.Unmarshal(*v, &ID) 2661 if err != nil { 2662 return err 2663 } 2664 vmei.ID = &ID 2665 } 2666 case "name": 2667 if v != nil { 2668 var name string 2669 err = json.Unmarshal(*v, &name) 2670 if err != nil { 2671 return err 2672 } 2673 vmei.Name = &name 2674 } 2675 case "type": 2676 if v != nil { 2677 var typeVar string 2678 err = json.Unmarshal(*v, &typeVar) 2679 if err != nil { 2680 return err 2681 } 2682 vmei.Type = &typeVar 2683 } 2684 case "location": 2685 if v != nil { 2686 var location string 2687 err = json.Unmarshal(*v, &location) 2688 if err != nil { 2689 return err 2690 } 2691 vmei.Location = &location 2692 } 2693 case "tags": 2694 if v != nil { 2695 var tags map[string]*string 2696 err = json.Unmarshal(*v, &tags) 2697 if err != nil { 2698 return err 2699 } 2700 vmei.Tags = tags 2701 } 2702 } 2703 } 2704 2705 return nil 2706} 2707 2708// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 2709type VirtualMachineExtensionImageProperties struct { 2710 // OperatingSystem - The operating system this extension supports. 2711 OperatingSystem *string `json:"operatingSystem,omitempty"` 2712 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 2713 ComputeRole *string `json:"computeRole,omitempty"` 2714 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 2715 HandlerSchema *string `json:"handlerSchema,omitempty"` 2716 // 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. 2717 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 2718 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 2719 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 2720} 2721 2722// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 2723type VirtualMachineExtensionInstanceView struct { 2724 // Name - The virtual machine extension name. 2725 Name *string `json:"name,omitempty"` 2726 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 2727 Type *string `json:"type,omitempty"` 2728 // TypeHandlerVersion - Specifies the version of the script handler. 2729 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 2730 // Substatuses - The resource status information. 2731 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 2732 // Statuses - The resource status information. 2733 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2734} 2735 2736// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 2737type VirtualMachineExtensionProperties struct { 2738 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 2739 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 2740 // Publisher - The name of the extension handler publisher. 2741 Publisher *string `json:"publisher,omitempty"` 2742 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 2743 Type *string `json:"type,omitempty"` 2744 // TypeHandlerVersion - Specifies the version of the script handler. 2745 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 2746 // 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. 2747 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 2748 // Settings - Json formatted public settings for the extension. 2749 Settings interface{} `json:"settings,omitempty"` 2750 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 2751 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 2752 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 2753 ProvisioningState *string `json:"provisioningState,omitempty"` 2754 // InstanceView - The virtual machine extension instance view. 2755 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 2756} 2757 2758// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 2759func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 2760 objectMap := make(map[string]interface{}) 2761 if vmep.ForceUpdateTag != nil { 2762 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 2763 } 2764 if vmep.Publisher != nil { 2765 objectMap["publisher"] = vmep.Publisher 2766 } 2767 if vmep.Type != nil { 2768 objectMap["type"] = vmep.Type 2769 } 2770 if vmep.TypeHandlerVersion != nil { 2771 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 2772 } 2773 if vmep.AutoUpgradeMinorVersion != nil { 2774 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 2775 } 2776 if vmep.Settings != nil { 2777 objectMap["settings"] = vmep.Settings 2778 } 2779 if vmep.ProtectedSettings != nil { 2780 objectMap["protectedSettings"] = vmep.ProtectedSettings 2781 } 2782 if vmep.InstanceView != nil { 2783 objectMap["instanceView"] = vmep.InstanceView 2784 } 2785 return json.Marshal(objectMap) 2786} 2787 2788// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 2789// a long-running operation. 2790type VirtualMachineExtensionsCreateOrUpdateFuture struct { 2791 azure.FutureAPI 2792 // Result returns the result of the asynchronous operation. 2793 // If the operation has not completed it will return an error. 2794 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 2795} 2796 2797// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 2798// long-running operation. 2799type VirtualMachineExtensionsDeleteFuture struct { 2800 azure.FutureAPI 2801 // Result returns the result of the asynchronous operation. 2802 // If the operation has not completed it will return an error. 2803 Result func(VirtualMachineExtensionsClient) (OperationStatusResponse, error) 2804} 2805 2806// VirtualMachineExtensionsListResult the List Extension operation response 2807type VirtualMachineExtensionsListResult struct { 2808 autorest.Response `json:"-"` 2809 // Value - The list of extensions 2810 Value *[]VirtualMachineExtension `json:"value,omitempty"` 2811} 2812 2813// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 2814// long-running operation. 2815type VirtualMachineExtensionsUpdateFuture struct { 2816 azure.FutureAPI 2817 // Result returns the result of the asynchronous operation. 2818 // If the operation has not completed it will return an error. 2819 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 2820} 2821 2822// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 2823type VirtualMachineExtensionUpdate struct { 2824 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 2825 // Tags - Resource tags 2826 Tags map[string]*string `json:"tags"` 2827} 2828 2829// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 2830func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 2831 objectMap := make(map[string]interface{}) 2832 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 2833 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 2834 } 2835 if vmeu.Tags != nil { 2836 objectMap["tags"] = vmeu.Tags 2837 } 2838 return json.Marshal(objectMap) 2839} 2840 2841// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 2842func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 2843 var m map[string]*json.RawMessage 2844 err := json.Unmarshal(body, &m) 2845 if err != nil { 2846 return err 2847 } 2848 for k, v := range m { 2849 switch k { 2850 case "properties": 2851 if v != nil { 2852 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 2853 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 2854 if err != nil { 2855 return err 2856 } 2857 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 2858 } 2859 case "tags": 2860 if v != nil { 2861 var tags map[string]*string 2862 err = json.Unmarshal(*v, &tags) 2863 if err != nil { 2864 return err 2865 } 2866 vmeu.Tags = tags 2867 } 2868 } 2869 } 2870 2871 return nil 2872} 2873 2874// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 2875type VirtualMachineExtensionUpdateProperties struct { 2876 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 2877 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 2878 // Publisher - The name of the extension handler publisher. 2879 Publisher *string `json:"publisher,omitempty"` 2880 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 2881 Type *string `json:"type,omitempty"` 2882 // TypeHandlerVersion - Specifies the version of the script handler. 2883 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 2884 // 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. 2885 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 2886 // Settings - Json formatted public settings for the extension. 2887 Settings interface{} `json:"settings,omitempty"` 2888 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 2889 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 2890} 2891 2892// VirtualMachineIdentity identity for the virtual machine. 2893type VirtualMachineIdentity struct { 2894 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. 2895 PrincipalID *string `json:"principalId,omitempty"` 2896 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. 2897 TenantID *string `json:"tenantId,omitempty"` 2898 // Type - The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Possible values include: 'SystemAssigned' 2899 Type ResourceIdentityType `json:"type,omitempty"` 2900} 2901 2902// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 2903func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 2904 objectMap := make(map[string]interface{}) 2905 if vmi.Type != "" { 2906 objectMap["type"] = vmi.Type 2907 } 2908 return json.Marshal(objectMap) 2909} 2910 2911// VirtualMachineImage describes a Virtual Machine Image. 2912type VirtualMachineImage struct { 2913 autorest.Response `json:"-"` 2914 *VirtualMachineImageProperties `json:"properties,omitempty"` 2915 // Name - The name of the resource. 2916 Name *string `json:"name,omitempty"` 2917 // Location - The supported Azure location of the resource. 2918 Location *string `json:"location,omitempty"` 2919 // 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). 2920 Tags map[string]*string `json:"tags"` 2921 // ID - Resource Id 2922 ID *string `json:"id,omitempty"` 2923} 2924 2925// MarshalJSON is the custom marshaler for VirtualMachineImage. 2926func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 2927 objectMap := make(map[string]interface{}) 2928 if vmi.VirtualMachineImageProperties != nil { 2929 objectMap["properties"] = vmi.VirtualMachineImageProperties 2930 } 2931 if vmi.Name != nil { 2932 objectMap["name"] = vmi.Name 2933 } 2934 if vmi.Location != nil { 2935 objectMap["location"] = vmi.Location 2936 } 2937 if vmi.Tags != nil { 2938 objectMap["tags"] = vmi.Tags 2939 } 2940 if vmi.ID != nil { 2941 objectMap["id"] = vmi.ID 2942 } 2943 return json.Marshal(objectMap) 2944} 2945 2946// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 2947func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 2948 var m map[string]*json.RawMessage 2949 err := json.Unmarshal(body, &m) 2950 if err != nil { 2951 return err 2952 } 2953 for k, v := range m { 2954 switch k { 2955 case "properties": 2956 if v != nil { 2957 var virtualMachineImageProperties VirtualMachineImageProperties 2958 err = json.Unmarshal(*v, &virtualMachineImageProperties) 2959 if err != nil { 2960 return err 2961 } 2962 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 2963 } 2964 case "name": 2965 if v != nil { 2966 var name string 2967 err = json.Unmarshal(*v, &name) 2968 if err != nil { 2969 return err 2970 } 2971 vmi.Name = &name 2972 } 2973 case "location": 2974 if v != nil { 2975 var location string 2976 err = json.Unmarshal(*v, &location) 2977 if err != nil { 2978 return err 2979 } 2980 vmi.Location = &location 2981 } 2982 case "tags": 2983 if v != nil { 2984 var tags map[string]*string 2985 err = json.Unmarshal(*v, &tags) 2986 if err != nil { 2987 return err 2988 } 2989 vmi.Tags = tags 2990 } 2991 case "id": 2992 if v != nil { 2993 var ID string 2994 err = json.Unmarshal(*v, &ID) 2995 if err != nil { 2996 return err 2997 } 2998 vmi.ID = &ID 2999 } 3000 } 3001 } 3002 3003 return nil 3004} 3005 3006// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 3007type VirtualMachineImageProperties struct { 3008 Plan *PurchasePlan `json:"plan,omitempty"` 3009 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 3010 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 3011} 3012 3013// VirtualMachineImageResource virtual machine image resource information. 3014type VirtualMachineImageResource struct { 3015 // Name - The name of the resource. 3016 Name *string `json:"name,omitempty"` 3017 // Location - The supported Azure location of the resource. 3018 Location *string `json:"location,omitempty"` 3019 // 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). 3020 Tags map[string]*string `json:"tags"` 3021 // ID - Resource Id 3022 ID *string `json:"id,omitempty"` 3023} 3024 3025// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 3026func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 3027 objectMap := make(map[string]interface{}) 3028 if vmir.Name != nil { 3029 objectMap["name"] = vmir.Name 3030 } 3031 if vmir.Location != nil { 3032 objectMap["location"] = vmir.Location 3033 } 3034 if vmir.Tags != nil { 3035 objectMap["tags"] = vmir.Tags 3036 } 3037 if vmir.ID != nil { 3038 objectMap["id"] = vmir.ID 3039 } 3040 return json.Marshal(objectMap) 3041} 3042 3043// VirtualMachineInstanceView the instance view of a virtual machine. 3044type VirtualMachineInstanceView struct { 3045 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 3046 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 3047 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 3048 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 3049 // RdpThumbPrint - The Remote desktop certificate thumbprint. 3050 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 3051 // VMAgent - The VM Agent running on the virtual machine. 3052 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 3053 // Disks - The virtual machine disk information. 3054 Disks *[]DiskInstanceView `json:"disks,omitempty"` 3055 // Extensions - The extensions information. 3056 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 3057 // 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. 3058 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 3059 // Statuses - The resource status information. 3060 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3061} 3062 3063// VirtualMachineListResult the List Virtual Machine operation response. 3064type VirtualMachineListResult struct { 3065 autorest.Response `json:"-"` 3066 // Value - The list of virtual machines. 3067 Value *[]VirtualMachine `json:"value,omitempty"` 3068 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 3069 NextLink *string `json:"nextLink,omitempty"` 3070} 3071 3072// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 3073type VirtualMachineListResultIterator struct { 3074 i int 3075 page VirtualMachineListResultPage 3076} 3077 3078// NextWithContext advances to the next value. If there was an error making 3079// the request the iterator does not advance and the error is returned. 3080func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 3081 if tracing.IsEnabled() { 3082 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 3083 defer func() { 3084 sc := -1 3085 if iter.Response().Response.Response != nil { 3086 sc = iter.Response().Response.Response.StatusCode 3087 } 3088 tracing.EndSpan(ctx, sc, err) 3089 }() 3090 } 3091 iter.i++ 3092 if iter.i < len(iter.page.Values()) { 3093 return nil 3094 } 3095 err = iter.page.NextWithContext(ctx) 3096 if err != nil { 3097 iter.i-- 3098 return err 3099 } 3100 iter.i = 0 3101 return nil 3102} 3103 3104// Next advances to the next value. If there was an error making 3105// the request the iterator does not advance and the error is returned. 3106// Deprecated: Use NextWithContext() instead. 3107func (iter *VirtualMachineListResultIterator) Next() error { 3108 return iter.NextWithContext(context.Background()) 3109} 3110 3111// NotDone returns true if the enumeration should be started or is not yet complete. 3112func (iter VirtualMachineListResultIterator) NotDone() bool { 3113 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3114} 3115 3116// Response returns the raw server response from the last page request. 3117func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 3118 return iter.page.Response() 3119} 3120 3121// Value returns the current value or a zero-initialized value if the 3122// iterator has advanced beyond the end of the collection. 3123func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 3124 if !iter.page.NotDone() { 3125 return VirtualMachine{} 3126 } 3127 return iter.page.Values()[iter.i] 3128} 3129 3130// Creates a new instance of the VirtualMachineListResultIterator type. 3131func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 3132 return VirtualMachineListResultIterator{page: page} 3133} 3134 3135// IsEmpty returns true if the ListResult contains no values. 3136func (vmlr VirtualMachineListResult) IsEmpty() bool { 3137 return vmlr.Value == nil || len(*vmlr.Value) == 0 3138} 3139 3140// hasNextLink returns true if the NextLink is not empty. 3141func (vmlr VirtualMachineListResult) hasNextLink() bool { 3142 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 3143} 3144 3145// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 3146// It returns nil if no more results exist. 3147func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 3148 if !vmlr.hasNextLink() { 3149 return nil, nil 3150 } 3151 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3152 autorest.AsJSON(), 3153 autorest.AsGet(), 3154 autorest.WithBaseURL(to.String(vmlr.NextLink))) 3155} 3156 3157// VirtualMachineListResultPage contains a page of VirtualMachine values. 3158type VirtualMachineListResultPage struct { 3159 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 3160 vmlr VirtualMachineListResult 3161} 3162 3163// NextWithContext advances to the next page of values. If there was an error making 3164// the request the page does not advance and the error is returned. 3165func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 3166 if tracing.IsEnabled() { 3167 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 3168 defer func() { 3169 sc := -1 3170 if page.Response().Response.Response != nil { 3171 sc = page.Response().Response.Response.StatusCode 3172 } 3173 tracing.EndSpan(ctx, sc, err) 3174 }() 3175 } 3176 for { 3177 next, err := page.fn(ctx, page.vmlr) 3178 if err != nil { 3179 return err 3180 } 3181 page.vmlr = next 3182 if !next.hasNextLink() || !next.IsEmpty() { 3183 break 3184 } 3185 } 3186 return nil 3187} 3188 3189// Next advances to the next page of values. If there was an error making 3190// the request the page does not advance and the error is returned. 3191// Deprecated: Use NextWithContext() instead. 3192func (page *VirtualMachineListResultPage) Next() error { 3193 return page.NextWithContext(context.Background()) 3194} 3195 3196// NotDone returns true if the page enumeration should be started or is not yet complete. 3197func (page VirtualMachineListResultPage) NotDone() bool { 3198 return !page.vmlr.IsEmpty() 3199} 3200 3201// Response returns the raw server response from the last page request. 3202func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 3203 return page.vmlr 3204} 3205 3206// Values returns the slice of values for the current page or nil if there are no values. 3207func (page VirtualMachineListResultPage) Values() []VirtualMachine { 3208 if page.vmlr.IsEmpty() { 3209 return nil 3210 } 3211 return *page.vmlr.Value 3212} 3213 3214// Creates a new instance of the VirtualMachineListResultPage type. 3215func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 3216 return VirtualMachineListResultPage{ 3217 fn: getNextPage, 3218 vmlr: cur, 3219 } 3220} 3221 3222// VirtualMachineProperties describes the properties of a Virtual Machine. 3223type VirtualMachineProperties struct { 3224 // HardwareProfile - Specifies the hardware settings for the virtual machine. 3225 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 3226 // StorageProfile - Specifies the storage settings for the virtual machine disks. 3227 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 3228 // OsProfile - Specifies the operating system settings for the virtual machine. 3229 OsProfile *OSProfile `json:"osProfile,omitempty"` 3230 // NetworkProfile - Specifies the network interfaces of the virtual machine. 3231 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 3232 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 3233 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 3234 // 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. 3235 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 3236 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 3237 ProvisioningState *string `json:"provisioningState,omitempty"` 3238 // InstanceView - READ-ONLY; The virtual machine instance view. 3239 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 3240 // 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 3241 LicenseType *string `json:"licenseType,omitempty"` 3242 // 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. 3243 VMID *string `json:"vmId,omitempty"` 3244} 3245 3246// MarshalJSON is the custom marshaler for VirtualMachineProperties. 3247func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 3248 objectMap := make(map[string]interface{}) 3249 if vmp.HardwareProfile != nil { 3250 objectMap["hardwareProfile"] = vmp.HardwareProfile 3251 } 3252 if vmp.StorageProfile != nil { 3253 objectMap["storageProfile"] = vmp.StorageProfile 3254 } 3255 if vmp.OsProfile != nil { 3256 objectMap["osProfile"] = vmp.OsProfile 3257 } 3258 if vmp.NetworkProfile != nil { 3259 objectMap["networkProfile"] = vmp.NetworkProfile 3260 } 3261 if vmp.DiagnosticsProfile != nil { 3262 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 3263 } 3264 if vmp.AvailabilitySet != nil { 3265 objectMap["availabilitySet"] = vmp.AvailabilitySet 3266 } 3267 if vmp.LicenseType != nil { 3268 objectMap["licenseType"] = vmp.LicenseType 3269 } 3270 return json.Marshal(objectMap) 3271} 3272 3273// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 3274type VirtualMachineScaleSet struct { 3275 autorest.Response `json:"-"` 3276 // Sku - The virtual machine scale set sku. 3277 Sku *Sku `json:"sku,omitempty"` 3278 // 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**. 3279 Plan *Plan `json:"plan,omitempty"` 3280 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 3281 // Identity - The identity of the virtual machine scale set, if configured. 3282 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 3283 // ID - READ-ONLY; Resource Id 3284 ID *string `json:"id,omitempty"` 3285 // Name - READ-ONLY; Resource name 3286 Name *string `json:"name,omitempty"` 3287 // Type - READ-ONLY; Resource type 3288 Type *string `json:"type,omitempty"` 3289 // Location - Resource location 3290 Location *string `json:"location,omitempty"` 3291 // Tags - Resource tags 3292 Tags map[string]*string `json:"tags"` 3293} 3294 3295// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 3296func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 3297 objectMap := make(map[string]interface{}) 3298 if vmss.Sku != nil { 3299 objectMap["sku"] = vmss.Sku 3300 } 3301 if vmss.Plan != nil { 3302 objectMap["plan"] = vmss.Plan 3303 } 3304 if vmss.VirtualMachineScaleSetProperties != nil { 3305 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 3306 } 3307 if vmss.Identity != nil { 3308 objectMap["identity"] = vmss.Identity 3309 } 3310 if vmss.Location != nil { 3311 objectMap["location"] = vmss.Location 3312 } 3313 if vmss.Tags != nil { 3314 objectMap["tags"] = vmss.Tags 3315 } 3316 return json.Marshal(objectMap) 3317} 3318 3319// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 3320func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 3321 var m map[string]*json.RawMessage 3322 err := json.Unmarshal(body, &m) 3323 if err != nil { 3324 return err 3325 } 3326 for k, v := range m { 3327 switch k { 3328 case "sku": 3329 if v != nil { 3330 var sku Sku 3331 err = json.Unmarshal(*v, &sku) 3332 if err != nil { 3333 return err 3334 } 3335 vmss.Sku = &sku 3336 } 3337 case "plan": 3338 if v != nil { 3339 var plan Plan 3340 err = json.Unmarshal(*v, &plan) 3341 if err != nil { 3342 return err 3343 } 3344 vmss.Plan = &plan 3345 } 3346 case "properties": 3347 if v != nil { 3348 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 3349 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 3350 if err != nil { 3351 return err 3352 } 3353 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 3354 } 3355 case "identity": 3356 if v != nil { 3357 var identity VirtualMachineScaleSetIdentity 3358 err = json.Unmarshal(*v, &identity) 3359 if err != nil { 3360 return err 3361 } 3362 vmss.Identity = &identity 3363 } 3364 case "id": 3365 if v != nil { 3366 var ID string 3367 err = json.Unmarshal(*v, &ID) 3368 if err != nil { 3369 return err 3370 } 3371 vmss.ID = &ID 3372 } 3373 case "name": 3374 if v != nil { 3375 var name string 3376 err = json.Unmarshal(*v, &name) 3377 if err != nil { 3378 return err 3379 } 3380 vmss.Name = &name 3381 } 3382 case "type": 3383 if v != nil { 3384 var typeVar string 3385 err = json.Unmarshal(*v, &typeVar) 3386 if err != nil { 3387 return err 3388 } 3389 vmss.Type = &typeVar 3390 } 3391 case "location": 3392 if v != nil { 3393 var location string 3394 err = json.Unmarshal(*v, &location) 3395 if err != nil { 3396 return err 3397 } 3398 vmss.Location = &location 3399 } 3400 case "tags": 3401 if v != nil { 3402 var tags map[string]*string 3403 err = json.Unmarshal(*v, &tags) 3404 if err != nil { 3405 return err 3406 } 3407 vmss.Tags = tags 3408 } 3409 } 3410 } 3411 3412 return nil 3413} 3414 3415// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 3416type VirtualMachineScaleSetDataDisk struct { 3417 // Name - The disk name. 3418 Name *string `json:"name,omitempty"` 3419 // 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. 3420 Lun *int32 `json:"lun,omitempty"` 3421 // 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' 3422 Caching CachingTypes `json:"caching,omitempty"` 3423 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 3424 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 3425 // 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 3426 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3427 // ManagedDisk - The managed disk parameters. 3428 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 3429} 3430 3431// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 3432type VirtualMachineScaleSetExtension struct { 3433 // Name - The name of the extension. 3434 Name *string `json:"name,omitempty"` 3435 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 3436 // ID - READ-ONLY; Resource Id 3437 ID *string `json:"id,omitempty"` 3438} 3439 3440// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 3441func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 3442 objectMap := make(map[string]interface{}) 3443 if vmsse.Name != nil { 3444 objectMap["name"] = vmsse.Name 3445 } 3446 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 3447 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 3448 } 3449 return json.Marshal(objectMap) 3450} 3451 3452// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 3453func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 3454 var m map[string]*json.RawMessage 3455 err := json.Unmarshal(body, &m) 3456 if err != nil { 3457 return err 3458 } 3459 for k, v := range m { 3460 switch k { 3461 case "name": 3462 if v != nil { 3463 var name string 3464 err = json.Unmarshal(*v, &name) 3465 if err != nil { 3466 return err 3467 } 3468 vmsse.Name = &name 3469 } 3470 case "properties": 3471 if v != nil { 3472 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 3473 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 3474 if err != nil { 3475 return err 3476 } 3477 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 3478 } 3479 case "id": 3480 if v != nil { 3481 var ID string 3482 err = json.Unmarshal(*v, &ID) 3483 if err != nil { 3484 return err 3485 } 3486 vmsse.ID = &ID 3487 } 3488 } 3489 } 3490 3491 return nil 3492} 3493 3494// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 3495type VirtualMachineScaleSetExtensionProfile struct { 3496 // Extensions - The virtual machine scale set child extension resources. 3497 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 3498} 3499 3500// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 3501// Extension. 3502type VirtualMachineScaleSetExtensionProperties struct { 3503 // Publisher - The name of the extension handler publisher. 3504 Publisher *string `json:"publisher,omitempty"` 3505 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 3506 Type *string `json:"type,omitempty"` 3507 // TypeHandlerVersion - Specifies the version of the script handler. 3508 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 3509 // 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. 3510 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 3511 // Settings - Json formatted public settings for the extension. 3512 Settings interface{} `json:"settings,omitempty"` 3513 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 3514 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 3515 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 3516 ProvisioningState *string `json:"provisioningState,omitempty"` 3517} 3518 3519// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 3520func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 3521 objectMap := make(map[string]interface{}) 3522 if vmssep.Publisher != nil { 3523 objectMap["publisher"] = vmssep.Publisher 3524 } 3525 if vmssep.Type != nil { 3526 objectMap["type"] = vmssep.Type 3527 } 3528 if vmssep.TypeHandlerVersion != nil { 3529 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 3530 } 3531 if vmssep.AutoUpgradeMinorVersion != nil { 3532 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 3533 } 3534 if vmssep.Settings != nil { 3535 objectMap["settings"] = vmssep.Settings 3536 } 3537 if vmssep.ProtectedSettings != nil { 3538 objectMap["protectedSettings"] = vmssep.ProtectedSettings 3539 } 3540 return json.Marshal(objectMap) 3541} 3542 3543// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 3544type VirtualMachineScaleSetIdentity struct { 3545 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. 3546 PrincipalID *string `json:"principalId,omitempty"` 3547 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. 3548 TenantID *string `json:"tenantId,omitempty"` 3549 // Type - The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Possible values include: 'SystemAssigned' 3550 Type ResourceIdentityType `json:"type,omitempty"` 3551} 3552 3553// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 3554func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 3555 objectMap := make(map[string]interface{}) 3556 if vmssi.Type != "" { 3557 objectMap["type"] = vmssi.Type 3558 } 3559 return json.Marshal(objectMap) 3560} 3561 3562// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 3563type VirtualMachineScaleSetInstanceView struct { 3564 autorest.Response `json:"-"` 3565 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 3566 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 3567 // Extensions - READ-ONLY; The extensions information. 3568 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 3569 // Statuses - The resource status information. 3570 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3571} 3572 3573// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 3574func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 3575 objectMap := make(map[string]interface{}) 3576 if vmssiv.Statuses != nil { 3577 objectMap["statuses"] = vmssiv.Statuses 3578 } 3579 return json.Marshal(objectMap) 3580} 3581 3582// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 3583// a virtual machine scale set. 3584type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 3585 // StatusesSummary - READ-ONLY; The extensions information. 3586 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 3587} 3588 3589// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 3590// configuration. 3591type VirtualMachineScaleSetIPConfiguration struct { 3592 // Name - The IP configuration name. 3593 Name *string `json:"name,omitempty"` 3594 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 3595 // ID - Resource Id 3596 ID *string `json:"id,omitempty"` 3597} 3598 3599// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 3600func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 3601 objectMap := make(map[string]interface{}) 3602 if vmssic.Name != nil { 3603 objectMap["name"] = vmssic.Name 3604 } 3605 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 3606 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 3607 } 3608 if vmssic.ID != nil { 3609 objectMap["id"] = vmssic.ID 3610 } 3611 return json.Marshal(objectMap) 3612} 3613 3614// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 3615func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 3616 var m map[string]*json.RawMessage 3617 err := json.Unmarshal(body, &m) 3618 if err != nil { 3619 return err 3620 } 3621 for k, v := range m { 3622 switch k { 3623 case "name": 3624 if v != nil { 3625 var name string 3626 err = json.Unmarshal(*v, &name) 3627 if err != nil { 3628 return err 3629 } 3630 vmssic.Name = &name 3631 } 3632 case "properties": 3633 if v != nil { 3634 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 3635 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 3636 if err != nil { 3637 return err 3638 } 3639 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 3640 } 3641 case "id": 3642 if v != nil { 3643 var ID string 3644 err = json.Unmarshal(*v, &ID) 3645 if err != nil { 3646 return err 3647 } 3648 vmssic.ID = &ID 3649 } 3650 } 3651 } 3652 3653 return nil 3654} 3655 3656// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 3657// IP configuration properties. 3658type VirtualMachineScaleSetIPConfigurationProperties struct { 3659 // Subnet - The subnet. 3660 Subnet *APIEntityReference `json:"subnet,omitempty"` 3661 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 3662 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 3663 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 3664 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 3665 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 3666 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 3667} 3668 3669// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 3670type VirtualMachineScaleSetListResult struct { 3671 autorest.Response `json:"-"` 3672 // Value - The list of virtual machine scale sets. 3673 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 3674 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 3675 NextLink *string `json:"nextLink,omitempty"` 3676} 3677 3678// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 3679// values. 3680type VirtualMachineScaleSetListResultIterator struct { 3681 i int 3682 page VirtualMachineScaleSetListResultPage 3683} 3684 3685// NextWithContext advances to the next value. If there was an error making 3686// the request the iterator does not advance and the error is returned. 3687func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 3688 if tracing.IsEnabled() { 3689 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 3690 defer func() { 3691 sc := -1 3692 if iter.Response().Response.Response != nil { 3693 sc = iter.Response().Response.Response.StatusCode 3694 } 3695 tracing.EndSpan(ctx, sc, err) 3696 }() 3697 } 3698 iter.i++ 3699 if iter.i < len(iter.page.Values()) { 3700 return nil 3701 } 3702 err = iter.page.NextWithContext(ctx) 3703 if err != nil { 3704 iter.i-- 3705 return err 3706 } 3707 iter.i = 0 3708 return nil 3709} 3710 3711// Next advances to the next value. If there was an error making 3712// the request the iterator does not advance and the error is returned. 3713// Deprecated: Use NextWithContext() instead. 3714func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 3715 return iter.NextWithContext(context.Background()) 3716} 3717 3718// NotDone returns true if the enumeration should be started or is not yet complete. 3719func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 3720 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3721} 3722 3723// Response returns the raw server response from the last page request. 3724func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 3725 return iter.page.Response() 3726} 3727 3728// Value returns the current value or a zero-initialized value if the 3729// iterator has advanced beyond the end of the collection. 3730func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 3731 if !iter.page.NotDone() { 3732 return VirtualMachineScaleSet{} 3733 } 3734 return iter.page.Values()[iter.i] 3735} 3736 3737// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 3738func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 3739 return VirtualMachineScaleSetListResultIterator{page: page} 3740} 3741 3742// IsEmpty returns true if the ListResult contains no values. 3743func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 3744 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 3745} 3746 3747// hasNextLink returns true if the NextLink is not empty. 3748func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 3749 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 3750} 3751 3752// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 3753// It returns nil if no more results exist. 3754func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 3755 if !vmsslr.hasNextLink() { 3756 return nil, nil 3757 } 3758 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3759 autorest.AsJSON(), 3760 autorest.AsGet(), 3761 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 3762} 3763 3764// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 3765type VirtualMachineScaleSetListResultPage struct { 3766 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 3767 vmsslr VirtualMachineScaleSetListResult 3768} 3769 3770// NextWithContext advances to the next page of values. If there was an error making 3771// the request the page does not advance and the error is returned. 3772func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 3773 if tracing.IsEnabled() { 3774 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 3775 defer func() { 3776 sc := -1 3777 if page.Response().Response.Response != nil { 3778 sc = page.Response().Response.Response.StatusCode 3779 } 3780 tracing.EndSpan(ctx, sc, err) 3781 }() 3782 } 3783 for { 3784 next, err := page.fn(ctx, page.vmsslr) 3785 if err != nil { 3786 return err 3787 } 3788 page.vmsslr = next 3789 if !next.hasNextLink() || !next.IsEmpty() { 3790 break 3791 } 3792 } 3793 return nil 3794} 3795 3796// Next advances to the next page of values. If there was an error making 3797// the request the page does not advance and the error is returned. 3798// Deprecated: Use NextWithContext() instead. 3799func (page *VirtualMachineScaleSetListResultPage) Next() error { 3800 return page.NextWithContext(context.Background()) 3801} 3802 3803// NotDone returns true if the page enumeration should be started or is not yet complete. 3804func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 3805 return !page.vmsslr.IsEmpty() 3806} 3807 3808// Response returns the raw server response from the last page request. 3809func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 3810 return page.vmsslr 3811} 3812 3813// Values returns the slice of values for the current page or nil if there are no values. 3814func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 3815 if page.vmsslr.IsEmpty() { 3816 return nil 3817 } 3818 return *page.vmsslr.Value 3819} 3820 3821// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 3822func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 3823 return VirtualMachineScaleSetListResultPage{ 3824 fn: getNextPage, 3825 vmsslr: cur, 3826 } 3827} 3828 3829// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 3830type VirtualMachineScaleSetListSkusResult struct { 3831 autorest.Response `json:"-"` 3832 // Value - The list of skus available for the virtual machine scale set. 3833 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 3834 // 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. 3835 NextLink *string `json:"nextLink,omitempty"` 3836} 3837 3838// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 3839// VirtualMachineScaleSetSku values. 3840type VirtualMachineScaleSetListSkusResultIterator struct { 3841 i int 3842 page VirtualMachineScaleSetListSkusResultPage 3843} 3844 3845// NextWithContext advances to the next value. If there was an error making 3846// the request the iterator does not advance and the error is returned. 3847func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 3848 if tracing.IsEnabled() { 3849 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 3850 defer func() { 3851 sc := -1 3852 if iter.Response().Response.Response != nil { 3853 sc = iter.Response().Response.Response.StatusCode 3854 } 3855 tracing.EndSpan(ctx, sc, err) 3856 }() 3857 } 3858 iter.i++ 3859 if iter.i < len(iter.page.Values()) { 3860 return nil 3861 } 3862 err = iter.page.NextWithContext(ctx) 3863 if err != nil { 3864 iter.i-- 3865 return err 3866 } 3867 iter.i = 0 3868 return nil 3869} 3870 3871// Next advances to the next value. If there was an error making 3872// the request the iterator does not advance and the error is returned. 3873// Deprecated: Use NextWithContext() instead. 3874func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 3875 return iter.NextWithContext(context.Background()) 3876} 3877 3878// NotDone returns true if the enumeration should be started or is not yet complete. 3879func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 3880 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3881} 3882 3883// Response returns the raw server response from the last page request. 3884func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 3885 return iter.page.Response() 3886} 3887 3888// Value returns the current value or a zero-initialized value if the 3889// iterator has advanced beyond the end of the collection. 3890func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 3891 if !iter.page.NotDone() { 3892 return VirtualMachineScaleSetSku{} 3893 } 3894 return iter.page.Values()[iter.i] 3895} 3896 3897// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 3898func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 3899 return VirtualMachineScaleSetListSkusResultIterator{page: page} 3900} 3901 3902// IsEmpty returns true if the ListResult contains no values. 3903func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 3904 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 3905} 3906 3907// hasNextLink returns true if the NextLink is not empty. 3908func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 3909 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 3910} 3911 3912// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 3913// It returns nil if no more results exist. 3914func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 3915 if !vmsslsr.hasNextLink() { 3916 return nil, nil 3917 } 3918 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3919 autorest.AsJSON(), 3920 autorest.AsGet(), 3921 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 3922} 3923 3924// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 3925type VirtualMachineScaleSetListSkusResultPage struct { 3926 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 3927 vmsslsr VirtualMachineScaleSetListSkusResult 3928} 3929 3930// NextWithContext advances to the next page of values. If there was an error making 3931// the request the page does not advance and the error is returned. 3932func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 3933 if tracing.IsEnabled() { 3934 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 3935 defer func() { 3936 sc := -1 3937 if page.Response().Response.Response != nil { 3938 sc = page.Response().Response.Response.StatusCode 3939 } 3940 tracing.EndSpan(ctx, sc, err) 3941 }() 3942 } 3943 for { 3944 next, err := page.fn(ctx, page.vmsslsr) 3945 if err != nil { 3946 return err 3947 } 3948 page.vmsslsr = next 3949 if !next.hasNextLink() || !next.IsEmpty() { 3950 break 3951 } 3952 } 3953 return nil 3954} 3955 3956// Next advances to the next page of values. If there was an error making 3957// the request the page does not advance and the error is returned. 3958// Deprecated: Use NextWithContext() instead. 3959func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 3960 return page.NextWithContext(context.Background()) 3961} 3962 3963// NotDone returns true if the page enumeration should be started or is not yet complete. 3964func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 3965 return !page.vmsslsr.IsEmpty() 3966} 3967 3968// Response returns the raw server response from the last page request. 3969func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 3970 return page.vmsslsr 3971} 3972 3973// Values returns the slice of values for the current page or nil if there are no values. 3974func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 3975 if page.vmsslsr.IsEmpty() { 3976 return nil 3977 } 3978 return *page.vmsslsr.Value 3979} 3980 3981// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 3982func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 3983 return VirtualMachineScaleSetListSkusResultPage{ 3984 fn: getNextPage, 3985 vmsslsr: cur, 3986 } 3987} 3988 3989// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 3990type VirtualMachineScaleSetListWithLinkResult struct { 3991 autorest.Response `json:"-"` 3992 // Value - The list of virtual machine scale sets. 3993 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 3994 // 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. 3995 NextLink *string `json:"nextLink,omitempty"` 3996} 3997 3998// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 3999// VirtualMachineScaleSet values. 4000type VirtualMachineScaleSetListWithLinkResultIterator struct { 4001 i int 4002 page VirtualMachineScaleSetListWithLinkResultPage 4003} 4004 4005// NextWithContext advances to the next value. If there was an error making 4006// the request the iterator does not advance and the error is returned. 4007func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 4008 if tracing.IsEnabled() { 4009 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 4010 defer func() { 4011 sc := -1 4012 if iter.Response().Response.Response != nil { 4013 sc = iter.Response().Response.Response.StatusCode 4014 } 4015 tracing.EndSpan(ctx, sc, err) 4016 }() 4017 } 4018 iter.i++ 4019 if iter.i < len(iter.page.Values()) { 4020 return nil 4021 } 4022 err = iter.page.NextWithContext(ctx) 4023 if err != nil { 4024 iter.i-- 4025 return err 4026 } 4027 iter.i = 0 4028 return nil 4029} 4030 4031// Next advances to the next value. If there was an error making 4032// the request the iterator does not advance and the error is returned. 4033// Deprecated: Use NextWithContext() instead. 4034func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 4035 return iter.NextWithContext(context.Background()) 4036} 4037 4038// NotDone returns true if the enumeration should be started or is not yet complete. 4039func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 4040 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4041} 4042 4043// Response returns the raw server response from the last page request. 4044func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 4045 return iter.page.Response() 4046} 4047 4048// Value returns the current value or a zero-initialized value if the 4049// iterator has advanced beyond the end of the collection. 4050func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 4051 if !iter.page.NotDone() { 4052 return VirtualMachineScaleSet{} 4053 } 4054 return iter.page.Values()[iter.i] 4055} 4056 4057// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 4058func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 4059 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 4060} 4061 4062// IsEmpty returns true if the ListResult contains no values. 4063func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 4064 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 4065} 4066 4067// hasNextLink returns true if the NextLink is not empty. 4068func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 4069 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 4070} 4071 4072// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 4073// It returns nil if no more results exist. 4074func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 4075 if !vmsslwlr.hasNextLink() { 4076 return nil, nil 4077 } 4078 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4079 autorest.AsJSON(), 4080 autorest.AsGet(), 4081 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 4082} 4083 4084// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 4085type VirtualMachineScaleSetListWithLinkResultPage struct { 4086 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 4087 vmsslwlr VirtualMachineScaleSetListWithLinkResult 4088} 4089 4090// NextWithContext advances to the next page of values. If there was an error making 4091// the request the page does not advance and the error is returned. 4092func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 4093 if tracing.IsEnabled() { 4094 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 4095 defer func() { 4096 sc := -1 4097 if page.Response().Response.Response != nil { 4098 sc = page.Response().Response.Response.StatusCode 4099 } 4100 tracing.EndSpan(ctx, sc, err) 4101 }() 4102 } 4103 for { 4104 next, err := page.fn(ctx, page.vmsslwlr) 4105 if err != nil { 4106 return err 4107 } 4108 page.vmsslwlr = next 4109 if !next.hasNextLink() || !next.IsEmpty() { 4110 break 4111 } 4112 } 4113 return nil 4114} 4115 4116// Next advances to the next page of values. If there was an error making 4117// the request the page does not advance and the error is returned. 4118// Deprecated: Use NextWithContext() instead. 4119func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 4120 return page.NextWithContext(context.Background()) 4121} 4122 4123// NotDone returns true if the page enumeration should be started or is not yet complete. 4124func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 4125 return !page.vmsslwlr.IsEmpty() 4126} 4127 4128// Response returns the raw server response from the last page request. 4129func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 4130 return page.vmsslwlr 4131} 4132 4133// Values returns the slice of values for the current page or nil if there are no values. 4134func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 4135 if page.vmsslwlr.IsEmpty() { 4136 return nil 4137 } 4138 return *page.vmsslwlr.Value 4139} 4140 4141// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 4142func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 4143 return VirtualMachineScaleSetListWithLinkResultPage{ 4144 fn: getNextPage, 4145 vmsslwlr: cur, 4146 } 4147} 4148 4149// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 4150type VirtualMachineScaleSetManagedDiskParameters struct { 4151 // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS' 4152 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 4153} 4154 4155// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 4156// network configurations. 4157type VirtualMachineScaleSetNetworkConfiguration struct { 4158 // Name - The network configuration name. 4159 Name *string `json:"name,omitempty"` 4160 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 4161 // ID - Resource Id 4162 ID *string `json:"id,omitempty"` 4163} 4164 4165// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 4166func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 4167 objectMap := make(map[string]interface{}) 4168 if vmssnc.Name != nil { 4169 objectMap["name"] = vmssnc.Name 4170 } 4171 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 4172 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 4173 } 4174 if vmssnc.ID != nil { 4175 objectMap["id"] = vmssnc.ID 4176 } 4177 return json.Marshal(objectMap) 4178} 4179 4180// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 4181func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 4182 var m map[string]*json.RawMessage 4183 err := json.Unmarshal(body, &m) 4184 if err != nil { 4185 return err 4186 } 4187 for k, v := range m { 4188 switch k { 4189 case "name": 4190 if v != nil { 4191 var name string 4192 err = json.Unmarshal(*v, &name) 4193 if err != nil { 4194 return err 4195 } 4196 vmssnc.Name = &name 4197 } 4198 case "properties": 4199 if v != nil { 4200 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 4201 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 4202 if err != nil { 4203 return err 4204 } 4205 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 4206 } 4207 case "id": 4208 if v != nil { 4209 var ID string 4210 err = json.Unmarshal(*v, &ID) 4211 if err != nil { 4212 return err 4213 } 4214 vmssnc.ID = &ID 4215 } 4216 } 4217 } 4218 4219 return nil 4220} 4221 4222// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 4223// profile's IP configuration. 4224type VirtualMachineScaleSetNetworkConfigurationProperties struct { 4225 // Primary - Whether this is a primary NIC on a virtual machine. 4226 Primary *bool `json:"primary,omitempty"` 4227 // IPConfigurations - The virtual machine scale set IP Configuration. 4228 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 4229} 4230 4231// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 4232type VirtualMachineScaleSetNetworkProfile struct { 4233 // NetworkInterfaceConfigurations - The list of network configurations. 4234 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 4235} 4236 4237// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 4238type VirtualMachineScaleSetOSDisk struct { 4239 // Name - The disk name. 4240 Name *string `json:"name,omitempty"` 4241 // 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' 4242 Caching CachingTypes `json:"caching,omitempty"` 4243 // 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' 4244 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 4245 // 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' 4246 OsType OperatingSystemTypes `json:"osType,omitempty"` 4247 // 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. 4248 Image *VirtualHardDisk `json:"image,omitempty"` 4249 // VhdContainers - The list of virtual hard disk container uris. 4250 VhdContainers *[]string `json:"vhdContainers,omitempty"` 4251 // ManagedDisk - The managed disk parameters. 4252 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 4253} 4254 4255// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 4256type VirtualMachineScaleSetOSProfile struct { 4257 // 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. 4258 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 4259 // 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) 4260 AdminUsername *string `json:"adminUsername,omitempty"` 4261 // 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) 4262 AdminPassword *string `json:"adminPassword,omitempty"` 4263 // CustomData - A base-64 encoded string of custom data. 4264 CustomData *string `json:"customData,omitempty"` 4265 // WindowsConfiguration - The Windows Configuration of the OS profile. 4266 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 4267 // LinuxConfiguration - The Linux Configuration of the OS profile. 4268 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 4269 // Secrets - The List of certificates for addition to the VM. 4270 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 4271} 4272 4273// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 4274type VirtualMachineScaleSetProperties struct { 4275 // UpgradePolicy - The upgrade policy. 4276 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 4277 // VirtualMachineProfile - The virtual machine profile. 4278 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 4279 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 4280 ProvisioningState *string `json:"provisioningState,omitempty"` 4281 // OverProvision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 4282 OverProvision *bool `json:"overProvision,omitempty"` 4283 // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. 4284 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 4285} 4286 4287// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 4288func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 4289 objectMap := make(map[string]interface{}) 4290 if vmssp.UpgradePolicy != nil { 4291 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 4292 } 4293 if vmssp.VirtualMachineProfile != nil { 4294 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 4295 } 4296 if vmssp.OverProvision != nil { 4297 objectMap["overProvision"] = vmssp.OverProvision 4298 } 4299 if vmssp.SinglePlacementGroup != nil { 4300 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 4301 } 4302 return json.Marshal(objectMap) 4303} 4304 4305// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 4306// a long-running operation. 4307type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 4308 azure.FutureAPI 4309 // Result returns the result of the asynchronous operation. 4310 // If the operation has not completed it will return an error. 4311 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 4312} 4313 4314// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 4315// long-running operation. 4316type VirtualMachineScaleSetsDeallocateFuture struct { 4317 azure.FutureAPI 4318 // Result returns the result of the asynchronous operation. 4319 // If the operation has not completed it will return an error. 4320 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4321} 4322 4323// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 4324// long-running operation. 4325type VirtualMachineScaleSetsDeleteFuture struct { 4326 azure.FutureAPI 4327 // Result returns the result of the asynchronous operation. 4328 // If the operation has not completed it will return an error. 4329 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4330} 4331 4332// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 4333// a long-running operation. 4334type VirtualMachineScaleSetsDeleteInstancesFuture struct { 4335 azure.FutureAPI 4336 // Result returns the result of the asynchronous operation. 4337 // If the operation has not completed it will return an error. 4338 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4339} 4340 4341// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 4342type VirtualMachineScaleSetSku struct { 4343 // ResourceType - READ-ONLY; The type of resource the sku applies to. 4344 ResourceType *string `json:"resourceType,omitempty"` 4345 // Sku - READ-ONLY; The Sku. 4346 Sku *Sku `json:"sku,omitempty"` 4347 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 4348 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 4349} 4350 4351// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 4352type VirtualMachineScaleSetSkuCapacity struct { 4353 // Minimum - READ-ONLY; The minimum capacity. 4354 Minimum *int64 `json:"minimum,omitempty"` 4355 // Maximum - READ-ONLY; The maximum capacity that can be set. 4356 Maximum *int64 `json:"maximum,omitempty"` 4357 // DefaultCapacity - READ-ONLY; The default capacity. 4358 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 4359 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 4360 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 4361} 4362 4363// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 4364// long-running operation. 4365type VirtualMachineScaleSetsPowerOffFuture struct { 4366 azure.FutureAPI 4367 // Result returns the result of the asynchronous operation. 4368 // If the operation has not completed it will return an error. 4369 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4370} 4371 4372// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 4373// long-running operation. 4374type VirtualMachineScaleSetsReimageAllFuture struct { 4375 azure.FutureAPI 4376 // Result returns the result of the asynchronous operation. 4377 // If the operation has not completed it will return an error. 4378 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4379} 4380 4381// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 4382// long-running operation. 4383type VirtualMachineScaleSetsReimageFuture struct { 4384 azure.FutureAPI 4385 // Result returns the result of the asynchronous operation. 4386 // If the operation has not completed it will return an error. 4387 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4388} 4389 4390// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 4391// long-running operation. 4392type VirtualMachineScaleSetsRestartFuture struct { 4393 azure.FutureAPI 4394 // Result returns the result of the asynchronous operation. 4395 // If the operation has not completed it will return an error. 4396 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4397} 4398 4399// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 4400// long-running operation. 4401type VirtualMachineScaleSetsStartFuture struct { 4402 azure.FutureAPI 4403 // Result returns the result of the asynchronous operation. 4404 // If the operation has not completed it will return an error. 4405 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4406} 4407 4408// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 4409type VirtualMachineScaleSetStorageProfile struct { 4410 // ImageReference - The image reference. 4411 ImageReference *ImageReference `json:"imageReference,omitempty"` 4412 // OsDisk - The OS disk. 4413 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 4414 // DataDisks - The data disks. 4415 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 4416} 4417 4418// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 4419// a long-running operation. 4420type VirtualMachineScaleSetsUpdateInstancesFuture struct { 4421 azure.FutureAPI 4422 // Result returns the result of the asynchronous operation. 4423 // If the operation has not completed it will return an error. 4424 Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error) 4425} 4426 4427// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 4428type VirtualMachineScaleSetVM struct { 4429 autorest.Response `json:"-"` 4430 // InstanceID - READ-ONLY; The virtual machine instance ID. 4431 InstanceID *string `json:"instanceId,omitempty"` 4432 // Sku - READ-ONLY; The virtual machine SKU. 4433 Sku *Sku `json:"sku,omitempty"` 4434 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 4435 // 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**. 4436 Plan *Plan `json:"plan,omitempty"` 4437 // Resources - READ-ONLY; The virtual machine child extension resources. 4438 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 4439 // ID - READ-ONLY; Resource Id 4440 ID *string `json:"id,omitempty"` 4441 // Name - READ-ONLY; Resource name 4442 Name *string `json:"name,omitempty"` 4443 // Type - READ-ONLY; Resource type 4444 Type *string `json:"type,omitempty"` 4445 // Location - Resource location 4446 Location *string `json:"location,omitempty"` 4447 // Tags - Resource tags 4448 Tags map[string]*string `json:"tags"` 4449} 4450 4451// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 4452func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 4453 objectMap := make(map[string]interface{}) 4454 if vmssv.VirtualMachineScaleSetVMProperties != nil { 4455 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 4456 } 4457 if vmssv.Plan != nil { 4458 objectMap["plan"] = vmssv.Plan 4459 } 4460 if vmssv.Location != nil { 4461 objectMap["location"] = vmssv.Location 4462 } 4463 if vmssv.Tags != nil { 4464 objectMap["tags"] = vmssv.Tags 4465 } 4466 return json.Marshal(objectMap) 4467} 4468 4469// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 4470func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 4471 var m map[string]*json.RawMessage 4472 err := json.Unmarshal(body, &m) 4473 if err != nil { 4474 return err 4475 } 4476 for k, v := range m { 4477 switch k { 4478 case "instanceId": 4479 if v != nil { 4480 var instanceID string 4481 err = json.Unmarshal(*v, &instanceID) 4482 if err != nil { 4483 return err 4484 } 4485 vmssv.InstanceID = &instanceID 4486 } 4487 case "sku": 4488 if v != nil { 4489 var sku Sku 4490 err = json.Unmarshal(*v, &sku) 4491 if err != nil { 4492 return err 4493 } 4494 vmssv.Sku = &sku 4495 } 4496 case "properties": 4497 if v != nil { 4498 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 4499 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 4500 if err != nil { 4501 return err 4502 } 4503 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 4504 } 4505 case "plan": 4506 if v != nil { 4507 var plan Plan 4508 err = json.Unmarshal(*v, &plan) 4509 if err != nil { 4510 return err 4511 } 4512 vmssv.Plan = &plan 4513 } 4514 case "resources": 4515 if v != nil { 4516 var resources []VirtualMachineExtension 4517 err = json.Unmarshal(*v, &resources) 4518 if err != nil { 4519 return err 4520 } 4521 vmssv.Resources = &resources 4522 } 4523 case "id": 4524 if v != nil { 4525 var ID string 4526 err = json.Unmarshal(*v, &ID) 4527 if err != nil { 4528 return err 4529 } 4530 vmssv.ID = &ID 4531 } 4532 case "name": 4533 if v != nil { 4534 var name string 4535 err = json.Unmarshal(*v, &name) 4536 if err != nil { 4537 return err 4538 } 4539 vmssv.Name = &name 4540 } 4541 case "type": 4542 if v != nil { 4543 var typeVar string 4544 err = json.Unmarshal(*v, &typeVar) 4545 if err != nil { 4546 return err 4547 } 4548 vmssv.Type = &typeVar 4549 } 4550 case "location": 4551 if v != nil { 4552 var location string 4553 err = json.Unmarshal(*v, &location) 4554 if err != nil { 4555 return err 4556 } 4557 vmssv.Location = &location 4558 } 4559 case "tags": 4560 if v != nil { 4561 var tags map[string]*string 4562 err = json.Unmarshal(*v, &tags) 4563 if err != nil { 4564 return err 4565 } 4566 vmssv.Tags = tags 4567 } 4568 } 4569 } 4570 4571 return nil 4572} 4573 4574// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 4575// scale set. 4576type VirtualMachineScaleSetVMExtensionsSummary struct { 4577 // Name - READ-ONLY; The extension name. 4578 Name *string `json:"name,omitempty"` 4579 // StatusesSummary - READ-ONLY; The extensions information. 4580 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 4581} 4582 4583// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 4584// set. 4585type VirtualMachineScaleSetVMInstanceIDs struct { 4586 // 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. 4587 InstanceIds *[]string `json:"instanceIds,omitempty"` 4588} 4589 4590// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 4591// scale set. 4592type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 4593 // InstanceIds - The virtual machine scale set instance ids. 4594 InstanceIds *[]string `json:"instanceIds,omitempty"` 4595} 4596 4597// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 4598type VirtualMachineScaleSetVMInstanceView struct { 4599 autorest.Response `json:"-"` 4600 // PlatformUpdateDomain - The Update Domain count. 4601 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 4602 // PlatformFaultDomain - The Fault Domain count. 4603 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 4604 // RdpThumbPrint - The Remote desktop certificate thumbprint. 4605 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 4606 // VMAgent - The VM Agent running on the virtual machine. 4607 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 4608 // Disks - The disks information. 4609 Disks *[]DiskInstanceView `json:"disks,omitempty"` 4610 // Extensions - The extensions information. 4611 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 4612 // 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. 4613 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 4614 // Statuses - The resource status information. 4615 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 4616 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 4617 PlacementGroupID *string `json:"placementGroupId,omitempty"` 4618} 4619 4620// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 4621type VirtualMachineScaleSetVMListResult struct { 4622 autorest.Response `json:"-"` 4623 // Value - The list of virtual machine scale sets VMs. 4624 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 4625 // 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 4626 NextLink *string `json:"nextLink,omitempty"` 4627} 4628 4629// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 4630// VirtualMachineScaleSetVM values. 4631type VirtualMachineScaleSetVMListResultIterator struct { 4632 i int 4633 page VirtualMachineScaleSetVMListResultPage 4634} 4635 4636// NextWithContext advances to the next value. If there was an error making 4637// the request the iterator does not advance and the error is returned. 4638func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 4639 if tracing.IsEnabled() { 4640 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 4641 defer func() { 4642 sc := -1 4643 if iter.Response().Response.Response != nil { 4644 sc = iter.Response().Response.Response.StatusCode 4645 } 4646 tracing.EndSpan(ctx, sc, err) 4647 }() 4648 } 4649 iter.i++ 4650 if iter.i < len(iter.page.Values()) { 4651 return nil 4652 } 4653 err = iter.page.NextWithContext(ctx) 4654 if err != nil { 4655 iter.i-- 4656 return err 4657 } 4658 iter.i = 0 4659 return nil 4660} 4661 4662// Next advances to the next value. If there was an error making 4663// the request the iterator does not advance and the error is returned. 4664// Deprecated: Use NextWithContext() instead. 4665func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 4666 return iter.NextWithContext(context.Background()) 4667} 4668 4669// NotDone returns true if the enumeration should be started or is not yet complete. 4670func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 4671 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4672} 4673 4674// Response returns the raw server response from the last page request. 4675func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 4676 return iter.page.Response() 4677} 4678 4679// Value returns the current value or a zero-initialized value if the 4680// iterator has advanced beyond the end of the collection. 4681func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 4682 if !iter.page.NotDone() { 4683 return VirtualMachineScaleSetVM{} 4684 } 4685 return iter.page.Values()[iter.i] 4686} 4687 4688// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 4689func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 4690 return VirtualMachineScaleSetVMListResultIterator{page: page} 4691} 4692 4693// IsEmpty returns true if the ListResult contains no values. 4694func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 4695 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 4696} 4697 4698// hasNextLink returns true if the NextLink is not empty. 4699func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 4700 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 4701} 4702 4703// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 4704// It returns nil if no more results exist. 4705func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 4706 if !vmssvlr.hasNextLink() { 4707 return nil, nil 4708 } 4709 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4710 autorest.AsJSON(), 4711 autorest.AsGet(), 4712 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 4713} 4714 4715// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 4716type VirtualMachineScaleSetVMListResultPage struct { 4717 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 4718 vmssvlr VirtualMachineScaleSetVMListResult 4719} 4720 4721// NextWithContext advances to the next page of values. If there was an error making 4722// the request the page does not advance and the error is returned. 4723func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 4724 if tracing.IsEnabled() { 4725 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 4726 defer func() { 4727 sc := -1 4728 if page.Response().Response.Response != nil { 4729 sc = page.Response().Response.Response.StatusCode 4730 } 4731 tracing.EndSpan(ctx, sc, err) 4732 }() 4733 } 4734 for { 4735 next, err := page.fn(ctx, page.vmssvlr) 4736 if err != nil { 4737 return err 4738 } 4739 page.vmssvlr = next 4740 if !next.hasNextLink() || !next.IsEmpty() { 4741 break 4742 } 4743 } 4744 return nil 4745} 4746 4747// Next advances to the next page of values. If there was an error making 4748// the request the page does not advance and the error is returned. 4749// Deprecated: Use NextWithContext() instead. 4750func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 4751 return page.NextWithContext(context.Background()) 4752} 4753 4754// NotDone returns true if the page enumeration should be started or is not yet complete. 4755func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 4756 return !page.vmssvlr.IsEmpty() 4757} 4758 4759// Response returns the raw server response from the last page request. 4760func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 4761 return page.vmssvlr 4762} 4763 4764// Values returns the slice of values for the current page or nil if there are no values. 4765func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 4766 if page.vmssvlr.IsEmpty() { 4767 return nil 4768 } 4769 return *page.vmssvlr.Value 4770} 4771 4772// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 4773func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 4774 return VirtualMachineScaleSetVMListResultPage{ 4775 fn: getNextPage, 4776 vmssvlr: cur, 4777 } 4778} 4779 4780// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 4781type VirtualMachineScaleSetVMProfile struct { 4782 // OsProfile - The virtual machine scale set OS profile. 4783 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 4784 // StorageProfile - The virtual machine scale set storage profile. 4785 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 4786 // NetworkProfile - The virtual machine scale set network profile. 4787 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 4788 // ExtensionProfile - The virtual machine scale set extension profile. 4789 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 4790} 4791 4792// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 4793// machine. 4794type VirtualMachineScaleSetVMProperties struct { 4795 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 4796 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 4797 // VMID - READ-ONLY; Azure VM unique ID. 4798 VMID *string `json:"vmId,omitempty"` 4799 // InstanceView - READ-ONLY; The virtual machine instance view. 4800 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 4801 // HardwareProfile - Specifies the hardware settings for the virtual machine. 4802 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 4803 // StorageProfile - Specifies the storage settings for the virtual machine disks. 4804 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 4805 // OsProfile - Specifies the operating system settings for the virtual machine. 4806 OsProfile *OSProfile `json:"osProfile,omitempty"` 4807 // NetworkProfile - Specifies the network interfaces of the virtual machine. 4808 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 4809 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 4810 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 4811 // 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. 4812 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 4813 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 4814 ProvisioningState *string `json:"provisioningState,omitempty"` 4815 // 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 4816 LicenseType *string `json:"licenseType,omitempty"` 4817} 4818 4819// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 4820func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 4821 objectMap := make(map[string]interface{}) 4822 if vmssvp.HardwareProfile != nil { 4823 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 4824 } 4825 if vmssvp.StorageProfile != nil { 4826 objectMap["storageProfile"] = vmssvp.StorageProfile 4827 } 4828 if vmssvp.OsProfile != nil { 4829 objectMap["osProfile"] = vmssvp.OsProfile 4830 } 4831 if vmssvp.NetworkProfile != nil { 4832 objectMap["networkProfile"] = vmssvp.NetworkProfile 4833 } 4834 if vmssvp.DiagnosticsProfile != nil { 4835 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 4836 } 4837 if vmssvp.AvailabilitySet != nil { 4838 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 4839 } 4840 if vmssvp.LicenseType != nil { 4841 objectMap["licenseType"] = vmssvp.LicenseType 4842 } 4843 return json.Marshal(objectMap) 4844} 4845 4846// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 4847// long-running operation. 4848type VirtualMachineScaleSetVMsDeallocateFuture struct { 4849 azure.FutureAPI 4850 // Result returns the result of the asynchronous operation. 4851 // If the operation has not completed it will return an error. 4852 Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error) 4853} 4854 4855// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 4856// long-running operation. 4857type VirtualMachineScaleSetVMsDeleteFuture struct { 4858 azure.FutureAPI 4859 // Result returns the result of the asynchronous operation. 4860 // If the operation has not completed it will return an error. 4861 Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error) 4862} 4863 4864// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 4865// long-running operation. 4866type VirtualMachineScaleSetVMsPowerOffFuture struct { 4867 azure.FutureAPI 4868 // Result returns the result of the asynchronous operation. 4869 // If the operation has not completed it will return an error. 4870 Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error) 4871} 4872 4873// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 4874// long-running operation. 4875type VirtualMachineScaleSetVMsReimageAllFuture struct { 4876 azure.FutureAPI 4877 // Result returns the result of the asynchronous operation. 4878 // If the operation has not completed it will return an error. 4879 Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error) 4880} 4881 4882// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 4883// long-running operation. 4884type VirtualMachineScaleSetVMsReimageFuture struct { 4885 azure.FutureAPI 4886 // Result returns the result of the asynchronous operation. 4887 // If the operation has not completed it will return an error. 4888 Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error) 4889} 4890 4891// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 4892// long-running operation. 4893type VirtualMachineScaleSetVMsRestartFuture struct { 4894 azure.FutureAPI 4895 // Result returns the result of the asynchronous operation. 4896 // If the operation has not completed it will return an error. 4897 Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error) 4898} 4899 4900// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 4901// long-running operation. 4902type VirtualMachineScaleSetVMsStartFuture struct { 4903 azure.FutureAPI 4904 // Result returns the result of the asynchronous operation. 4905 // If the operation has not completed it will return an error. 4906 Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error) 4907} 4908 4909// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 4910// operation. 4911type VirtualMachinesCaptureFuture struct { 4912 azure.FutureAPI 4913 // Result returns the result of the asynchronous operation. 4914 // If the operation has not completed it will return an error. 4915 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 4916} 4917 4918// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 4919// long-running operation. 4920type VirtualMachinesConvertToManagedDisksFuture struct { 4921 azure.FutureAPI 4922 // Result returns the result of the asynchronous operation. 4923 // If the operation has not completed it will return an error. 4924 Result func(VirtualMachinesClient) (OperationStatusResponse, error) 4925} 4926 4927// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4928// long-running operation. 4929type VirtualMachinesCreateOrUpdateFuture struct { 4930 azure.FutureAPI 4931 // Result returns the result of the asynchronous operation. 4932 // If the operation has not completed it will return an error. 4933 Result func(VirtualMachinesClient) (VirtualMachine, error) 4934} 4935 4936// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 4937// long-running operation. 4938type VirtualMachinesDeallocateFuture struct { 4939 azure.FutureAPI 4940 // Result returns the result of the asynchronous operation. 4941 // If the operation has not completed it will return an error. 4942 Result func(VirtualMachinesClient) (OperationStatusResponse, error) 4943} 4944 4945// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4946// operation. 4947type VirtualMachinesDeleteFuture struct { 4948 azure.FutureAPI 4949 // Result returns the result of the asynchronous operation. 4950 // If the operation has not completed it will return an error. 4951 Result func(VirtualMachinesClient) (OperationStatusResponse, error) 4952} 4953 4954// VirtualMachineSize describes the properties of a VM size. 4955type VirtualMachineSize struct { 4956 // Name - The name of the virtual machine size. 4957 Name *string `json:"name,omitempty"` 4958 // NumberOfCores - The number of cores supported by the virtual machine size. 4959 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 4960 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 4961 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 4962 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 4963 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 4964 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 4965 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 4966 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 4967 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 4968} 4969 4970// VirtualMachineSizeListResult the List Virtual Machine operation response. 4971type VirtualMachineSizeListResult struct { 4972 autorest.Response `json:"-"` 4973 // Value - The list of virtual machine sizes. 4974 Value *[]VirtualMachineSize `json:"value,omitempty"` 4975} 4976 4977// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 4978// operation. 4979type VirtualMachinesPowerOffFuture struct { 4980 azure.FutureAPI 4981 // Result returns the result of the asynchronous operation. 4982 // If the operation has not completed it will return an error. 4983 Result func(VirtualMachinesClient) (OperationStatusResponse, error) 4984} 4985 4986// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 4987// operation. 4988type VirtualMachinesRedeployFuture struct { 4989 azure.FutureAPI 4990 // Result returns the result of the asynchronous operation. 4991 // If the operation has not completed it will return an error. 4992 Result func(VirtualMachinesClient) (OperationStatusResponse, error) 4993} 4994 4995// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 4996// operation. 4997type VirtualMachinesRestartFuture struct { 4998 azure.FutureAPI 4999 // Result returns the result of the asynchronous operation. 5000 // If the operation has not completed it will return an error. 5001 Result func(VirtualMachinesClient) (OperationStatusResponse, error) 5002} 5003 5004// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 5005// operation. 5006type VirtualMachinesStartFuture struct { 5007 azure.FutureAPI 5008 // Result returns the result of the asynchronous operation. 5009 // If the operation has not completed it will return an error. 5010 Result func(VirtualMachinesClient) (OperationStatusResponse, error) 5011} 5012 5013// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 5014// status summary. 5015type VirtualMachineStatusCodeCount struct { 5016 // Code - READ-ONLY; The instance view status code. 5017 Code *string `json:"code,omitempty"` 5018 // Count - READ-ONLY; The number of instances having a particular status code. 5019 Count *int32 `json:"count,omitempty"` 5020} 5021 5022// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 5023type WindowsConfiguration struct { 5024 // 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. 5025 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 5026 // EnableAutomaticUpdates - Indicates whether virtual machine is enabled for automatic updates. 5027 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 5028 // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" 5029 TimeZone *string `json:"timeZone,omitempty"` 5030 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 5031 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 5032 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 5033 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 5034} 5035 5036// WinRMConfiguration describes Windows Remote Management configuration of the VM 5037type WinRMConfiguration struct { 5038 // Listeners - The list of Windows Remote Management listeners 5039 Listeners *[]WinRMListener `json:"listeners,omitempty"` 5040} 5041 5042// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 5043type WinRMListener struct { 5044 // Protocol - Specifies the protocol of listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 5045 Protocol ProtocolTypes `json:"protocol,omitempty"` 5046 // 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>} 5047 CertificateURL *string `json:"certificateUrl,omitempty"` 5048} 5049