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