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